3

I am trying to update from Ubuntu 18.04 to 20.04, but when I run do-release-update, I get error:

su@sudo:~$ do-release-upgrade -d 
Checking for a new Ubuntu release
Get:1 Upgrade tool signature [1,554 B]                                         
Get:2 Upgrade tool [1,342 kB]                                                  
Fetched 1,343 kB in 0s (0 B/s)                                                 
authenticate 'focal.tar.gz' against 'focal.tar.gz.gpg' 
extracting 'focal.tar.gz'
Reading cache

Checking package manager

Can not upgrade 

Your python3 install is corrupted. Please fix the '/usr/bin/python3' 
symlink. 

ls -al /usr/bin | grep python3

lrwxrwxrwx  1 root root          29 Mar 27  2018 dh_python3 -> ../share/dh-python/dh_python3
lrwxrwxrwx  1 root root          23 Apr 18 07:26 pdb3.6 -> ../lib/python3.6/pdb.py
lrwxrwxrwx  1 root root          23 Nov  7  2019 pdb3.7 -> ../lib/python3.7/pdb.py
lrwxrwxrwx  1 root root          31 Oct 25  2018 py3versions -> ../share/python3/py3versions.py
lrwxrwxrwx  1 root root          19 Jun 10 15:12 python3 -> /usr/bin/python3.6m
lrwxrwxrwx  1 root root          16 Jun 10 14:36 python3.6 -> /usr/bin/python3
lrwxrwxrwx  1 root root          33 Apr 18 07:26 python3.6-config -> x86_64-linux-gnu-python3.6-config
-rwxr-xr-x  1 root root     4526456 Apr 18 07:26 python3.6m
lrwxrwxrwx  1 root root          34 Apr 18 07:26 python3.6m-config -> x86_64-linux-gnu-python3.6m-config
-rwxr-xr-x  2 root root     4873376 Nov  7  2019 python3.7
-rwxr-xr-x  2 root root     4873376 Nov  7  2019 python3.7m
lrwxrwxrwx  1 root root          16 Oct 25  2018 python3-config -> python3.6-config
lrwxrwxrwx  1 root root          10 Oct 25  2018 python3m -> python3.6m
lrwxrwxrwx  1 root root          17 Oct 25  2018 python3m-config -> python3.6m-config
lrwxrwxrwx  1 root root          34 Apr 18 07:26 x86_64-linux-gnu-python3.6-config -> x86_64-linux-gnu-python3.6m-config
-rwxr-xr-x  1 root root        3283 Apr 18 07:26 x86_64-linux-gnu-python3.6m-config
lrwxrwxrwx  1 root root          33 Oct 25  2018 x86_64-linux-gnu-python3-config -> x86_64-linux-gnu-python3.6-config
lrwxrwxrwx  1 root root          34 Oct 25  2018 x86_64-linux-gnu-python3m-config -> x86_64-linux-gnu-python3.6m-config

$ dpkg -l | egrep -v '^ii|rc'

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
+++-=============================================-===================================================-============-=================================================================================
rFR python3                                       3.6.7-1~18.04                                       amd64        interactive high-level object-oriented language (default python3 version)
Kushal
  • 31
  • The release 19.04 is no longer supported. If your current version is 18.04, you should directly upgrade to 20.04. But first, run the following commands: apt autoclean && apt autoremove && apt update && apt dist-upgrade on your 18.04 version. These commands should not return any errors. – FedKad Jun 10 '20 at 09:50
  • @FedonKadifeli I tried it but it is giving error E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root? – Kushal Jun 10 '20 at 09:53
  • 19.04 is not Eoan. Eoan is 19.10. The upgrade path 18.04->19.10 isn't supported. Even if you fix Python 3 issues, you'll get stuck on Upgrade Path not supported error. What is the output of type -a python3? – Kulfy Jun 10 '20 at 09:53
  • @Kulfy I tried it gives python3 is /usr/bin/python3 – Kushal Jun 10 '20 at 09:56
  • 1
    And what about file /usr/bin/python3? – Kulfy Jun 10 '20 at 09:59
  • @Kulfy It gives /usr/bin/python3: symbolic link to /usr/bin/python3.6m – Kushal Jun 10 '20 at 10:11
  • @Kulfy I tried that before but it still didnt work – Kushal Jun 10 '20 at 10:17
  • What exactly did you try and what didn't work? – Kulfy Jun 10 '20 at 10:21
  • ls -al /usr/bin | grep python3 please add outputs from commands to your question. – nobody Jun 10 '20 at 10:22
  • @Kulfy I tired what Daniel K's solution but it didnt work – Kushal Jun 10 '20 at 10:27
  • @nobody added please check – Kushal Jun 10 '20 at 10:29
  • Daniel K's answer is about symlink of Python 2. You should fix symlink for Python3. python3 should point to /usr/bin/python3.6m. Did you changed symlinks in the past? – Kulfy Jun 10 '20 at 10:39
  • @Kulfy my python3 is pointing to /usr/bin/python3.6m but still i am getting that error – Kushal Jun 10 '20 at 10:47
  • sudo ln -sf /usr/bin/python3.6 /usr/bin/python3. This fix worked for me. Prior to this fix, I had /usr/bin/python3 -> /etc/alternatives/python3 and /etc/alternatives/python3 -> /usr/bin/python3.6. – VictorL Feb 10 '21 at 12:13

1 Answers1

1
sudo apt install --reinstall python3

package was in unclean state

rFR python3 

what it means

The next would be to upgrade to ubuntu 20.04. Make sure that in file

/etc/update-manager/release-upgrades

Prompt=lts

is set. Make backup from your data and try again.

nobody
  • 5,437