Broken dependencies after upgrade

33,073

EDIT

The problem was related to the following bug report: https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/1165281

Follow steps in comment #3 to #5, but change the path to python3.3 rather than 2.7.

Share:
33,073

Related videos on Youtube

bigTree
Author by

bigTree

Updated on September 18, 2022

Comments

  • bigTree
    bigTree over 1 year

    After an apt-get upgrade I got the following error:

    Reading package lists... Done
    Building dependency tree      
    Reading state information... Done
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    2 not fully installed or removed.  
    After this operation, 0 B of additional disk space will be used.
    Do you want to continue [Y/n]? y
    Setting up python3.3-minimal (3.3.1-1ubuntu5) ...
    Traceback (most recent call last):
    File "/usr/lib/python3.3/py_compile.py", line 8, in <module>
        import imp
      File "/usr/lib/python3.3/imp.py", line 28, in <module>
        import tokenize
      File "/usr/lib/python3.3/tokenize.py", line 28, in <module>
        import re
      File "/usr/lib/python3.3/re.py", line 122, in <module>
        import sre_compile
      File "/usr/lib/python3.3/sre_compile.py", line 14, in <module>
        import sre_parse
      File "/usr/lib/python3.3/sre_parse.py", line 17, in <module>
        from sre_constants import *
      File "/usr/lib/python3.3/sre_constants.py", line 18, in <module>
        from _sre import MAXREPEAT
    ImportError: cannot import name MAXREPEAT
    dpkg: error processing python3.3-minimal (--configure):
     subprocess installed post-installation script returned error exit status 1
    dpkg: dependency problems prevent configuration of python3.3:
     python3.3 depends on python3.3-minimal (= 3.3.1-1ubuntu5); however:
      Package python3.3-minimal is not configured yet.
    
    dpkg: error processing python3.3 (--configure):
     dependency problems - leaving unconfigured
    No apport report written because the error message indicates its a followup error     from a previous failure.
                          Errors were encountered while processing:
     python3.3-minimal
     python3.3
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    

    and I can't turn off my computer...

    I guess I did not install correctly python 3.3, but how can I repair it?

    Edit: I tried apt-get --reinstall install python2 python2-support but I got: the same error

    EDIT: More information

    on my system: Linux Mycomputer 3.5.0-34-generic #55-Ubuntu SMP Thu Jun 6 20:20:19 UTC 2013 i686 i686 i686 GNU/Linux

    dpkg --print-architecture   
    i386
    

    I used to have ubuntu 12.10. My problem occured when I tried upgrading it to 13.04. I had a error message telling me the process stoped because there were too many errors.

    I then tried to run sudo apt-get update && sudo apt-get upgrade but encountered the error above.

    I had a similar problem a few months ago when I mistakenly deleted python2 from my computer. I then could not turn off my computer by clicking on the icon (it does not respond) and turning off. The only way was to force it to shut down manually. When I turned it on again, I just had an empty desktop and could not do anything. This was fixed by reinstalling the whole system.

    Searching on the internet, I tried several commands:

    sudo dpkg --configure -a
    

    which resulted in

    Setting up python3.3-minimal (3.3.1-1ubuntu5) ...
    Traceback (most recent call last):
      File "/usr/lib/python3.3/py_compile.py", line 8, in <module>
        import imp
      File "/usr/lib/python3.3/imp.py", line 28, in <module>
           import tokenize
      File "/usr/lib/python3.3/tokenize.py", line 28, in <module>
        import re
      File "/usr/lib/python3.3/re.py", line 122, in <module>
        import sre_compile
          File "/usr/lib/python3.3/sre_compile.py", line 14, in <module>
        import sre_parse
      File "/usr/lib/python3.3/sre_parse.py", line 17, in <module>
        from sre_constants import *
      File "/usr/lib/python3.3/sre_constants.py", line 18, in <module>
        from _sre import MAXREPEAT
    ImportError: cannot import name MAXREPEAT
    dpkg: error processing python3.3-minimal (--configure):
     subprocess installed post-installation script returned error exit status 1
    dpkg: dependency problems prevent configuration of python3-minimal:
     python3-minimal depends on python3.3-minimal (>= 3.3.1-1~); however:
      Package python3.3-minimal is not configured yet.
    
    
    sudo apt-get --reinstall install python3 python3-support
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    E: Unable to locate package python3-support
    
    
    sudo apt-get -f install 
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    4 not fully installed or removed.
    After this operation, 0 B of additional disk space will be used.
    Setting up python3.3-minimal (3.3.1-1ubuntu5) ...
    Traceback (most recent call last):
      File "/usr/lib/python3.3/py_compile.py", line 8, in <module>
        import imp
      File "/usr/lib/python3.3/imp.py", line 28, in <module>
        import tokenize
      File "/usr/lib/python3.3/tokenize.py", line 28, in <module>
        import re
      File "/usr/lib/python3.3/re.py", line 122, in <module>
        import sre_compile
      File "/usr/lib/python3.3/sre_compile.py", line 14, in <module>
        import sre_parse
      File "/usr/lib/python3.3/sre_parse.py", line 17, in <module>
        from sre_constants import *
      File "/usr/lib/python3.3/sre_constants.py", line 18, in <module>
        from _sre import MAXREPEAT
    ImportError: cannot import name MAXREPEAT
    dpkg: error processing python3.3-minimal (--configure):
     subprocess installed post-installation script returned error exit status 1
    dpkg: dependency problems prevent configuration of python3-minimal:
     python3-minimal depends on python3.3-minimal (>= 3.3.1-1~); however:
      Package python3.3-minimal is not configured yet.
    
    dpkg: error processing python3-minimal (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of python3.3:
     python3.3 depends on python3.3-minimal (= 3.3.1-1ubuntu5); however:
      Package python3.3-minimal is not configured yet.
    
    dpkg: error processing python3.3 (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of python3:
     python3 depends on python3.3 (>= 3.3.1-1~); however:
      Package python3.3 is not configured yet.
     python3 depends on python3-minimal (= 3.3.1-0ubuntu1); however:
      Package python3-minimal is not configured yet.
    
    dpkg: error processing python3 (--configure):
     dependency problems - leaving unconfigured
    Errors were encountered while processing:
     python3.3-minimal
     python3-minimal
     python3.3
     python3
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    
    
    
    
    dpkg: error processing python3-minimal (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of python3:
     python3 depends on python3-minimal (= 3.3.1-0ubuntu1); however:
      Package python3-minimal is not configured yet.
    
    dpkg: error processing python3 (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of python3.3:
     python3.3 depends on python3.3-minimal (= 3.3.1-1ubuntu5); however:
      Package python3.3-minimal is not configured yet.
    
    dpkg: error processing python3.3 (--configure):
     dependency problems - leaving unconfigured
    Errors were encountered while processing:
     python3.3-minimal
     python3-minimal
     python3
     python3.3
    
    
    python --version
    

    returns Python 2.7.4

    Doing:

    cd /tmp
    sudo apt-get download python3
    sudo dpkg -i python3*.deb && apt-get dist-upgrade
    

    returns

        (Reading database ... 374310 files and directories currently installed.)
    Preparing to replace python3 3.3.1-0ubuntu1 (using python3_3.3.1-0ubuntu1_i386.deb) ...
    running python pre-rtupdate hooks for python3.3...
    Unpacking replacement python3 ...
    dpkg: dependency problems prevent configuration of python3:
     python3 depends on python3.3 (>= 3.3.1-1~); however:
      Package python3.3 is not configured yet.
     python3 depends on python3-minimal (= 3.3.1-0ubuntu1); however:
      Package python3-minimal is not configured yet.
    
    dpkg: error processing python3 (--install):
     dependency problems - leaving unconfigured
    Processing triggers for man-db ...
    Errors were encountered while processing:
     python3
    

    I also tried to remove and reinstall python3

    Any help please?

    Edited after Gx1sptDTDa's answer

    sudo apt-get clean
    sudo apt-get dist-upgrade 
    
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Calculating upgrade... Done
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    4 not fully installed or removed.
    After this operation, 0 B of additional disk space will be used.
    Do you want to continue [Y/n]? y
    Setting up python3.3-minimal (3.3.1-1ubuntu5) ...
    Traceback (most recent call last):
      File "/usr/lib/python3.3/py_compile.py", line 8, in <module>
        import imp
      File "/usr/lib/python3.3/imp.py", line 28, in <module>
        import tokenize
      File "/usr/lib/python3.3/tokenize.py", line 28, in <module>
        import re
      File "/usr/lib/python3.3/re.py", line 122, in <module>
        import sre_compile
      File "/usr/lib/python3.3/sre_compile.py", line 14, in <module>
        import sre_parse
      File "/usr/lib/python3.3/sre_parse.py", line 17, in <module>
        from sre_constants import *
      File "/usr/lib/python3.3/sre_constants.py", line 18, in <module>
        from _sre import MAXREPEAT
    ImportError: cannot import name MAXREPEAT
    dpkg: error processing python3.3-minimal (--configure):
     subprocess installed post-installation script returned error exit status 1
    dpkg: dependency problems prevent configuration of python3-minimal:
     python3-minimal depends on python3.3-minimal (>= 3.3.1-1~); however:
      Package python3.3-minimal is not configured yet.
    
    dpkg: error processing python3-minimal (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of python3.3:
     python3.3 depends on python3.3-minimal (= 3.3.1-1ubuntu5); however:
      Package python3.3-minimal is not configured yet.
    
    dpkg: error processing python3.3 (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of python3:
     python3 depends on python3.3 (>= 3.3.1-1~); however:
      Package python3.3 is not configured yet.
     python3 depends on python3-minimal (= 3.3.1-0ubuntu1); however:
      Package python3-minimal is not configured yet.
    
    dpkg: error processing python3 (--configure):
     dependency problems - leaving unconfigured
    Errors were encountered while processing:
     python3.3-minimal
     python3-minimal
     python3.3
     python3
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    

    Edit: Installation of all the dependencies for python3.3-minimal

    sudo apt-get install libc6 libexpat1 libpython3.3-minimal zlib1g
    

    returns

    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    libc6 is already the newest version.
    libexpat1 is already the newest version.
    libpython3.3-minimal is already the newest version.
    libpython3.3-minimal set to manually installed.
    zlib1g is already the newest version.
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    4 not fully installed or removed.
    After this operation, 0 B of additional disk space will be used.
    Do you want to continue [Y/n]? y
    Setting up python3.3-minimal (3.3.1-1ubuntu5) ...
    Traceback (most recent call last):
      File "/usr/lib/python3.3/py_compile.py", line 8, in <module>
        import imp
      File "/usr/lib/python3.3/imp.py", line 28, in <module>
        import tokenize
      File "/usr/lib/python3.3/tokenize.py", line 28, in <module>
        import re
      File "/usr/lib/python3.3/re.py", line 122, in <module>
        import sre_compile
      File "/usr/lib/python3.3/sre_compile.py", line 14, in <module>
        import sre_parse
      File "/usr/lib/python3.3/sre_parse.py", line 17, in <module>
        from sre_constants import *
       File "/usr/lib/python3.3/sre_constants.py", line 18, in <module>
         from _sre import MAXREPEAT
    ImportError: cannot import name MAXREPEAT
    dpkg: error processing python3.3-minimal (--configure):
     subprocess installed post-installation script returned error exit status 1
    dpkg: dependency problems prevent configuration of python3-minimal:
     python3-minimal depends on python3.3-minimal (>= 3.3.1-1~); however:
      Package python3.3-minimal is not configured yet.
    
    dpkg: error processing python3-minimal (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of python3.3:
     python3.3 depends on python3.3-minimal (= 3.3.1-1ubuntu5); however:
      Package python3.3-minimal is not configured yet.
    
    dpkg: error processing python3.3 (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of python3:
     python3 depends on python3.3 (>= 3.3.1-1~); however:
      Package python3.3 is not configured yet.
     python3 depends on python3-minimal (= 3.3.1-0ubuntu1); however:
      Package python3-minimal is not configured yet.
    
    dpkg: error processing python3 (--configure):
     dependency problems - leaving unconfigured
    Errors were encountered while processing:
     python3.3-minimal
     python3-minimal
     python3.3
     python3
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    

    EDIT: sudo dbkg-reconfigure -a

    1/ Asks: ─────────────────────────────┤ Adduser ├────────────────────────────────┐
    │ │
    │ By default, users' home directories are readable by all users on the │
    │ system. If you want to increase security and privacy, you might want │
    │ home directories to be readable only for their owners. But if in doubt, │
    │ leave this option enabled. │
    │ │
    │ This will only affect home directories of users added from now on with │
    │ the adduser command. │
    │ │
    │ Do you want system-wide readable home directories?

    Said yes

    2/ ┤ Configuring apparmor ├──────────────────────────┐
    │ Please enter a space separated list of any additional locations for user │
    │ home directories. These locations are in addition to those specified in │
    │ /etc/apparmor.d/tunables/home and must end with a '/'. │
    │ │
    │ Example: if user's directories are stored in /srv/nfs/home and │
    │ /mnt/homes, you should enter "/srv/nfs/home/ /mnt/homes/". │
    │ │
    │ Additional home directory locations:

    I don't know what location to indicate... so I just pass

    Finally, I read on the shell:

    update-rc.d: warning: /etc/init.d/acpi-support missing LSB information
    update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
    acpid stop/waiting
    acpid start/running, process 24816
     * Starting AppArmor  
    
    profiles                                                              Skipping      
     profile in /etc/apparmor.d/disable: usr.bin.firefox
    Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd
                                                                         [ OK ]
     * Reloading AppArmor profiles                                                  
    Skipping     profile in /etc/apparmor.d/disable: usr.bin.firefox
    Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd
                                                                         [ OK ]
    gpg: key 437D05B5: "Ubuntu Archive Automatic Signing Key <[email protected]>" 
    not     changed
    gpg: key FBB75451: "Ubuntu CD Image Automatic Signing Key <[email protected]>" 
    not     changed
    gpg: key C0B21F32: "Ubuntu Archive Automatic Signing Key (2012)  
      <[email protected]>"     not changed
    gpg: key EFE21092: "Ubuntu CD Image Automatic Signing Key (2012) 
    <[email protected]>"     not changed
    gpg: Total number processed: 4
    gpg:              unchanged: 4
    Unknown media type in type 'all/all'
    Unknown media type in type 'all/allfiles'
    Unknown media type in type 'uri/mms'
    Unknown media type in type 'uri/mmst'
    Unknown media type in type 'uri/mmsu'
    Unknown media type in type 'uri/pnm'
    Unknown media type in type 'uri/rtspt'
    Unknown media type in type 'uri/rtspu'
    /usr/sbin/dpkg-reconfigure: asymptote is broken or not fully installed
    

    Edit: Synaptic On synaptic, no "broken dependencies" is displayed (I click on status and all I can see is: All Installed Installed (local or obsolete) Installed (manual) Not installed Not installed (residual config)

    • bigTree
      bigTree almost 11 years
      @ Igarzo thanks for helping. python --version returns Python 2.7.4 As for virtualenv I don't see what you mean (I am a beginner). I used a virtual environment recently to install matplotlib. How can I update my environment?
    • lgarzo
      lgarzo almost 11 years
      Can you provide the link to the matplotlib installation instructions you followed?
    • bigTree
      bigTree almost 11 years
    • lgarzo
      lgarzo almost 11 years
      Have you tried to reinstall python3?
    • bigTree
      bigTree almost 11 years
      I tried apt-get install python3 and got the same error. I also tried apt-get --reinstall install python 3 and got E: Internal Error, No file name for python3:i386
    • lgarzo
      lgarzo almost 11 years
      Well I'm not sure at this point. Please include all these collected information into your original question and see if a person with more insight can give you an answer. A well edited question will more likely to attract attention. You should include your Ubuntu version, your kernel version: uname -a, dpkg --print-architecture, is it a fresh install or upgrade from a previous version, any actions you performed before getting this error message (and maybe a bit on how you cannot turn off your computer).
  • Jay
    Jay almost 11 years
    OK, so there is some error while configuring python3.3-minimal, upon which the others all depend. From what I can see it looks that python3.3-minimal also depends on something which is wrong (the stacktrace).
  • Jay
    Jay almost 11 years
    Have you installed all dependencies for python3.3-minimal? You can manually install these by sudo apt-get install libc6 libexpat1 libpython3.3-minimal zlib1g.
  • Jay
    Jay almost 11 years
    Gosh... ok.. it's a long shot, but try this sudo dpgk-reconfigure -a
  • Jay
    Jay almost 11 years
    It looks like you have more problems than just python. Now it's complaining about another package: asymptote. dpkg-reconfigure -a should take quite a long time, as it tries to reconfigure all packages on the entire system. sudo dpgk-reconfigure python3.3-minimal forces it to only reconfigure this package, but I have a gut feeling this will not fix it.
  • bigTree
    bigTree almost 11 years
    yes it returned /usr/sbin/dpkg-reconfigure: python3.3-minimal is broken or not fully installed