# 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
```