Updating Ubuntu on EC2 instance

0

I am running Ubuntu 22.04 on an EC2 instance. It is acting as a virtual host using Apache2 for several domains.

When I connect to it with SSH, I get the following output:

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:~$ 

Do I need to run the following three commands to update the system?

sudo apt update
sudo apt upgrade
sudo systemctl reload apache2

Is this something I need to do periodically or can I instruct Ubuntu to do it on a regular basis. I do not want to write a script and run it using CRON because that is getting outside my experience and I am trying to keep my system as simple as possible.

已提問 1 年前檢視次數 2223 次
1 個回答
1
已接受的答案

Restarting apache is not enough. You need to restart the server as you can see in the prompt of you machine:

*** System restart required ***

Kernel updates require a restart, otherwise the are not being applied.

If you want automatic update you have to install "unattended-upgrades" an configure what you want to be installed automatically.

已回答 1 年前
  • Is that done from EC2 console > Instance state > Reboot instance ?

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南