6

I have a HP EliteBook 2540p. I want to upgrade my Ubuntu 16.04 to a newer release. I found that I need to upgrade to 18.04 before going to 20.04.

I tried the recommended procedure by updating the system and upgrading software and packages using this command:

sudo apt update && sudo apt upgrade
Hit:1 http://archive.canonical.com/ubuntu xenial InRelease                                                    
Hit:2 http://ppa.launchpad.net/canonical-chromium-builds/stage/ubuntu xenial InRelease                        
Hit:3 http://repo.mysql.com/apt/ubuntu xenial InRelease                                                       
Hit:4 http://packages.microsoft.com/repos/code stable InRelease                                               
Ign:5 http://repo.vivaldi.com/stable/deb stable InRelease                                                     
Hit:6 http://dl.google.com/linux/chrome/deb stable InRelease                                                  
Hit:7 http://ma.archive.ubuntu.com/ubuntu xenial InRelease                                                    
Get:8 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]                                    
Hit:9 http://ppa.launchpad.net/clipgrab-team/ppa/ubuntu xenial InRelease                                      
Hit:10 http://repo.vivaldi.com/stable/deb stable Release                                                      
Get:11 http://ma.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]                                  
Get:12 https://download.docker.com/linux/ubuntu xenial InRelease [66.2 kB]                                    
Hit:13 http://ppa.launchpad.net/nathan-renniewaldock/flux/ubuntu xenial InRelease                             
Hit:14 https://deb.opera.com/opera-stable stable InRelease                                                    
Hit:15 https://brave-browser-apt-release.s3.brave.com xenial InRelease                                        
Hit:16 https://brave-browser-apt-dev.s3.brave.com xenial InRelease                                            
Hit:17 http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu xenial InRelease                                  
Hit:18 https://brave-browser-apt-beta.s3.brave.com xenial InRelease                                           
Get:19 https://repo.skype.com/deb stable InRelease [4,502 B]                                                  
Hit:20 https://brave-browser-apt-nightly.s3.brave.com xenial InRelease                                        
Hit:21 http://ppa.launchpad.net/noobslab/indicators/ubuntu xenial InRelease
Hit:22 https://esm.ubuntu.com/infra/ubuntu xenial-infra-security InRelease                         
Get:23 http://ma.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]                     
Hit:24 https://deb.nodesource.com/node_5.x xenial InRelease                          
Hit:25 http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease                   
Hit:26 https://esm.ubuntu.com/infra/ubuntu xenial-infra-updates InRelease            
Hit:27 http://ppa.launchpad.net/remmina-ppa-team/remmina-next/ubuntu xenial InRelease                         
Hit:29 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu xenial InRelease
Hit:30 https://packagecloud.io/AtomEditor/atom/any any InRelease
Hit:31 https://packagecloud.io/shiftkey/desktop/any any InRelease
Err:19 https://repo.skype.com/deb stable InRelease
  The following signatures were invalid: KEYEXPIRED 1624268195  KEYEXPIRED 1624268195  KEYEXPIRED 1624268195
Hit:32 https://packagecloud.io/slacktechnologies/slack/debian jessie InRelease
Reading package lists... Done 
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: GPG error: https://repo.skype.com/deb stable InRelease: The following signatures were invalid: KEYEXPIRED 1624268195  KEYEXPIRED 1624268195  KEYEXPIRED 1624268195
E: The repository 'https://repo.skype.com/deb stable InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1

I think I can't get all the updates and upgrades that I need, and I don't know what is the problem.

After that I tried this command to check the available release:

$ sudo do-release-upgrade -c
Checking for a new Ubuntu release
New release '18.04.6 LTS' available.
Run 'do-release-upgrade' to upgrade to it.

It looks like it's working, but when I try the command to upgrade, it doesn't work:

$ sudo do-release-upgrade
Checking for a new Ubuntu release
Please install all available updates for your release before upgrading.

I don't know what the problem is.

  • I wanted to show it, but it makes my question to be considered as a spam – E.Mohammed Sep 24 '21 at 21:41
  • Your paste only mentions apt upgrade which can leave packages behind (see man for guides; apt full-upgrade performs all updates), however as @Nmath has suggested in the answer you won't get all upgrades now without first enabling ESM (if the system is not fully-upgraded you risk having do-release-upgrade tell you to upgrade packages first). You didn't say if this is a desktop, if it is I'd likely perform an upgrade via re-install (ie. no format of partition(s)) to achieve the upgrade; it allows you to skip jump to 20.04 direct with almost all packages re-installed (no python2/Qt4..) – guiverc Sep 24 '21 at 21:57
  • 1
    Are you trying to upload a picture of your terminal? (Please Don't) - You can edit your question to copy-paste. Make sure that you use code fences to retain line breaks and formatting so that we can parse the info. That being said, I think it's a time-consuming endeavor to salvage an outdated installation and it's probably best to install 20.04 cleanly. See below – Nmath Sep 24 '21 at 22:00
  • @Nmath no it wasn't an image, I edited the question and added the output of the apt update – E.Mohammed Sep 24 '21 at 22:28
  • @guiverc I tried the apt full-upgrade and this is the output : @Laptop:~$ sudo apt full-upgrade [sudo] password for mohammed: Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. – E.Mohammed Sep 24 '21 at 22:29
  • @guiverc I forgot to mention that is just my personal laptop. I didn't understand the ESM, but I think there is no solution to do an upgrade, and I need to install the new release – E.Mohammed Sep 24 '21 at 22:43
  • 3
    You have a gargantuan list of sources and a lot of duplicates. You would have to remove these duplicates before you do anything else. Even more than before, with the state of your system I strongly suggest that a clean install is the best option to get to 20.04. In regards to your sources and all of those PPAs: https://askubuntu.com/q/35629 – Nmath Sep 25 '21 at 00:08
  • 2
  • @Ruslan that won't help as ESM releases differ to fully-EOL releases. Ubuntu 16.04 ESM is still supported, even if 16.04 LTS is end of standard support... What you posted will apply come 2026-May (or thereabouts) – guiverc Sep 25 '21 at 08:44
  • 1
    A lot of the hassle when doing a full upgrade is rebuilding your home directory. you may want to backup your home and restore it to the new install. Reinstalling programs is not such a big problem usually. – C.S.Cameron Sep 26 '21 at 01:20

3 Answers3

11

In short, you waited too long to do this easily and effectively.

16.04 is already past standard support, which means that there are no longer updates unless you are on Extended Security Maintenance (ESM). You need to perform updates before you can upgrade to the next release, which you can't do without using ESM. Hence the problem.

You could sign up for ESM, perform your system maintenance, and theoretically should be able to upgrade to 18.04 without incident.

But since you want to be on 20.04, it doesn't really make any sense to release upgrade. You can't easily skip over releases when upgrading and there's always a potential for an upgrade to be unsuccessful, depending on your hardware and whatever is already installed on your system, especially if you have any software that didn't come from Ubuntu repos. Release upgrades also take a long time to complete.

It's probably better that you cleanly install 20.04 at this point. Remember that LTS releases come with 5 years of standard support and if you don't want to be in this predicament in the future, make sure you upgrade in a timely manner. You have three whole years to upgrade after a new LTS to the next LTS before it becomes unsupported.

You can also sign up for the ubuntu-announce mailing list to get emails about new releases and EOL announcements:

https://lists.ubuntu.com/mailman/listinfo/ubuntu-announce

Campa
  • 983
Nmath
  • 12,333
  • so I can't do an upgrade for my laptop and I need a full installation of the 20.04. – E.Mohammed Sep 24 '21 at 22:37
  • 1
    It's the easiest and cleanest path forward – Nmath Sep 25 '21 at 00:09
  • 2
    Absolutely wrong position. Fixing single E: with skype repository is easier. OP should fix this single repository problem, then run sudo apt-get update to get correct package lists and then install all the upgrades for 16.04 by sudo apt-get dist-upgrade, then reboot and run sudo do-release-upgrade . – N0rbert Sep 25 '21 at 06:23
  • 1
    @N0rbert - OP wants 20.04 – Nmath Sep 25 '21 at 07:00
  • 2
    Then run sudo do-release-upgrade twice. Not a problem at all. – N0rbert Sep 25 '21 at 07:00
  • I signed up to ESM and did some updates, but the skype problem style persiste and don't know how to solve it, I was learning on this laptop and didn't have many knowledge like virtuel env ... that's why I have a messy list of packages. and I can't do the upgrade. – E.Mohammed Sep 26 '21 at 18:19
  • 1
    @Nmath, I appreciate your recommandation and agree with it. to do a fresh installation I need to save all my data in an external hard drive which I don't have (many giga of files and data) that's why I'm looking for a way to keep my data and upgrade to the last release. I'm not stuck with a problem or something I'm working trying to do web-development. – E.Mohammed Sep 26 '21 at 19:35
  • Can you borrow a drive or sign up for an online backup service? Backups are essential if you have data that you don't want to lose. This is especially true when performing risky operations like installing/upgrading operating systems and manipulating partitions, but data loss can happen at any time due to software errors, human error, hardware failure, natural disaster, and malicious hacking/theft/ransom, etc – Nmath Sep 26 '21 at 20:07
  • @E.Mohammed I found myself in your same situation and while I spent more time figuring out a 14.04+ upgrade strategy than I expected it ended up taking much less time than if I had crawled through a backup trying to place all our server customizations on a clean install. – Jacksonkr Aug 18 '23 at 19:20
0

I struggled attempting to update from 14.04 and was about to give up when I read the comment by @N0rbert which inspired me to try again.

the steps that eventually worked for me were (likely optimizable)

  • sudo apt update && sudo apt upgrade
  • sudo apt dist-upgrade
  • sudo reboot now
  • dpkg --get-selections | awk '$2 == "deinstall" {print $1}' | xargs sudo apt-get purge -y
  • sudo apt update && sudo apt upgrade
  • sudo apt install update-manager-core
  • sudo do-release-upgrade

I am now running 16.04.07 LTS successfully. This is great news because all the important server customizations I wanted to keep are intact and running!

** EDIT **

I realize I started from 14.04 which is even more decrepit but my strategy also applies to 16.04+

Jacksonkr
  • 341
0

If after

sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo apt autoremove

still

Please install all available updates for your release before upgrading.

do

sudo apt list --upgradable

sudo apt remove <listed packages of command above>

e.g.

sudo apt remove chrome-remote-desktop google-chrome-stable

If still no try:

sudo ua enable esm-infra

If the output is

To use 'esm-infra' you need an Ubuntu Pro subscription Personal and community subscriptions are available at no charge See https://ubuntu.com/pro

then register to pro in https://ubuntu.com/pro/dashboard then from there

sudo pro attach <pro token>

Now you are able to

sudo apt dist-upgrade

with new libs. Afterwards

sudo do-release-upgrade

will do the thing.

MosQuan
  • 33