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

September 10, 2019 168 views
Python

When trying to do “do-release-upgrade” from current Ubuntu 18.04 to new 19.04 I am getting error

“Your python3 install is corrupted. Please fix the ’/usr/bin/python3’ symlink ”

I currently have python 2.7, 3, 3.6 and 3.7 installed.

Please advise what shall i try.
Thanks

2 Answers

Hello,

I believe this is a know issue, you can also check this in the following report in the launchpad bugs forum:

https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/1825655

The suggested workaround is to remove the python’s binary in /usr/bin and then to create a symlink and perform the upgrade:

sudo rm /usr/bin/python
sudo ln -s /usr/bin/python2.7 /usr/bin/python

and then perform the upgrade

do-release-upgrade

I would also recommend you to backup your droplet in case something goes wrong, however you will simply remove the binary file from the /usr/bin and then create a symlink to replace it.

Let me know how it goes.

Alex

  • Thank you. Tried that, Now getting "-bash: /usr/bin/do-release-upgrade: /usr/bin/python3: bad interpreter: Too many levels of symbolic links "

    • Could you please try with the following symlink as this should be the correct one for the 18.04 to 19.04 upgrade:

      sudo rm /usr/bin/python
      
      
      sudo ln -sf /usr/bin/python3.6 /usr/bin/python
      

      and then perform the upgrade

      do-release-upgrade
      

      Let me know how it goes.

      Alex

Seems i have done something to python.
Now when i try sudo apt upgrade ,

i get

Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)```
  • Can you provide me with the full output of the apt upgrade command as it usually says which packages are failing?

    Looking forward to your reply.

    Alex

    • Here and sorry its too big

      
      root@ubuntu-discord-s-1vcpu-1gb-sgp1-01:~# sudo apt upgrade
      Reading package lists... Done
      Building dependency tree
      Reading state information... Done
      Calculating upgrade... Done
      The following packages were automatically installed and are no longer required:
        apport-symptoms libexpat1-dev libpython2-stdlib libpython3-dev
        libpython3.6-dev squashfs-tools
      Use 'sudo apt autoremove' to remove them.
      0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
      57 not fully installed or removed.
      Need to get 0 B/47.2 kB of archives.
      After this operation, 0 B of additional disk space will be used.
      Do you want to continue? [Y/n] y
      Setting up python3.6 (3.6.8-1~18.10) ...
      /var/lib/dpkg/info/python3.6.postinst: 9: /var/lib/dpkg/info/python3.6.postinst:                                                                       /usr/bin/python3.6: Too many levels of symbolic links
      dpkg: error processing package python3.6 (--configure):
       installed python3.6 package post-installation script subprocess returned error                                                                       exit status 2
      dpkg: dependency problems prevent configuration of python3:
       python3 depends on python3.6 (>= 3.6.7-1~); however:
        Package python3.6 is not configured yet.
      
      dpkg: error processing package python3 (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-cffi-backend:
       python3-cffi-backend depends on python3 (<< 3.8); however:
        Package python3 is not configured yet.
       python3-cffi-backend depends on python3 (>= 3.6~); however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-cffi-backend (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-olefile:
       python3-olefile depends on python3:any; however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-olefile (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-keyring:
       python3-keyring depends on python3:any; however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-keyring (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-commandnotfound:
       python3-commandnotfound depends on python3:any (>= 3.2~); however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-commandnotfound (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-crypto:
       python3-crypto depends on python3 (<< 3.8); however:
        Package python3 is not configured yet.
       python3-crypto depends on python3 (>= 3.6~); however:
        Package python3 is not configured yet.
       python3-crypto depends on python3:any (>= 3.3.2-2~); however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-crypto (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-constantly:
       python3-constantly depends on python3:any (>= 3.3.2-2~); however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-constantly (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-requests-unixsocket:
       python3-requests-unixsocket depends on python3:any (>= 3.3.2-2~); however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-requests-unixsocket (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of language-selector-common:
       language-selector-common depends on python3:any (>= 3.3.2-2~); however:
        Package python3 is not configured yet.
      
      dpkg: error processing package language-selector-common (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-click:
       python3-click depends on python3:any; however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-click (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-idna:
       python3-idna depends on python3:any (>= 3.3.2-2~); however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-idna (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-xdg:
       python3-xdg depends on python3:any (>= 3.3.2-2~); however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-xdg (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-update-manager:
       python3-update-manager depends on python3:any (>= 3.2~); however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-update-manager (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-keyrings.alt:
       python3-keyrings.alt depends on python3-crypto; however:
        Package python3-crypto is not configured yet.
       python3-keyrings.alt depends on python3:any; however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-keyrings.alt (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-colorama:
       python3-colorama depends on python3:any (>= 3.4~); however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-colorama (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-certifi:
       python3-certifi depends on python3:any (>= 3.4~); however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-certifi (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-wheel:
       python3-wheel depends on python3:any (>= 3.3.2-2~); however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-wheel (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-gi:
       python3-gi depends on python3 (<< 3.8); however:
        Package python3 is not configured yet.
       python3-gi depends on python3 (>= 3.6~); however:
        Package python3 is not configured yet.
       python3-gi depends on python3:any; however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-gi (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-apport:
       python3-apport depends on python3:any (>= 3.0~); however:
        Package python3 is not configured yet.
       python3-apport depends on python3-requests-unixsocket; however:
        Package python3-requests-unixsocket is not configured yet.
      
      dpkg: error processing package python3-apport (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-asn1crypto:
       python3-asn1crypto depends on python3:any (>= 3.3.2-2~); however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-asn1crypto (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-blinker:
       python3-blinker depends on python3:any; however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-blinker (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-debconf:
       python3-debconf depends on python3:any; however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-debconf (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-oauthlib:
       python3-oauthlib depends on python3:any (>= 3.4~); however:
        Package python3 is not configured yet.
       python3-oauthlib depends on python3-blinker; however:
        Package python3-blinker is not configured yet.
      
      dpkg: error processing package python3-oauthlib (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-chardet:
       python3-chardet depends on python3:any (>= 3.3.2-2~); however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-chardet (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of sosreport:
       sosreport depends on python3:any (>= 3.3~); however:
        Package python3 is not configured yet.
      
      dpkg: error processing package sosreport (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-systemd:
       python3-systemd depends on python3 (<< 3.8); however:
        Package python3 is not configured yet.
       python3-systemd depends on python3 (>= 3.6~); however:
        Package python3 is not configured yet.
       python3-systemd depends on python3:any (>= 3.3.2-2~); however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-systemd (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-all:
       python3-all depends on python3 (= 3.6.7-1~18.10); however:
        Package python3 is not configured yet.
       python3-all depends on python3.6; however:
        Package python3.6 is not configured yet.
      
      dpkg: error processing package python3-all (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-httplib2:
       python3-httplib2 depends on python3:any; however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-httplib2 (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-pip:
       python3-pip depends on python3:any (>= 3.4~); however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-pip (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-requests:
       python3-requests depends on python3-certifi; however:
        Package python3-certifi is not configured yet.
       python3-requests depends on python3-chardet (<< 3.1.0); however:
        Package python3-chardet is not configured yet.
       python3-requests depends on python3-idna; however:
        Package python3-idna is not configured yet.
       python3-requests depends on python3:any (>= 3.4~); however:
        Package python3 is not configured yet.
       python3-requests depends on python3-chardet (>= 3.0.2); however:
        Package python3-chardet is not configured yet.
      
      dpkg: error processing package python3-requests (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-attr:
       python3-attr depends on python3:any (>= 3.3.2-2~); however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-attr (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-gdbm:amd64:
       python3-gdbm:amd64 depends on python3 (>= 3.6.6-1~); however:
        Package python3 is not configured yet.
       python3-gdbm:amd64 depends on python3 (<< 3.8); however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-gdbm:amd64 (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-openssl:
       python3-openssl depends on python3:any (>= 3.3.2-2~); however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-openssl (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-software-properties:
       python3-software-properties depends on python3:any; however:
        Package python3 is not configured yet.
       python3-software-properties depends on python3; however:
        Package python3 is not configured yet.
       python3-software-properties depends on python3-gi; however:
        Package python3-gi is not configured yet.
      
      dpkg: error processing package python3-software-properties (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-twisted:
       python3-twisted depends on python3-attr; however:
        Package python3-attr is not configured yet.
       python3-twisted depends on python3-constantly; however:
        Package python3-constantly is not configured yet.
       python3-twisted depends on python3:any; however:
        Package python3 is not configured yet.
       python3-twisted depends on python3-openssl; however:
        Package python3-openssl is not configured yet.
      
      dpkg: error processing package python3-twisted (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-service-identity:
       python3-service-identity depends on python3-attr; however:
        Package python3-attr is not configured yet.
       python3-service-identity depends on python3-openssl; however:
        Package python3-openssl is not configured yet.
       python3-service-identity depends on python3:any (>= 3.3.2-2~); however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-service-identity (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-configobj:
       python3-configobj depends on python3:any; however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-configobj (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-setuptools:
       python3-setuptools depends on python3:any; however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-setuptools (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-hyperlink:
       python3-hyperlink depends on python3:any (>= 3.3.2-2~); however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-hyperlink (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-secretstorage:
       python3-secretstorage depends on python3:any (>= 3.3.2-2~); however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-secretstorage (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-automat:
       python3-automat depends on python3-attr; however:
        Package python3-attr is not configured yet.
       python3-automat depends on python3:any (>= 3.3.2-2~); however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-automat (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of dh-python:
       dh-python depends on python3:any; however:
        Package python3 is not configured yet.
      
      dpkg: error processing package dh-python (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-debian:
       python3-debian depends on python3-chardet; however:
        Package python3-chardet is not configured yet.
       python3-debian depends on python3:any; however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-debian (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of ssh-import-id:
       ssh-import-id depends on python3-requests (>= 1.1.0); however:
        Package python3-requests is not configured yet.
       ssh-import-id depends on python3:any (>= 3.3.2-2~); however:
        Package python3 is not configured yet.
      
      dpkg: error processing package ssh-import-id (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-distutils:
       python3-distutils depends on python3 (>= 3.6.6-1~); however:
        Package python3 is not configured yet.
       python3-distutils depends on python3 (<< 3.8); however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-distutils (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of cloud-init:
       cloud-init depends on python3; however:
        Package python3 is not configured yet.
       cloud-init depends on python3-requests; however:
        Package python3-requests is not configured yet.
       cloud-init depends on python3-configobj; however:
        Package python3-configobj is not configured yet.
       cloud-init depends on python3-oauthlib; however:
        Package python3-oauthlib is not configured yet.
       cloud-init depends on python3:any; however:
        Package python3 is not configured yet.
      
      dpkg: error processing package cloud-init (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of software-properties-common:
       software-properties-common depends on python3:any; however:
        Package python3 is not configured yet.
       software-properties-common depends on python3; however:
        Package python3 is not configured yet.
       software-properties-common depends on python3-gi; however:
        Package python3-gi is not configured yet.
       software-properties-common depends on python3-software-properties (= 0.96.27.1)                                                                      ; however:
        Package python3-software-properties is not configured yet.
      
      dpkg: error processing package software-properties-common (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-cryptography:
       python3-cryptography depends on python3 (>= 3~); however:
        Package python3 is not configured yet.
       python3-cryptography depends on python3-asn1crypto (>= 0.21.0~); however:
        Package python3-asn1crypto is not configured yet.
       python3-cryptography depends on python3-cffi-backend-api-min (<= 9729); however                                                                      :
        Package python3-cffi-backend-api-min is not installed.
        Package python3-cffi-backend which provides python3-cffi-backend-api-min is no                                                                      t configured yet.
       python3-cryptography depends on python3-cffi-backend-api-max (>= 9729); however                                                                      :
        Package python3-cffi-backend-api-max is not installed.
        Package python3-cffi-backend which provides python3-cffi-backend-api-max is no                                                                      t configured yet.
       python3-cryptography depends on python3-idna (>= 2.1); however:
        Package python3-idna is not configured yet.
       python3-cryptography depends on python3:any; however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-cryptography (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-incremental:
       python3-incremental depends on python3:any (>= 3.3.2-2~); however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-incremental (--configure):
       dependency problems - leaving unconfigured
      dpkg: dependency problems prevent configuration of python3-distro-info:
       python3-distro-info depends on python3:any (>= 3.0~); however:
        Package python3 is not configured yet.
      
      dpkg: error processing package python3-distro-info (--configure):
       dependency problems - leaving unconfigured
      dpkg: too many errors, stopping
      Errors were encountered while processing:
       python3.6
       python3
       python3-cffi-backend
       python3-olefile
       python3-keyring
       python3-commandnotfound
       python3-crypto
       python3-constantly
       python3-requests-unixsocket
       language-selector-common
       python3-click
       python3-idna
       python3-xdg
       python3-update-manager
       python3-keyrings.alt
       python3-colorama
       python3-certifi
       python3-wheel
       python3-gi
       python3-apport
       python3-asn1crypto
       python3-blinker
       python3-debconf
       python3-oauthlib
       python3-chardet
       sosreport
       python3-systemd
       python3-all
       python3-httplib2
       python3-pip
       python3-requests
       python3-attr
       python3-gdbm:amd64
       python3-openssl
       python3-software-properties
       python3-twisted
       python3-service-identity
       python3-configobj
       python3-setuptools
       python3-hyperlink
       python3-secretstorage
       python3-automat
       dh-python
       python3-debian
       ssh-import-id
       python3-distutils
       cloud-init
       software-properties-common
       python3-cryptography
       python3-incremental
       python3-distro-info
      Processing was halted because there were too many errors.
      E: Sub-process /usr/bin/dpkg returned an error code (1)
      
      
Have another answer? Share your knowledge.