Wiki
Home › Root servers › Updates and security updates

Updates and security updates

Refresh package lists and enable automatic security updates.

  1. Update the package lists and bring the system up to date. As root:
    apt update && apt upgrade -y

    As a normal user with sudo:

    sudo apt update && sudo apt upgrade -y
  2. Install automatic security updates. As root:
    apt install -y unattended-upgrades && dpkg-reconfigure -plow unattended-upgrades

    As a normal user with sudo:

    sudo apt install -y unattended-upgrades && sudo dpkg-reconfigure -plow unattended-upgrades
  3. Check whether a reboot is needed (kernel updates):
    [ -f /var/run/reboot-required ] && echo "Reboot needed" || echo "No reboot needed"

    As root and as a normal user it is the same command, without sudo. Reading the file needs no permissions.

After a kernel update, the server must be restarted so that the new kernel runs. If possible, restart outside of main business hours.