Can't upgrade Ubuntu 18.04 to 20.04 because of "Please install all available updates for your release before upgrading" error
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
Related videos on Youtube
ModalBro
Updated on September 18, 2022Comments
-
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 about 4 yearsDoesn't -d get the development version?
-
Soren A about 4 years@heynnema, at least for now there are no 20.10 development version, so -d do no harm.
-
Arnaud Meuret almost 4 yearsThe 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 almost 4 yearsIf 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 over 3 yearsStill unable to install updated version
-
Brian Piercy over 3 yearsThis didn't work for me either.
-
danza over 3 yearsGreat, 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 over 3 yearsThis did it for me, had to remove wine packages, cheers!
-
Chakradar Raju over 3 yearsThis got it working for me, this should be accepted answer. Thank you :)
-
piit79 over 3 yearsThis 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 yearsYou can also try
sudo apt full-upgrade
-
jferard about 3 yearsWorked 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 about 3 yearsI 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 about 3 yearsI think it was the
sudo apt dist-upgrade
part that resolved it for me, what does that actually do thatapt update
,apt upgrade
,apt autoremove
does not cover? -
rubynorails about 3 yearsThis should be the accepted answer.
-
Dmitriy Pavlukhin about 3 yearsThis worked, I had non-upgradable 'i3status' package
-
Estatistics almost 3 yearsThis did for me. I removed nvidia drivers 390 - they were not upgradable - I thing i will change to nuuveau drivers (open soruce).
-
cem over 2 yearsThat worked for me.