Knowledge Base
Tutorials
Tutorials
  • How to install Joomla 4.2.2 on Ubuntu 20.04?
  • How to set and execute environment and shell variables in Linux?
  • How to employ Docker containers?
  • How to access PostgreSQL Image?
  • How to add and delete users on Ubuntu 20.04?
  • How to add swap space on Ubuntu 20.04?
  • How to back up, restore, and migrate a MongoDB database on Ubuntu 20.04?
  • How to configure additional SSH keys to your public cloud instance?
  • How to configure static IP on Ubuntu?
  • How to create a CLI with Python Fire on Ubuntu 22.04?
  • How to create a new user and manage permissions in MySQL?
  • How to create an instance with Terraform?
  • How to import and export a MongoDB database on Ubuntu 20.04?
  • How to install 7zip on Ubuntu 20.04?
  • How to install AIDE on Ubuntu 22.04?
  • How to install Anaconda on Ubuntu 20.04?
  • How to install and use Docker on Ubuntu 20.04?
  • How to install and use Elinks on Ubuntu 20.04?
  • How to install and use PostgreSQL on Ubuntu 20.04?
  • How to install Android Studio on Ubuntu 22.04?
  • How to install Angular on Ubuntu 20.04?
  • How to install Ansible on Ubuntu 20.04?
  • How to install Apache Kafka on Ubuntu 20.04?
  • How to install Apache Maven on Ubuntu 20.04?
  • How to install Asterisk on Ubuntu 20.04?
  • How to install Atom Text Editor on Ubuntu 20.04?
  • How to install Blender on Ubuntu?
  • How to install CFEngine3 on Ubuntu 20.04?
  • How to install Code::Blocks on Ubuntu 20.04?
  • How to install Composer on Ubuntu 22.04?
  • How to install Curl on Ubuntu 20.04?
  • How to install Desktop GUI on Ubuntu 20.04?
  • How to install Discord on Ubuntu 22.04?
  • How to install Django on Ubuntu 20.04?
  • How to install Docker Compose on Ubuntu 20.04?
  • How to install ELK on Debian 10 or Debian 11?
  • How to install Fail2ban on Debian 10?
  • How to install FFmpeg on Ubuntu 20.04?
  • How to install Flask on Ubuntu 20.04?
  • How to install Fish Shell in Ubuntu 20.04?
  • How to install Gedit on Ubuntu 20.04?
  • How to install Git on Ubuntu 20.04?
  • How to install Gitea on Ubuntu 20.04?
  • How to install Gitlab on Ubuntu 20.04?
  • How to install Go on Ubuntu 20.04?
  • How to install Google Chrome on Ubuntu 20.04?
  • How to install Gradle on Debian 10?
  • How to install Gradle on Ubuntu 20.04?
  • How to install Grafana on Ubuntu 20.04?
  • How to install Hadoop on Ubuntu 20.04?
  • How to install Homebrew on Linux?
  • How to install JAVA with APT on Ubuntu 20.04?
  • How to install Julia on Ubuntu 20.04?
  • How to install Jupyter on an Ubuntu Linux VM?
  • How to install Kdenlive on Ubuntu 20.04?
  • How to install Logwatch on Ubuntu 20.04?
  • How to install MariaDB on Ubuntu 22.04?
  • How to install Memcached on Debian 10?
  • How to install Microsoft Edge Browser on Ubuntu 22.04?
  • How to install MongoDB on CentOS 7?
  • How to install MongoDB on Linux?
  • How to install Mono on Debian 10?
  • How to Install Mono on Ubuntu 20.04?
  • How to install Mozilla Firefox on Ubuntu 20.04?
  • How to install MySQL on Ubuntu 22.04?
  • How to install Nagios on Ubuntu 20.04?
  • How to install Nginx on CentOS 8?
  • How to install Nginx on Ubuntu 22.04?
  • How to install Node.js on Ubuntu 22.04?
  • How to install NVIDIA CUDA on Ubuntu 20.04?
  • How to install Nvidia Optimus Driver on Ubuntu 22.04?
  • How to install OpenCV on Ubuntu 20.04?
  • How to install Perl on Ubuntu on 22.04?
  • How to install Pacman on Ubuntu 20.04?
  • How to install phpMyAdmin on Ubuntu 20.04?
  • How to install PIP on CentOS 8?
  • How to install Plex media server on Ubuntu 20.04?
  • How to install Podman on Ubuntu 20.04?
  • How to install Poetry on Ubuntu 22.04?
  • How to install Postman on Ubuntu 20.04?
  • How to install ProcessWire on Ubuntu 20.04?
  • How to install PyQuery package on Ubuntu 20.04?
  • How to install Python 3 on Ubuntu 22.04 and set up a programming environment?
  • How to install Python on Windows 10 using UI and Windows command prompt?
  • How to install R on Ubuntu 20.04?
  • How to install Ruby on Rails on Ubuntu 20.04?
  • How to install Ruby on Ubuntu 20.04 and setup programming environment?
  • How to install Rust on Ubuntu 22.04?
  • How to install Samba on Ubuntu 20.04?
  • How to install Skype on Ubuntu 20.04?
  • How to install Rancher on Ubuntu 20.04?
  • How to install Slack on Ubuntu 20.04?
  • How to install Springboot on Ubuntu 20.04?
  • How to install Spyder IDE in Ubuntu?
  • How to install Steam on Ubuntu 20.04?
  • How to install Strapi for Production on Ubuntu 20.04?
  • How to install TeamViewer on Ubuntu 20.04?
  • How to install TensorFlow on Ubuntu 20.04?
  • How to install Apache Web Server on Ubuntu 20.04?
  • How to install the Deno JavaScript Runtime on Ubuntu 20.04?
  • How to install Open LiteSpeed Web Server on Ubuntu 22.04?
  • How to install Sublime Text Editor on Ubuntu 20.04?
  • How to install tix package on Ubuntu 20.04?
  • How to install Vagrant on Ubuntu 20.04?
  • How to install Vim on Ubuntu 20.04?
  • How to install VirtualBox on Ubuntu 20.04?
  • How to install VLC Media Player on Ubuntu 20.04?
  • How to install VMware Workstation Player on Ubuntu 20.04?
  • How to install vscode on Ubuntu 20.04?
  • How to install Webmin on Ubuntu 20.04?
  • How to install Wine on Ubuntu 20.04?
  • How to install WordPress on Ubuntu 20.04?
  • How to install Xibo on Ubuntu 20.04?
  • How to install Zoom on Ubuntu 20.04?
  • How to install Yarn on Ubuntu 20.04?
  • How to keep Ubuntu 22.04 servers updated?
  • How to monitor system authentication logs on Ubuntu 20.04?
  • How to perform basic administration tasks for Storage Devices in Linux?
  • How to set up Jenkins on Ubuntu 20.04?
  • How to setup OpenVPN on Ubuntu 20.04?
  • How to setup time synchronization on Ubuntu 20.04?
  • How to setup a UFW on an Ubuntu or Debian Cloud Server?
  • How to setup SSH keys in Ubuntu 20.04?
  • How to SSH terminal through MobaXterm and PuTTY in Windows?
  • How to Use Ansible to Install and Set Up Docker on Ubuntu 20.04?
  • How to view system users on Ubuntu 20.04?
  • How to make OpenStack accessible through CLI?
  • How to make Block Storage available for Linux?
  • Script for automated incremental backups
  • How to configure a Git repository using Linux CLI?
  • How to enable remote access on MySQL?
  • How to Mount a S3 Bucket on Linux Instance?
  • How to access MySQL database credentials?
  • How to create an incremental backup using CLI?
  • How to set up web-based SQL server on OpenStack instance using SQL image?
Powered by GitBook
On this page
  • Overview
  • Prerequisites
  • Get Started
  • Conclusion

Was this helpful?

How to keep Ubuntu 22.04 servers updated?

PreviousHow to install Yarn on Ubuntu 20.04?NextHow to monitor system authentication logs on Ubuntu 20.04?

Last updated 1 year ago

Was this helpful?

Overview

As with any operating system, keeping Ubuntu 22.04 servers updated is crucial to maintain their security, stability, and functionality. Regular updates are released to fix bugs, address vulnerabilities, and enhance features. Failure to keep servers updated can lead to system crashes, data breaches, and other security risks. It is also essential to keep in mind that outdated software can become incompatible with newer applications, leading to performance issues and other problems. Regular updates ensure that your Ubuntu servers are running the latest versions of software, providing optimal performance, reliability, and security. Therefore, it is essential to keep Ubuntu 22.04 servers updated to ensure they run efficiently and securely.

Here is a step-by-step tutorial on how to keep your Ubuntu 22.04 servers updated.

Prerequisites

There are certain prerequisites that need to be met before you begin.

  • Ubuntu 20.04 LTS configured on your system.

  • Non-root sudo user privileges.

Get Started

To ensure that your server is able to upgrade automatically, you must make sure that all applications on the server can restart correctly after an unplanned outage or reboot. In addition to ensuring that the services are managed by the init system provided by your operating system, you should consider writing scripts that can restart these services automatically after an outage.

Step 1: Configure Automatic Updates

Using 'apt update' and 'apt upgrade' commands to perform unattended upgrades on your Ubuntu packages is a convenient way to keep your servers up to date with the latest security patches, bug fixes and updates. This automated process will download newer versions of all packages on your server, install them and then begin the upgrade process automatically.

  • Update the package index:

sudo apt update
  • Install the Ubuntu 'unattended-upgrades' package to automatically configure the security patches and other critical updates for the server:

sudo apt install unattended-upgrades
  • Verify the status of the service:

sudo systemctl status unattended-upgrades.service
  • For the majority of the packages in the Ubuntu repositories, unattended-upgrades' standard configuration will automatically download security and bug repair updates. You can further customize the unattended-upgrades service to avoid upstream modifications in case there are older versions of packages, or the server operates with third-party package repositories. To do so, modify the configuration stored in its specific file mentioned in the command.

sudo nano /etc/apt/apt.conf.d/50unattended-upgrades

You will notice in the '/etc/apt/apt.conf.d/50unattended-upgrades' file that are there are certain lines of code that start with (//).

The first configuration block specifies which packages will be updated automatically and follows a template for the names of Ubuntu package repositories. The files in the core and the -security repository are scheduled for default update. Whereas the lines containing the -updates, -backports, and -proposed repositories are disabled by default due to their higher likelihood of containing modifications that could damage your existing packages.

You can remove the (//) symbols from these lines to initiate manual unattended upgrades for them.

Also, there are several options with true/false setting toggles are located in the file. For instance, packages that require a reboot to take effect after installation, a toggle is set up to automatically reboot the system after that. You just need to activate this option by removing the (//) symbol and set the value to 'true' instead of 'false'. The drawback is that this change will make your server inaccessible at random times. Make sure your users or applications can withstand downtime before enabling this option.

Save the changes to the file and close it.

  • If you have changed the configuration file as specified above, apply these changes to the service by restarting it using the following command:

sudo systemctl restart unattended-upgrades.service

Step 2: Update the Kernel and Enable Livepatch

The Linux kernel is the core of Linux distributions. It contains the low-level operating system and device drivers, along with support for many high-level system software components. It handles all software functions, including hardware drivers, memory management, and file I/O operations. Kernel updates are one of the most frequent packages you will need to install on a Linux server. If your installation has become outdated or in need of major improvement, it can be problematic. Multiple vulnerabilities have been discovered in the Linux kernel over the years, and these create constant pressure to patch these systems whenever new versions become available.

Most commercial and mission-critical Linux deployments require the ability to automate their kernel updates. There are no standard mechanisms in place, but you can configure your unattended apt systems to automatically install new kernels and reboot for you in a reliable manner.

sudo snap install canonical-livepatch
  • Activate canonical-livepatch by running the 'enable' command followed by the key obtained from their website:

sudo canonical-livepatch enable <your-key>

The output will display the message 'Successfully enabled device'.

  • You can verify the status of the service, which should now operate automatically in the background without any intrusion:

sudo canonical-livepatch status

Conclusion

By following this tutorial, you can keep your Ubuntu 22.04 servers up-to-date and secure. It is important to regularly check for updates and install them promptly to ensure the security and stability of your server.

Get a Livepatch key by registering at as an Ubuntu user. Once the registration is successful, fetch the key and begin the installation of canonical-livepatch package using Snap (an Ubuntu package manager).

Canonical Livepatch Service Center