Menu
blog.headdesk.me
blog.headdesk.me

Upgrade Ubuntu 16.04 to latest release

Posted on 2022/04/192022/04/29

Ubuntu 16.04 went EOL on April 2021. In this post, I will demonstrate how to do an in-place upgrade to the latest release.

For this exercise, I first installed Ubuntu 16.04 server using the official iso file. I selected the LAMP package group as I am interested to see how Ubuntu handles the upgrade of mysql. These are what I have after installation:

root@ubuntu:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.7 LTS
Release: 16.04
Codename: xenial
root@ubuntu:~# mysql --version
mysql Ver 14.14 Distrib 5.7.31, for Linux (x86_64) using EditLine wrapper

root@ubuntu:~# apachectl -v
Server version: Apache/2.4.18 (Ubuntu)
Server built: 2020-06-15T14:09:55

root@ubuntu:~# php -v
PHP 7.0.33-0ubuntu0.16.04.15 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.33-0ubuntu0.16.04.15, Copyright (c) 1999-2017, by Zend Technologies

Upgrade to 18.04

The upgrade process is no different than any other upgrade. First, run the following to update all packages.

apt -y upgrade
reboot

Next, run the following command to begin upgrading the OS to 18.04 bionic. This will run for 10-15 minutes. The tool will ask a few questions, it is ok to answer yes to all of them. The system will reboot at the end.

do-release-upgrade

When the OS comes back, it has been successfully upgraded. No drama on the OS or LAMP.

root@ubuntu:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.6 LTS
Release: 18.04
Codename: bionic
root@ubuntu:~# mysql --version
mysql Ver 14.14 Distrib 5.7.37, for Linux (x86_64) using EditLine wrapper
root@ubuntu:~# apachectl -v
Server version: Apache/2.4.29 (Ubuntu)
Server built: 2022-03-16T16:53:42
root@ubuntu:~# php -v
PHP 7.2.24-0ubuntu0.18.04.11 (cli) (built: Mar 2 2022 17:52:35) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.24-0ubuntu0.18.04.11, Copyright (c) 1999-2018, by Zend Technologies

Upgrade from 18.04 to 20.04 focal

Run the same command again and it will upgrade to 20.04. If you do not have any package installed from PPA or any other sources, the upgrade should be successful just like the last one.

do-release-upgrade

After rebooting, I am now on 20.04. Mysql is successfully upgraded with no manual steps.

root@ubuntu:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal

root@ubuntu:~# mysql --version
mysql Ver 8.0.28-0ubuntu0.20.04.3 for Linux on x86_64 ((Ubuntu))

root@ubuntu:~# apachectl -v
Server version: Apache/2.4.41 (Ubuntu)
Server built: 2022-03-16T16:52:53

root@ubuntu:~# php -v
PHP 7.4.3 (cli) (built: Mar 2 2022 15:36:52) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies

Wrapping up

One of the things I like about Ubuntu is the ability to perform in-place upgrade. And it is fairly straight forward. Once again, as long as there is no externally installed packages, the upgrade should go without problem. If you do have those installed, you may need to uninstall them and reinstall them manually. They are likely to cause dependency problems and prevent do-release-upgrade from completing.

Loading

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Full text search

Recent Posts

  • Generate secure password
  • AWS Compute Savings Plans
  • AWS Zonal Shift
  • Coffee break…
  • Prevent private key from being committed to git
  • aws (14)
  • coffee (2)
  • headfi (1)
  • linux (9)
  • others (61)
  • security (2)
  • tech (41)
  • terraform (3)
  • wordpress (2)

Loading

apache aws awscli azure backup boot cloud coffee docker ec2 EL8 ElasticBeanstalk espresso featured git kernel lelit linux lvm meltdown MFA nat gateway php power proliant python rdp Redhat RHEL rpm Ryzen scp security smartarray smart switch snapshot spectre tech terraform ubuntu ubuntu upgrade vpn windows wordpress workspace

©2026 blog.headdesk.me | Powered by SuperbThemes