# System Update



# Update With The Latest Updates

### Updating the server with the latest updates

#### Adding additional repositories

1. 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

1. 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 <span class="app application">unattended-upgrades</span> package

1. Install unattended-upgrades package  
      
    `apt-get install unattended-upgrades`

#### Configuring unattended-upgrades

1. Edit <span class="file filename">/etc/apt/apt.conf.d/50unattended-upgrades</span> 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

1. Edit <span class="file filename">/etc/apt/apt.conf.d/20auto-upgrades</span> and set the appropriate <span class="app application">apt</span> 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

1. Synchronize the system clock with the command below

```
apt-get -y install ntp ntpdate
```

