Update procedures for Ubuntu Server, Nginx and MySql

These update procedures contain only essential information and best practices for updating a running ubuntu server and keeping the downtime low.

Ubuntu 16.04.6 to Ubuntu 18.04

Backup – If you use a cloud hoster like digitalocean, create a snapshot. It’s recommended to power off the VM before creating the snapshot for keeping file integrity. If you do not use a virtual machine or cloud hoster, it is recommended to make a copy of the entire file system. At least you need to back up the directories /home, /etc and /var

Update Installed Packages

Before beginning the release upgrade, it’s recommended to update to the latest versions of all packages for the current release. Update the package list:

sudo apt-get update

Next, upgrade installed packages to their latest available versions:

sudo apt-get upgrade

When this is finished use the command below. This will execute additional updates that require changing dependencies, adding, or removing new packages if necessary. It will process upgrade steps which may have been kept back by apt-get upgrade.

sudo apt-get dist-upgrade

Upgrade Ubuntu to 18.04

sudo do-release-upgrade

Update from MySQL 5.7 to 8.0

Download package config

wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb

reconfigure packages

sudo dpkg -i mysql-apt-config_0.8.13-1_all.deb

Update packages

sudo apt-get update

Update MySQL

sudo apt install mysql-client or mysql-server