ps. 方法一已测试,方法二未测试
方法一
列出可用的安全更新
sudo apt-get -s dist-upgrade | grep "^Inst" | grep -i securi
安装安全更新
sudo apt-get -s dist-upgrade | grep "^Inst" | grep -i securi | awk -F " " {'print $2'} | xargs apt-get install
方法二
列出可用的安全更新
sudo apt list --upgradable | grep -e "-security"
安装安全更新
sudo apt list --upgradable | grep -e "-security" | awk -F "/" '{print $1}' | xargs apt install