os: ubuntu23.10 -- 更新脚本(update)
一、ubuntu23.10 更新脚本
1 [wit@ubuntu:null]$ cat ~/user/tools/update 2 #!/usr/bin/env bash 3 4 5 6 echo "---- update ----" ; 7 echo ; 8 echo 211224ln | sudo -S date "+%F %T" ; 9 echo 211224ln | sudo -S apt update -y; 10 echo 211224ln | sudo -S apt upgrade -y; 11 echo 211224ln | sudo -S apt update -y; 12 echo 211224ln | sudo -S apt upgrade -y; 13 echo 211224ln | sudo -S apt autoremove -y; 14 echo 211224ln | sudo -S apt autoclean -y ; 15 echo ; 16 echo "---- update ----" ; 17 [wit@ubuntu:null]$ 18 [wit@ubuntu:null]$
二、参考文档
1、 格式: echo "PASSWORD" | sudo -S <command>
2、Linux之sudo自动输入密码 https://www.cnblogs.com/kn-zheng/p/17464033.html
标签:--,sudo,update,apt,echo,ubuntu23.10,211224ln From: https://www.cnblogs.com/lnlidawei/p/17792431.html