25

I've been trying to upgrade my version of Ubuntu 18.04 to 20.04. I've run all the steps from updating and upgrading both apt and apt-get, changing the settings in update manager and all of the steps described in this link. Yet I keep getting the error:

Please install all available updates for your release before upgrading.

Is there something special about trying to upgrade from 18.04 to 20.04 that's causing this error? Do I maybe need to update to 19.04 first?

EDIT: I just noticed something that might be important. When I run sudo apt-get update I get the following notice at the end of the output:

The following packages have been kept back:
  colord gimagereader python-sane sane simple-scan
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.

Might that be causing the issue?

6
  • 3
    The update from 18.04LTS to 20.04LTS won't happen until 20.04.1 is released. In the mean time, do sudo apt-get update and sudo apt-get upgrade. – heynnema Apr 26 '20 at 19:56
  • Will this get me to 19.04, (after running do-release-upgrade)? – ModalBro Apr 26 '20 at 21:24
  • I don't think so. Just wait until 20.04.1 is released. – heynnema Apr 26 '20 at 21:51
  • 1
    To deal with packages being kept back try sudo apt install -f to fix errors. – WinEunuuchs2Unix Apr 27 '20 at 0:30
  • 1
    The issue regarding kept back packages is one I recently ran into myself and reported in the Ubuntu bug tracker at bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/…. It'd be helpful if you were to report a bug about ubuntu-release-upgrader using 'ubuntu-bug ubuntu-release-upgrader' so that I can have a look at your log files and try and sort out why those packages are kept back. Thanks! – Brian Murray May 7 '20 at 18:23
15

sequence from 18.04 to 20.04

sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo apt autoremove
sudo do-release-upgrade -d -f DistUpgradeViewGtk3

Follow onscreen instruction. Good luck!

5
  • 10
    Still unable to install updated version – amit_game Oct 23 '20 at 5:31
  • 3
    This didn't work for me either. – Brian Piercy Nov 10 '20 at 20:35
  • 1
    This didn't work for me as it relates to a specific package that is not being upgraded. See my answer below for a generic solution. – piit79 Dec 17 '20 at 9:16
  • I came here via ubuntu.com/blog/ubuntu-on-wsl-2-is-generally-available. The "Good luck!" is so Linux-indicative. Thanks, the list works (minus the -f ... on my side) – Stack The User Mar 10 at 22:54
  • I think it was the sudo apt dist-upgrade part that resolved it for me, what does that actually do that apt update, apt upgrade, apt autoremove does not cover? – Jarl Mar 17 at 7:29
14

I was also experiencing the same issue. However, when I ran the usual upgrade commands (sudo apt upgrade, sudo apt full-upgrade, sudo apt-get dist-upgrade), they were all reporting that there are no packages to upgrade and no held packages:

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

In the end, I copied the file /usr/bin/do-release-upgrade to my home and modified it as follows:

for pkg in upgradable:
    if 'Phased-Update-Percentage' in pkg.candidate.record:
        # P-U-P does not exist if it is fully phased
        continue
    else:
        install_count += 1
        print(pkg)   # <--- ADD THIS LINE
        # one upgradeable package is enough to stop the dist-upgrade
        # break      # <--- COMMENT THIS LINE OUT to get all packages

This change will print the names of all packages that need to be upgraded.

When I ran sudo ~/do-release-upgrade, a package from an external repository was printed that had an update available, but the newer version depended on a library that was not available, which caused the package to not upgrade.

Still not sure why it wasn't reported as not upgraded by apt upgrade.

Edit: The following code snippet can be run in the Python console to list all upgradeable packages - thanks @jferard!

import apt

cache = apt.Cache()
cache.open()
print([pkg for pkg in cache if pkg.is_upgradable])
7
  • 2
    Great, this looks like the best answer to me, as the other answer just relate to the specific environment where some users removed their stale packages. Kudos – danza Nov 19 '20 at 18:45
  • 1
    This did it for me, had to remove wine packages, cheers! – Khada Kuraki Nov 21 '20 at 1:17
  • 1
    This got it working for me, this should be accepted answer. Thank you :) – Chakradar Raju Dec 16 '20 at 1:04
  • 3
    Worked for me. You can also type in a Python3 REPL : ` >>> import apt <return> >>> cache = apt.Cache() <return> >>> cache.open() <return> >>> [pkg for pkg in cache if pkg.is_upgradable] ` to list the packages that need an upgrade. – jferard Mar 5 at 19:03
  • 1
    This should be the accepted answer. – rubynorails Apr 2 at 20:05
4

The problem is your repo is not updated, so you need to remove these five repos: colord gimagereader python-sane sane simple-scan

Do sudo add-apt-repository -r ppa:<ppa to remove> or edit /etc/apt/sources.list to remove all of these repos.

Then you can run update-manager

4

just removed wine through sudo apt-get remove --auto-remove winehq-stable and it worked for me after reusing sudo do-release-upgrade

2

First in your terminal:

sudo apt dist-upgrade

Then you will get

The following packages have been kept back:

  mongodb-org mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools

0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.

All you have to do is to use

sudo apt install < Packages Names >

The result will be like:

sudo apt install mongodb-org mongodb-org-mongos mongodb-org-server mongodb-org-tools

Finally, go with:

sudo do-release-upgrade
2

Real example with solution (sorry for russian output examples, will translate it as soon as I can):

$ sudo do-release-upgrade -d
...
Please install all available updates for your release before upgrading.

$ sudo apt install
Чтение списков пакетов… Готово
Построение дерева зависимостей       
Чтение информации о состоянии… Готово
Обновлено 0 пакетов, установлено 0 новых пакетов, для удаления отмечено 0 пакетов, и 2 пакетов не обновлено. 
// ... 2 packages are not updated

$ apt list --upgradable
Вывод списка… Готово # list output... Done
wine-stable-amd64/bionic 6.0.0~bionic-1 amd64 [может быть обновлён с: 4.0.1~bionic]
wine-stable-i386/bionic 6.0.0~bionic-1 i386 [может быть обновлён с: 4.0.1~bionic]

The last command showed me what packages are not updated. In my case I removed the packages (it was trash after experiments), then I ran sudo do-release-upgrade -d again. There was no problem, update started.

1
1

You have to update your current version with the latest patches / updates. Run:

  • sudo apt update
  • sudo apt upgrade

Then force the upgrade to 20.04 by running:

  • sudo update-manager -d

Until first point release of 20.04 ... 20.04.1 ... upgrade will not be presented automatically. Until then the -d option is needed.

As @heynnema writes below -d means "development version". Right now there are no development version for next ubuntu (20.10). Since upgrading from 18.04 or 19,10 to 20.10, you should get a warning about that. If this happens, let go of -d and try without it.

3
  • Doesn't -d get the development version? – heynnema Apr 26 '20 at 21:51
  • @heynnema, at least for now there are no 20.10 development version, so -d do no harm. – Soren A Apr 26 '20 at 23:58
  • The OP states that he went through the standard steps. The issue is most likely the presence of third-party package repositories. Simply unchecking their boxes in the update-manager (and then letting it update its caches) will probably be enough. I just did this myself. – Arnaud Meuret Jul 27 '20 at 3:51
0

Go to Ubuntu Software Update and check any pending updates. Update them and you're done. Some updates do not execute using sudo apt-get update.

-1

first, run

sudo apt update && sudo apt upgrade

you will see like this These packages need to upgrade here

install every one manual

sudo apt install 

or all

sudo apt install mongodb-org-shell && sudo apt instll mongodb-org-tools

after finish try to upgrade will be working

1
  • 3
    If you wonder why you got a negative points - 1) you did not answer the original problem 2) you have an uncomplete command 3) you have a typo in the commandline 4) you advice to install a database tools, which hardly helps with upgrade to new LTS version. But dont be dissapointed, read better the question and pay more attention next time. – jaromrax Aug 4 '20 at 11:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.