System Update
Update With The Latest Updates
Updating the server with the latest updates
Adding additional repositories
- Enable any additional and necessary software repositories by editing /etc/apt/sources.list
Open /etc/apt/sources.list
==========================
vi /etc/apt/sources.list
Enable repository by removing the # sign i.e.
=============================================
#deb http://de.archive.ubuntu.com/ubuntu/ xenial main restricted
to
deb http://de.archive.ubuntu.com/ubuntu/ xenial main restricted
Updating the server
- Run the below commands one after the other, accepting the prompts
apt-get update
apt-get upgrade
Configure Automatic Updates
Setting up automatic updates
Installing unattended-upgrades package
- Install unattended-upgrades package
apt-get install unattended-upgrades
Configuring unattended-upgrades
- Edit /etc/apt/apt.conf.d/50unattended-upgrades and adjust the following
Unattended-Upgrade::Allowed-Origins {
"${distro_id}:${distro_codename}";
"${distro_id}:${distro_codename}-security";
// "${distro_id}:${distro_codename}-updates";
// "${distro_id}:${distro_codename}-proposed";
// "${distro_id}:${distro_codename}-backports";
};
Enable automatic updates
- Edit /etc/apt/apt.conf.d/20auto-upgrades and set the appropriate apt configuration options
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
APT::Periodic::Unattended-Upgrade "1";
Configure Network Time Protocol (NTP)
Network Time Protocol (NTP) configuration
- Synchronize the system clock with the command below
apt-get -y install ntp ntpdate