How To Update Ubuntu

Share
Update UbuntuUpdate Ubuntu Server or Ubuntu Desktop

Hello everyone, how are you all doing today? I am doing great and I hope you are all as well. We have some great news. We now have well over 195,500 monthly email subscribers! That’s quiet good for a site that is now 4 years old. I really thank you all for trusting us as we are growing into one of the most respected and trusted source for Ubuntu and Linux related content. Again, thank you all. Anyway, please read on…

Today we will highlight how to update Ubuntu manually or automatically, of course this will also update your Ubuntu Server to latest version using these simple command-line commands. Ready? Let us begin.

Steps To Update Ubuntu

Ubuntu System Updates

Keeping the system updated is vital before starting anything on your system. This will prevent people to use known vulnerabilities to enter in your system.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove
sudo apt-get autoclean

Enable Automatic Security Updates On Ubuntu

Enable automatic updates can be crucial for your server security. It is very important to stay up to date.

You can install the unattended-upgrades by using this command:

sudo apt-get install unattended-upgrades

To enable it, run:

sudo dpkg-reconfigure -plow unattended-upgrades

This will create the file /etc/apt/apt.conf.d/20auto-upgrades with the following contents:

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";

Customize Automatic Updates On Ubuntu

You can customize the automatic updates if you prefer. For example, you can get notifications when a security update is completed.

To enable ONLY security updates, please change the code to look like this:

  // Automatically upgrade packages from these (origin:archive) pairs
  Unattended-Upgrade::Allowed-Origins {
      "${distro_id}:${distro_codename}-security";
  //  "${distro_id}:${distro_codename}-updates";
  //  "${distro_id}:${distro_codename}-proposed";
  //  "${distro_id}:${distro_codename}-backports";
  };

To get notification by email, update the following line with your email address:

//Unattended-Upgrade::Mail "my_user@my_domain.com";

Quick Links: Ubuntu Server Guide, Free Ubuntu Books

Today’s Popular Linux Article: How To Stop A DDOS Attack