# System Update



# Update With The Latest Update

## Updating packages

1. Run the command below and press 'y' at the prompt. After the update has finished, restart the server.

```
yum update
```

# Configure Automatic Updates

## Setting Up Automatic Updates

### Install yum-cron

1. Install yum-cron, the package that allows us to do automatic updates

```
yum -y install yum-cron
```

### Configure yum-cron for auto-update

1. Edit the file /etc/yum/yum-cron.conf and change the options below

```
apply_updates = no

to

apply_updates = no
```

```
emit_via = stdio

to

emit_via = email
```

```
email_to = 

to

email_to = sys admin email address
```

### Verify that the service is running

1. Very that the service is running with the command

```
systemctl status yum-cron.service
```

The output should look similar to

```
# /bin/systemctl status  yum-cron.service
yum-cron.service - Run automatic yum updates as a cron job
   Loaded: loaded (/usr/lib/systemd/system/yum-cron.service; enabled)
   Active: active (exited) since sab 2014-08-09 00:37:16 CEST; 16h ago
  Process: 830 ExecStart=/bin/touch /var/lock/subsys/yum-cron (code=exited, status=0/SUCCESS)
 Main PID: 830 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/yum-cron.service
```

If the service is stopped, start it with the following command

```
systemctl start yum-cron.service
```

# Configure Network Time Protocol (NTP)

### Install NTP Daemon

1. Install NTPd with the following command

```
yum -y install ntp
```

### Configure Firewall

1. Add NTP service to the 'allow' rules and reload the firewall to apply changes

```
firewall-cmd --add-service=ntp --permanent

firewall-cmd --reload
```

### Edit ntp.conf File

1. Change/add the /etc/ntp.conf by removing current time servers and adding new time servers

```
Change from

# hetzner ntp servers
server ntp1.hetzner.de iburst
server ntp2.hetzner.com iburst
server ntp3.hetzner.net iburst

to

# hetzner ntp servers
# server ntp1.hetzner.de iburst
# server ntp2.hetzner.com iburst
# server ntp3.hetzner.net iburst

Add the following time servers
==============================

server 0.pool.ntp.org
server 1.za.pool.ntp.org
server 2.africa.pool.ntp.org
```

### Start And Check NTP service

1. Start NTP service and check to see if it is active

```
Start and enable NTPd
=====================

systemctl start ntpd
systemctl enable ntpd

Check to see if service is enabled
==================================

ntpq -p
```

