Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: Messed up Python installation

  1. #1
    Join Date
    Jan 2013
    Beans
    24

    Messed up Python installation

    All I can show is two error messages I have in my terminal:

    Code:
    15:37:11 ~$ sudo dpkg --configure -a
    [sudo] password for sergey: 
    dpkg: error processing package python-pip (--configure):
     package is in a very bad inconsistent state; you should
     reinstall it before attempting configuration
    dpkg: error processing package bleachbit (--configure):
     package is in a very bad inconsistent state; you should
     reinstall it before attempting configuration
    dpkg: error processing package python-libxslt1 (--configure):
     package is in a very bad inconsistent state; you should
     reinstall it before attempting configuration
    dpkg: error processing package python-debian (--configure):
     package is in a very bad inconsistent state; you should
     reinstall it before attempting configuration
    dpkg: dependency problems prevent configuration of update-notifier:
     update-notifier depends on python-debian; however:
      Package python-debian is not configured yet.
    
    
    dpkg: error processing package update-notifier (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of update-notifier-common:
     update-notifier-common depends on python-debian; however:
      Package python-debian is not configured yet.
    
    
    dpkg: error processing package update-notifier-common (--configure):
     dependency problems - leaving unconfigured
    Errors were encountered while processing:
     python-pip
     bleachbit
     python-libxslt1
     python-debian
     update-notifier
     update-notifier-common
    Code:
    15:44:31 ~$ sudo aptitude reinstall python-minimal
    The following packages will be REINSTALLED:
      python-minimal 
    The following partially installed packages will be configured:
      bleachbit python-debian python-pip update-notifier update-notifier-common 
    0 packages upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 1 not upgraded.
    Need to get 0 B/300 kB of archives. After unpacking 0 B will be used.
    E: Can't find a source to download version '1.1.28-2ubuntu0.1' of 'python-libxslt1:amd64'
    E: Can't find a source to download version '1.1.28-2ubuntu0.1' of 'python-libxslt1:amd64'
    E: Internal error: couldn't generate list of packages to download
    It seems I messed up my python installation after playing with symbolic links.

    On top of that, I have:

    Code:
    15:45:34 ~$ env python
    Python 3.6.7 | packaged by conda-forge | (default, Feb 20 2019, 02:51:38) 
    [GCC 7.3.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    which means I have broken applications dependant on python2, e.g. bleachbit. Though, I am not sure if it;s amenable with these lines in `.bashrc` put by Anaconda distribution:

    Code:
    # added by Anaconda3 4.3.1 installer
    export PATH="/home/sergey/anaconda3/bin:$PATH"
    I would be very grateful to restoring python environment and removing `apt-get` errors.
    Last edited by utah777; 1 Week Ago at 02:44 PM.

  2. #2
    Join Date
    Jun 2006
    Location
    Nux Jam
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Messed up Python installation

    A few ideas and solutions already used :
    https://askubuntu.com/questions/1413...-does-not-work

  3. #3
    Join Date
    Jan 2013
    Beans
    24

    Re: Messed up Python installation

    Code:
    sudo rm -rf /var/lib/dpkg/updates/*
    sudo rm -rf /var/lib/apt/lists/*
    sudo rm /var/cache/apt/*.bin
    sudo apt-get clean
    sudo apt-get autoremove
    sudo apt-get update
    
    16:17:42 ~$ sudo dpkg --configure -a
    dpkg: error processing package python-pip (--configure):
     package is in a very bad inconsistent state; you should
     reinstall it before attempting configuration
    dpkg: error processing package bleachbit (--configure):
     package is in a very bad inconsistent state; you should
     reinstall it before attempting configuration
    dpkg: error processing package python-libxslt1 (--configure):
     package is in a very bad inconsistent state; you should
     reinstall it before attempting configuration
    dpkg: error processing package python-debian (--configure):
     package is in a very bad inconsistent state; you should
     reinstall it before attempting configuration
    dpkg: dependency problems prevent configuration of update-notifier:
     update-notifier depends on python-debian; however:
      Package python-debian is not configured yet.
    
    
    dpkg: error processing package update-notifier (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of update-notifier-common:
     update-notifier-common depends on python-debian; however:
      Package python-debian is not configured yet.
    
    
    dpkg: error processing package update-notifier-common (--configure):
     dependency problems - leaving unconfigured
    Errors were encountered while processing:
     python-pip
     bleachbit
     python-libxslt1
     python-debian
     update-notifier
     update-notifier-common

    Code:
    16:20:48 ~$ sudo dpkg --remove --force-remove-reinstreq python-libxslt1
    dpkg: warning: overriding problem because --force enabled:
    dpkg: warning: package is in a very bad inconsistent state; you should
     reinstall it before attempting a removal
    (Reading database ... 448240 files and directories currently installed.)
    Removing python-libxslt1 (1.1.28-2ubuntu0.1) ...
      File "/usr/bin/pyclean", line 57
        pyfile = (yield)
                      ^
    SyntaxError: invalid syntax
    dpkg: error processing package python-libxslt1 (--remove):
     subprocess installed pre-removal script returned error exit status 1
      File "/usr/bin/pycompile", line 69
        with file(join(name, fn), 'r') as lines:
                ^
    SyntaxError: invalid syntax
    dpkg: error while cleaning up:
     subprocess installed post-installation script returned error exit status 1
    Errors were encountered while processing:
     python-libxslt1
    Does not seem to work.
    Last edited by utah777; 1 Week Ago at 02:26 PM.

  4. #4
    Join Date
    Jun 2006
    Location
    Nux Jam
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Messed up Python installation

    Next step: edit and remove the related faulty packages entries listed above from (use the search feature to find them):

    sudo gedit /var/lib/dpkg/status
    and logout/in and update/upgrade again.
    Note: also be sure to only use genuine lubuntu packages to avoid conflicts/incompatibilities

  5. #5
    Join Date
    Mar 2007
    Beans
    382

    Re: Messed up Python installation

    Try :

    Code:
    sudo dpkg --configure -a
    sudo apt install -f
    If that doesn't work try
    Code:
    sudo apt install --reinstall <package name>
    For each package listed in the error messages.
    After reinstallation run the commands above again to confirm everything is OK.
    This may not work if you have some bad links that are not overwritten by the reinstall.
    Last edited by rsteinmetz70112; 1 Week Ago at 04:17 PM.

  6. #6
    Join Date
    Jan 2013
    Beans
    24

    Re: Messed up Python installation

    Code:
    18:09:22 ~$ sudo apt install --reinstall python-pip
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following extra packages will be installed:
      python-libxslt1
    The following packages will be upgraded:
      python-libxslt1
    1 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
    6 not fully installed or removed.
    Need to get 0 B/431 kB of archives.
    After this operation, 0 B of additional disk space will be used.
    Do you want to continue? [Y/n] 
    (Reading database ... 449220 files and directories currently installed.)
    Preparing to unpack .../python-libxslt1_1.1.28-2ubuntu0.2_amd64.deb ...
      File "/usr/bin/pyclean", line 57
        pyfile = (yield)
                      ^
    SyntaxError: invalid syntax
    dpkg: warning: subprocess old pre-removal script returned error exit status 1
    dpkg: trying script from the new package instead ...
      File "/usr/bin/pyclean", line 57
        pyfile = (yield)
                      ^
    SyntaxError: invalid syntax
    dpkg: error processing archive /var/cache/apt/archives/python-libxslt1_1.1.28-2ubuntu0.2_amd64.deb (--unpack):
     subprocess new pre-removal script returned error exit status 1
      File "/usr/bin/pycompile", line 69
        with file(join(name, fn), 'r') as lines:
                ^
    SyntaxError: invalid syntax
    dpkg: error while cleaning up:
     subprocess installed post-installation script returned error exit status 1
    Preparing to unpack .../python-pip_1.5.4-1ubuntu4_all.deb ...
      File "/usr/bin/pyclean", line 57
        pyfile = (yield)
                      ^
    SyntaxError: invalid syntax
    dpkg: warning: subprocess old pre-removal script returned error exit status 1
    dpkg: trying script from the new package instead ...
      File "/usr/bin/pyclean", line 57
        pyfile = (yield)
                      ^
    SyntaxError: invalid syntax
    dpkg: error processing archive /var/cache/apt/archives/python-pip_1.5.4-1ubuntu4_all.deb (--unpack):
     subprocess new pre-removal script returned error exit status 1
      File "/usr/bin/pycompile", line 69
        with file(join(name, fn), 'r') as lines:
                ^
    SyntaxError: invalid syntax
    dpkg: error while cleaning up:
     subprocess installed post-installation script returned error exit status 1
    Errors were encountered while processing:
     /var/cache/apt/archives/python-libxslt1_1.1.28-2ubuntu0.2_amd64.deb
     /var/cache/apt/archives/python-pip_1.5.4-1ubuntu4_all.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    18:10:06 ~$

  7. #7
    Join Date
    Mar 2007
    Beans
    382

    Re: Messed up Python installation

    Have you tried reinstalling python-libxslt?
    It seems to be the common thread of all the errors.
    My next candidate would be python-debian

  8. #8
    Join Date
    Aug 2016
    Location
    Wandering
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: Messed up Python installation

    This has worked for me:
    Code:
    sudo mv /var/lib/dpkg/info/<packagename>.* /tmp/
    sudo dpkg --remove --force-remove-reinstreq <packagename>
    sudo apt remove <packagename>
    sudo apt autoremove && sudo apt autoclean
    And if that still leaves you in the same state try:
    Code:
    sudo apt install --reinstall python-debian python3-debian python-chardet python3-chardet
    Good Luck
    With realization of one's own potential and self-confidence in one's ability, one can build a better world.
    Dalai Lama>>
    Code Tags

  9. #9
    Join Date
    Jan 2013
    Beans
    24

    Re: Messed up Python installation

    Quote Originally Posted by dino99 View Post
    Next step: edit and remove the related faulty packages entries listed above from (use the search feature to find them):



    and logout/in and update/upgrade again.
    Note: also be sure to only use genuine lubuntu packages to avoid conflicts/incompatibilities
    Removed all the culprits from `/var/lib/dpkg/status`, still:

    Code:
    18:55:28 ~$ sudo dpkg --configure -a
    18:56:22 ~$ sudo apt install -f
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Correcting dependencies... Done
    The following extra packages will be installed:
      python-debian update-notifier update-notifier-common
    The following NEW packages will be installed:
      python-debian update-notifier update-notifier-common
    0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
    Need to get 211 kB/261 kB of archives.
    After this operation, 2,692 kB of additional disk space will be used.
    Do you want to continue? [Y/n] 
    Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main update-notifier-common all 0.154.1ubuntu6 [165 kB]
    Get:2 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main update-notifier amd64 0.154.1ubuntu6 [46.4 kB]
    Fetched 211 kB in 0s (220 kB/s)           
    Selecting previously unselected package python-debian.
    (Reading database ... 448713 files and directories currently installed.)
    Preparing to unpack .../python-debian_0.1.21+nmu2ubuntu2_all.deb ...
    Unpacking python-debian (0.1.21+nmu2ubuntu2) ...
    Selecting previously unselected package update-notifier-common.
    Preparing to unpack .../update-notifier-common_0.154.1ubuntu6_all.deb ...
    Unpacking update-notifier-common (0.154.1ubuntu6) ...
    Selecting previously unselected package update-notifier.
    Preparing to unpack .../update-notifier_0.154.1ubuntu6_amd64.deb ...
    Unpacking update-notifier (0.154.1ubuntu6) ...
    Processing triggers for hicolor-icon-theme (0.13-1) ...
    Processing triggers for gconf2 (3.2.6-0ubuntu2) ...
    Processing triggers for libglib2.0-0:amd64 (2.40.2-0ubuntu1.1) ...
    Processing triggers for libglib2.0-0:i386 (2.40.2-0ubuntu1.1) ...
    Segmentation fault (core dumped)
    Setting up python-debian (0.1.21+nmu2ubuntu2) ...
      File "/usr/bin/pycompile", line 69
        with file(join(name, fn), 'r') as lines:
                ^
    SyntaxError: invalid syntax
    dpkg: error processing package python-debian (--configure):
     subprocess installed post-installation script returned error exit status 1
    dpkg: dependency problems prevent configuration of update-notifier-common:
     update-notifier-common depends on python-debian; however:
      Package python-debian is not configured yet.
    
    
    dpkg: error processing package update-notifier-common (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of update-notifier:
     update-notifier depends on update-notifier-common (= 0.154.1ubuntu6); however:
      Package update-notifier-common is not configured yet.
     update-notifier depends on python-debian; however:
      Package python-debian is not configured yet.
    
    
    dpkg: error processing package update-notifier (--configure):
     dependency problems - leaving unconfigured
    No apport report written because the error message indicates its a followup error from a previous failure.
          No apport report written because the error message indicates its a followup error from a previous failure.
                Errors were encountered while processing:
     python-debian
     update-notifier-common
     update-notifier
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    18:56:46 ~$

  10. #10
    Join Date
    Jan 2013
    Beans
    24

    Re: Messed up Python installation

    Quote Originally Posted by rsteinmetz70112 View Post
    Have you tried reinstalling python-libxslt?
    It seems to be the common thread of all the errors.
    My next candidate would be python-debian
    Tried reinstalling both, the only luck so far with `python-libxslt`,

    Code:
    dpkg: error processing package python-debian (--configure):
     subprocess installed post-installation script returned error exit status 1
    dpkg: dependency problems prevent configuration of update-notifier-common:
     update-notifier-common depends on python-debian; however:
      Package python-debian is not configured yet.
    Last edited by utah777; 1 Week Ago at 05:05 PM.

Page 1 of 3 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •