Question: Currently, to get things up to date on my Raspberry Pi, I have to type in `sudo apt-get update` and `sudo apt-get upgrade`. Is there a way to set it up to automatically do this? I am running Raspbian Jessie.

Answer: 
In its default configuration, `unattended-upgrades` is broken in Raspbian Buster. It won't install crucial updates for the kernel and other software. Your options are:

**Recommended Option:**

* Install and [fix unattended-upgrades](https://raspberrypi.stackexchange.com/questions/38931/how-do-i-set-my-raspberry-pi-to-automatically-update-upgrade#comment130516_38990):

```
sudo apt install unattended-upgrades

echo 'Unattended-Upgrade::Origins-Pattern {
//      Fix missing Rasbian sources.
        "origin=Debian,codename=${distro_codename},label=Debian";
        "origin=Debian,codename=${distro_codename},label=Debian-Security";
        "origin=Raspbian,codename=${distro_codename},label=Raspbian";
        "origin=Raspberry Pi Foundation,codename=${distro_codename},label=Raspberry Pi Foundation";
};' | sudo tee /etc/apt/apt.conf.d/51unattended-upgrades-raspbian

```

For faster security updates (but less stability, as the packages haven't been approved for rasbian), you can add debian-security packages to apt:

```
echo 'deb http://deb.debian.org/debian-security/ buster/updates main contrib non-free' | sudo tee /etc/apt/sources.list.d/debian-security.list

```

You will probably need to [install new apt keys for the debian repository](https://unix.stackexchange.com/a/205732).

**Other Options:**

* Work around it with by using cron-apt:
`sudo apt install cron-apt`

It's recommended to use unattended-updates and fix the package, because it's best suited for the purpose. Cron-apt is your second-best option, because it's also designed for a similar purpose. I'm not sure cron-apt can automatically reboot your system after a kernel update. Unattended-upgrades has that option, and in my experience reboot after kernel upgrade works with the fix above.
You can install and configure cron-apt. Install it by doing the following:

`apt-get install cron-apt`

the main configuration file is /etc/cron-apt/config

One thing I add to my configuration is:

```
MAILON="always"

```

this will send an email every time it runs, not only if it encounters an error. 

Note that the default setup will not automatically install the updates (there are some good reasons to not do this), but you can config it to do so. One advantage this program provides over a simple cron solution is that it gives you control over what gets installed (only download new packages, install security updates or install all updates).

To set the time it runs edit the /etc/cron.d/cron-apt file.

You can find more info and config options [here](http://www.the-art-of-web.com/system/cron-apt-wheezy/)

The package includes very good documentation, however it is gzipped. To extract the file:

1. create a directory to work in - mkdir cron-apt\_documentation
2. change to the new directory - cd cron-apt\_documentation
3. copy the compressed file - cp /usr/share/doc/cron-apt/README.gz . (note the trailing dot)
4. uncompress the file - gunzip README.gz
5. read the file - cat README | less