Can't upgrade Ubuntu 18.04 to 20.04 because of "Please install all available updates for your release before upgrading" error

42,974

Solution 1

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!

Solution 2

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])

Solution 3

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

Solution 4

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

Solution 5

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
Share:
42,974

Related videos on Youtube

ModalBro
Author by

ModalBro

Updated on September 18, 2022

Comments

  • ModalBro
    ModalBro over 1 year

    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?

  • Boris Hamanov
    Boris Hamanov about 4 years
    Doesn't -d get the development version?
  • Soren A
    Soren A about 4 years
    @heynnema, at least for now there are no 20.10 development version, so -d do no harm.
  • Arnaud Meuret
    Arnaud Meuret almost 4 years
    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.
  • jaromrax
    jaromrax almost 4 years
    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.
  • amit_game
    amit_game over 3 years
    Still unable to install updated version
  • Brian Piercy
    Brian Piercy over 3 years
    This didn't work for me either.
  • danza
    danza over 3 years
    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
  • Khada Kuraki
    Khada Kuraki over 3 years
    This did it for me, had to remove wine packages, cheers!
  • Chakradar Raju
    Chakradar Raju over 3 years
    This got it working for me, this should be accepted answer. Thank you :)
  • piit79
    piit79 over 3 years
    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.
  • Данила Икрянников
    Данила Икрянников about 3 years
    You can also try sudo apt full-upgrade
  • jferard
    jferard about 3 years
    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.
  • Dr Jyy
    Dr Jyy about 3 years
    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)
  • Jarl
    Jarl about 3 years
    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?
  • rubynorails
    rubynorails about 3 years
    This should be the accepted answer.
  • Dmitriy Pavlukhin
    Dmitriy Pavlukhin about 3 years
    This worked, I had non-upgradable 'i3status' package
  • Estatistics
    Estatistics almost 3 years
    This did for me. I removed nvidia drivers 390 - they were not upgradable - I thing i will change to nuuveau drivers (open soruce).
  • cem
    cem over 2 years
    That worked for me.