This article contains some tips to ease the upgrade LTS in a productivity scenario/work environment.
I. preparation and backup
Because it is my working Ubuntu, backup is essential before even thinking about upgrade. not only documentation, configuration under `/etc` should also be backed up.
Follow the guide in https://www.cyberciti.biz/faq/upgrade-ubuntu-18-04-to-20-04-lts-using-command-line/ except the upgrade command:
RELEASE_UPGRADER_ALLOW_THIRD_PARTY=1 update-manager -d
RELEASE_UPGRADER_ALLOW_THIRD_PARTY=1
will try to enable PPA if focal’s PPA is available. It is a new feature after Ubuntu 18.10, I think.
Another preparation is get the python3 packages list installed by pip3
, do not worry about python2, you should not use it any more.
ls /usr/lib/python3/dist-packages
for system apt installed “python3-*”
ls /usr/local/lib/python3.6/dist-packages/
for sudo pip3 installed
ls ~/.local/lib/python3.6/dist-packages/
for pip3 installed
to save the list pip3 list --path "one_path_from_above" > pip_installed_list.txt
for all 3 paths
II. During upgrade
- view details of not supported and disabled module
- find the upgrade log:
/var/log/dist-upgrade
there are several log files under the folder with date-time as the name - view the difference of configuration files, to decide which version to keep, remote maintainer’s or local modified version. e.g.
Configuration file ‘/etc/cups/cups-browsed.conf’
==> Modified (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
What would you like to do about it ? Your options are:
Y or I : install the package maintainer’s version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : start a shell to examine the situation
The default action is to keep your current version.
cups-browsed.conf (Y/I/N/O/D/Z) [default=N] ?
III. Postwork
1. Third-party PPA
ubuntu 18.04 official repositories are not removed, so remove them in GUI tool, I use synapitcs
package manager, menu “settings->repository”, inside the “other software” tab
go through the list of PPA, manually replace “bionic” to “focal”, Ubuntu 20.04 should have done the replacement, if RELEASE_UPGRADER_ALLOW_THIRD_PARTY is set during upgradeRELEASE_UPGRADER_ALLOW_THIRD_PARTY=1 update-manager -d
There may be always some PPA have not got latest Ubuntu supported, but it is fine to leave them for the moment. From Ubuntu 18.04 to Ubuntu 20.04, some software from 18.04 PPA is still working if not disabled during upgrade, because the C and C++ runtime are ABI compatible
2. Python3 binary package/module
python 3.6 (Ubuntu 18.04) to python 3.8 (Ubuntu 20.04)) all packages with C extension will break, actually pip installed packages are not visible to python 3.8. all site packages are installed per minor python version e.g. `python3.6`
If pip installed lists are save before hand, you can explore the package name by
ls /usr/lib/python3/dist-packages
for system apt installed
ls /usr/local/lib/python3.6/dist-packages/
for sudo pip installed
ls ~/.local/lib/python3.6/dist-packages/
for pip installed
to save the list pip3 list --path "path_from_below" > pip_installed_list.txt
virtualenv: just remove the folder of virtualenv, re-create the virtualenv.
3. other software
+ Some other software may be compiled from source,then they need a rebuild.
+ Some software are downloaded and installed as a binary, may just work, as C and C++ runtime are ABI compatible
+ applications in snap, AppImage format are safe to run
+ other software package like java JNI may not work