这个脚本简单明了,可以参考以后用来批量安装软件。
是从Rk3399的人脸识别上看到的。
http://blog.csdn.net/bassersai/article/details/73167463
https://pan.baidu.com/s/1pLUELKZ?errno=0&errmsg=Auth%20Login%20Sucess&&bduss=&ssnerror=0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
#!/bin/bash function try2install { dpkg -l | grep "ii $1" > /dev/null if [ $? -eq 0 ]; then echo -e "\033[32m $1 \t\t installed! \033[0m" else echo -e "\034[31m try to install $1, please input your password or press ENTER! \033[0m" sudo apt-get -y install $1 if [ $? -ne 0 ]; then echo -e "\033[31m Fail to install $1, try again! \033[0m" exit 1 fi fi } function install_customer_depdents { try2install libboost-all-dev try2install libopencv-dev try2install libhdf5-dev try2install libgflags-dev try2install libgoogle-glog-dev try2install libleveldb-dev try2install liblmdb-dev try2install libsnappy-dev } function install_developer_depdents { install_customer_depdents try2install protobuf-compiler try2install libprotobuf-dev } ## program starts here if ! [ -z $1 ] && [ $1 = "dev" ] then echo -e "try to install the deb packets for developers!" install_developer_depdents else echo -e "try to install the deb packets for customers!" install_customer_depdents fi |