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.

asked 2 months ago21 views
1 Answer
1
Accepted Answer

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.

answered 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions