【发布时间】:2015-01-13 17:50:12
【问题描述】:
我常用的使机器保持最新状态的命令相当冗长,如果任何命令花费很长时间,它可能会导致不止一个密码提示:
sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get autoremove && sudo apt-get autoclean
我想将其缩短为一个命令(最好不使用全局别名)。
Solution 基于@amra's answer 和another tip:
sudo sh -c 'apt-get update && apt-get upgrade --yes && if [ -f /var/run/reboot-required ]; then echo You should reboot; fi'
【问题讨论】:
-
尝试:sudo -s 然后使用:apt-get update && apt-get dist-upgrade && apt-get autoremove && apt-get autoclean;注销
-
属于 superuser.com