在EC2实例上更新Ubuntu

0

【以下的问题经过翻译处理】 我正在一台EC2实例上运行Ubuntu 22.04。它正在使用Apache2作为多个域名的虚拟主机。

当我使用SSH连接它时,我会得到以下输出:

steve@steve-Inspiron-3268:~$ ssh -i ~/.ssh/key-ub-20220725-1.pem ubuntu@13.41.164.129
Welcome to Ubuntu 22.04 LTS (GNU/Linux 5.15.0-1017-aws x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Thu Oct  6 14:52:02 UTC 2022

  System load:  0.0                Processes:             110
  Usage of /:   26.1% of 24.05GB   Users logged in:       1
  Memory usage: 33%                IPv4 address for eth0: 172.31.32.80
  Swap usage:   0%

 * Ubuntu Pro delivers the most comprehensive open source security and
   compliance features.

   https://ubuntu.com/aws/pro

57 updates can be applied immediately.
To see these additional updates run: apt list --upgradable


*** System restart required ***
Last login: Thu Oct  6 14:44:47 2022 from 3.8.37.27
ubuntu@ip-172-31-32-80:~$ 

我需要运行以下三个命令来更新系统吗?

sudo apt update
sudo apt upgrade
sudo systemctl reload apache2

这是我需要定期执行的任务还是可以指示Ubuntu定期执行。我不想编写脚本并使用CRON来运行它,因为这超出了我的经验范围,我正在尽可能保持系统简单化。

profile picture
专家
已提问 5 个月前21 查看次数
1 回答
0

【以下的回答经过翻译处理】 仅重启apache是不够的。你需要重启服务器,如你的机器提示所示:

*** System restart required ***

内核更新需要重新启动,否则它们不会被应用。

如果你想要自动更新,你需要安装“unattended-upgrades”并配置你希望自动安装的内容。

profile picture
专家
已回答 5 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则