Installing python gives dpkg error

6,889

Solution 1

0 upgraded, 6 newly installed, 0 to remove and 488 not upgraded.

The problem here is that you are in-between several upgrade paths for every package. You are not using stable, nor testing, and that brings about problems. You should upgrade as many packages as possible to stable first:

sudo apt-get -t stable dist-upgrade

Then decide if you want to downgrade everything to stable or follow through to testing, in which case you should remove stable entries in your sources.list and upgrade again:

sudo sed -i '/stable/d' /etc/apt/sources.list
sudo apt-get dist-upgrade

I would personally just re-install the system just to make sure there's no further problems with dependencies and stick with either stable or testing. I don't know what Knoppix uses as a basis, but you don't seems to be using any repository apart from Debian.

Solution 2

In my opinion, there is nothing here that can be reasonably fixed. After a discussion with the poster on chat, it became clear that is he is basically doing unsupported things.

He first installed Knoppix, and then added Debian repositories and then tried to install/upgrade to Debian packages. This is not supported by Knoppix or Debian or anyone else as far as I can tell. The poster apparently read on the Knoppix forums that once Knoppix was installed it was Debian, and concluded from that that he could install Debian packages in his Knoppix installation. It is true that Knoppix is based on Debian, and that all Knoppix packages are Debian packages, but the package versions in the posters installation do not appear (based on information he provided) to correspond to those currently available in the Debian archives. Therefore, it is therefore not surprising that mixing the package versions of Knoppix with the incompatible versions found in Debian stable, unstable etc. should cause problems.

I recommended to the poster that he try just using Debian. Adding Knoppix to the mix does not appear to have any advantages, and is just causing him problems.

Share:
6,889

Related videos on Youtube

barlop
Author by

barlop

Updated on September 18, 2022

Comments

  • barlop
    barlop over 1 year

    Installing python gives a dpkg error.

    I have done these commands, output below

    $ sudo apt-get install python3.4  
    $ sudo dpkg -C  
    $ sudo apt-get check  
    $ apt-cache policy libglib2.0-dev  
    $ sudo dpkg --configure libglib2.0-dev  
    $ sudo dpkg --audit   
    $ sudo apt-get install cdrecord mkisofs slib libident spice-protocol \
                         default-jdk libaudio2:i386 libcacard default-jre  
    $ apt-cache policy python   
    $ sudo apt-get install python  
    $ apt-cache policy libc6  
    $ sudo apt-get update       ## no error  
    $ sudo apt-get -f install python  
    

    The output:

    $ sudo apt-get install python3.4

    $ sudo apt-get install python3.4
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following packages were automatically installed and are no longer required:
      librrd4 ntop-data python-mako python-markupsafe
    Use 'apt-get autoremove' to remove them.
    The following extra packages will be installed:
      libdb5.3 libmpdec2 libpython3.4-minimal libpython3.4-stdlib
      python3.4-minimal
    Suggested packages:
      python3.4-venv python3.4-doc
    The following NEW packages will be installed:
      libdb5.3 libmpdec2 libpython3.4-minimal libpython3.4-stdlib python3.4
      python3.4-minimal
    0 upgraded, 6 newly installed, 0 to remove and 488 not upgraded.
    1 not fully installed or removed.
    Need to get 4,804 kB of archives.
    After this operation, 19.0 MB of additional disk space will be used.
    Do you want to continue [Y/n]? y
    Get:1 http://ftp.de.debian.org/debian/ testing/main libdb5.3 i386 5.3.28-3 [662 kB]
    Get:2 http://ftp.de.debian.org/debian/ testing/main libmpdec2 i386 2.4.0-6 [76.4 kB]
    Get:3 http://ftp.de.debian.org/debian/ unstable/main libpython3.4-minimal i386 3.4.1-6 [484 kB]
    Get:4 http://ftp.de.debian.org/debian/ unstable/main libpython3.4-stdlib i386 3.4.1-6 [2,018 kB]
    Get:5 http://ftp.de.debian.org/debian/ unstable/main python3.4-minimal i386 3.4.1-6 [1,366 kB]
    Get:6 http://ftp.de.debian.org/debian/ unstable/main python3.4 i386 3.4.1-6 [198 kB]
    Fetched 4,804 kB in 7s (621 kB/s)                                              
    Selecting previously unselected package libdb5.3:i386.
    (Reading database ... 459131 files and directories currently installed.)
    Unpacking libdb5.3:i386 (from .../libdb5.3_5.3.28-3_i386.deb) ...
    Selecting previously unselected package libmpdec2:i386.
    Unpacking libmpdec2:i386 (from .../libmpdec2_2.4.0-6_i386.deb) ...
    Selecting previously unselected package libpython3.4-minimal:i386.
    Unpacking libpython3.4-minimal:i386 (from .../libpython3.4-minimal_3.4.1-6_i386.deb) ...
    Selecting previously unselected package libpython3.4-stdlib:i386.
    Unpacking libpython3.4-stdlib:i386 (from .../libpython3.4-stdlib_3.4.1-6_i386.deb) ...
    Selecting previously unselected package python3.4-minimal.
    Unpacking python3.4-minimal (from .../python3.4-minimal_3.4.1-6_i386.deb) ...
    Selecting previously unselected package python3.4.
    Unpacking python3.4 (from .../python3.4_3.4.1-6_i386.deb) ...
    Processing triggers for man-db ...
    Processing triggers for menu ...
    Processing triggers for gnome-menus ...
    Processing triggers for desktop-file-utils ...
    dpkg: dependency problems prevent configuration of libglib2.0-dev:
     libglib2.0-dev depends on python:any (>= 2.6.6-7~).
    
    dpkg: error processing libglib2.0-dev (--configure):
     dependency problems - leaving unconfigured
    Setting up libdb5.3:i386 (5.3.28-3) ...
    Setting up libmpdec2:i386 (2.4.0-6) ...
    Setting up libpython3.4-minimal:i386 (3.4.1-6) ...
    Setting up libpython3.4-stdlib:i386 (3.4.1-6) ...
    Setting up python3.4-minimal (3.4.1-6) ...
    Setting up python3.4 (3.4.1-6) ...
    Processing triggers for menu ...
    Errors were encountered while processing:
     libglib2.0-dev
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    

    $ sudo dpkg -C

    knoppix@Microknoppix:/var/lib$ sudo dpkg -C
    The following packages have been unpacked but not yet configured.
    They must be configured using dpkg --configure or the configure
    menu option in dselect for them to work:
     libglib2.0-dev       Development files for the GLib library
    
    The following packages are missing the md5sums control file in the
    database, they need to be reinstalled:
     cdrecord             Dummy transition package for wodim
     mkisofs              Dummy transition package for genisoimage
     slib                 Portable Scheme library
     libident             simple RFC1413 client library - runtime
     spice-protocol       spice-protocol
     default-jdk          Standard Java or Java compatible Development Kit
     libaudio2:i386       Network Audio System - shared libraries
     libcacard            libcacard
     default-jre          Standard Java or Java compatible Runtime
    

    $sudo apt-get check

    knoppix@Microknoppix:/var/lib$ apt-get check
    E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
    E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
    knoppix@Microknoppix:/var/lib$ sudo apt-get check
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    

    $ apt-cache policy libglib2.0-dev

    knoppix@Microknoppix:/var/lib$ apt-cache policy libglib2.0-dev
        libglib2.0-dev:
          Installed: 2.40.0-3
          Candidate: 2.40.0-3
          Version table:
             2.41.0-1 0
                  1 http://ftp.de.debian.org/debian/ experimental/main i386 Packages
         *** 2.40.0-3 0
                500 http://ftp.de.debian.org/debian/ testing/main i386 Packages
                500 http://ftp.de.debian.org/debian/ unstable/main i386 Packages
                100 /var/lib/dpkg/status
             2.33.12+really2.32.4-5 0
                990 http://ftp.de.debian.org/debian/ stable/main i386 Packages
    

    $sudo dpkg --configure libglib2.0-dev

    knoppix@Microknoppix:~$ sudo dpkg --configure libglib2.0-dev
    dpkg: dependency problems prevent configuration of libglib2.0-dev:
     libglib2.0-dev depends on python:any (>= 2.6.6-7~).
    
    dpkg: error processing libglib2.0-dev (--configure):
     dependency problems - leaving unconfigured
    Errors were encountered while processing:
     libglib2.0-dev
    

    $sudo dpkg --audit

    knoppix@Microknoppix:~$ sudo dpkg --audit
    The following packages have been unpacked but not yet configured.
    They must be configured using dpkg --configure or the configure
    menu option in dselect for them to work:
     libglib2.0-dev       Development files for the GLib library
    
    The following packages are missing the md5sums control file in the
    database, they need to be reinstalled:
     cdrecord             Dummy transition package for wodim
     mkisofs              Dummy transition package for genisoimage
     slib                 Portable Scheme library
     libident             simple RFC1413 client library - runtime
     spice-protocol       spice-protocol
     default-jdk          Standard Java or Java compatible Development Kit
     libaudio2:i386       Network Audio System - shared libraries
     libcacard            libcacard
     default-jre          Standard Java or Java compatible Runtime
    

    $ sudo apt-get install cdrecord mkisofs slib libident spice-protocol default-jdk libaudio2:i386 libcacard default-jre

    knoppix@Microknoppix:~$ sudo apt-get install cdrecord mkisofs slib libident spice-protocol default-jdk libaudio2:i386 libcacard default-jre   Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    default-jdk is already the newest version.
    default-jdk set to manually installed.
    default-jre is already the newest version.
    libident is already the newest version.
    libident set to manually installed.
    slib is already the newest version.
    cdrecord is already the newest version.
    mkisofs is already the newest version.
    spice-protocol is already the newest version.
    libcacard is already the newest version.
    The following packages were automatically installed and are no longer required:
      librrd4 ntop-data python-mako python-markupsafe
    Use 'apt-get autoremove' to remove them.
    Suggested packages:
      nas
    The following packages will be upgraded:
      libaudio2
    1 upgraded, 0 newly installed, 0 to remove and 487 not upgraded.
    1 not fully installed or removed.
    Need to get 87.0 kB of archives.
    After this operation, 4,096 B of additional disk space will be used.
    Do you want to continue [Y/n]? y
    Get:1 http://ftp.de.debian.org/debian/ stable/main libaudio2 i386 1.9.3-5wheezy1 [87.0 kB]
    Fetched 87.0 kB in 0s (302 kB/s)
    (Reading database ... 459964 files and directories currently installed.)
    Preparing to replace libaudio2:i386 1.9.3-5 (using .../libaudio2_1.9.3-5wheezy1_i386.deb) ...
    Unpacking replacement libaudio2:i386 ...
    dpkg: dependency problems prevent configuration of libglib2.0-dev:
     libglib2.0-dev depends on python:any (>= 2.6.6-7~).
    
    dpkg: error processing libglib2.0-dev (--configure):
     dependency problems - leaving unconfigured
    Setting up libaudio2:i386 (1.9.3-5wheezy1) ...
    Errors were encountered while processing:
     libglib2.0-dev
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    knoppix@Microknoppix:~$ 
    

    $ apt-cache policy python

    knoppix@Microknoppix:/var/lib$ apt-cache policy python
    python:
      Installed: 2.7.3-4
      Candidate: 2.7.3-4+deb7u1
      Version table:
         2.7.6-2 0
            500 http://ftp.de.debian.org/debian/ testing/main i386 Packages
            500 http://ftp.de.debian.org/debian/ unstable/main i386 Packages
         2.7.3-4+deb7u1 0
            990 http://ftp.de.debian.org/debian/ stable/main i386 Packages
     *** 2.7.3-4 0
            100 /var/lib/dpkg/status
    knoppix@Microknoppix:/var/lib$ 
    

    Trying apt-get install python (not specifying version)

    $ sudo apt-get install python

    knoppix@Microknoppix:/var/lib$ sudo apt-get install python
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following packages were automatically installed and are no longer required:
      librrd4 ntop-data python-mako python-markupsafe
    Use 'apt-get autoremove' to remove them.
    The following extra packages will be installed:
      python-minimal
    Suggested packages:
      python-doc
    The following packages will be upgraded:
      python python-minimal
    2 upgraded, 0 newly installed, 0 to remove and 485 not upgraded.
    1 not fully installed or removed.
    Need to get 223 kB of archives.
    After this operation, 0 B of additional disk space will be used.
    Do you want to continue [Y/n]? y
    Get:1 http://ftp.de.debian.org/debian/ stable/main python all 2.7.3-4+deb7u1 [181 kB]
    Get:2 http://ftp.de.debian.org/debian/ stable/main python-minimal all 2.7.3-4+deb7u1 [42.8 kB]
    Fetched 223 kB in 0s (390 kB/s)      
    (Reading database ... 459964 files and directories currently installed.)
    Preparing to replace python 2.7.3-4 (using .../python_2.7.3-4+deb7u1_all.deb) ...
    Unpacking replacement python ...
    Preparing to replace python-minimal 2.7.3-4 (using .../python-minimal_2.7.3-4+deb7u1_all.deb) ...
    Unpacking replacement python-minimal ...
    Processing triggers for doc-base ...
    Processing 1 changed doc-base file...
    Registering documents with scrollkeeper...
    Processing triggers for man-db ...
    Setting up python-minimal (2.7.3-4+deb7u1) ...
    Setting up python (2.7.3-4+deb7u1) ...
    dpkg: dependency problems prevent configuration of libglib2.0-dev:
     libglib2.0-dev depends on python:any (>= 2.6.6-7~).
    
    dpkg: error processing libglib2.0-dev (--configure):
     dependency problems - leaving unconfigured
    Errors were encountered while processing:
     libglib2.0-dev
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    knoppix@Microknoppix:/var/lib$ 
    

    $ apt-cache policy libc6

    knoppix@Microknoppix:~$ apt-cache policy libc6
    libc6:
      Installed: 2.17-5
      Candidate: 2.19-1
      Version table:
         2.19-1 0
            500 http://ftp.de.debian.org/debian/ testing/main i386 Packages
            500 http://ftp.de.debian.org/debian/ unstable/main i386 Packages
     *** 2.17-5 0
            100 /var/lib/dpkg/status
         2.13-38+deb7u1 0
            990 http://ftp.de.debian.org/debian/ stable/main i386 Packages
    knoppix@Microknoppix:~$ 
    

    after sudo apt-get update and doing sudo apt-get -f install python, I still get the error

    $sudo apt-get -f install python

    knoppix@Microknoppix:~/ntopngtr2/ntopng-1.1_6932$ sudo apt-get -f install python
    Reading package lists... Done
    Building dependency tree 
    Reading state information... Done
    python is already the newest version.
    python set to manually installed.
    The following packages were automatically installed and are no longer required:
    librrd4 ntop-data python-mako python-markupsafe
    Use 'apt-get autoremove' to remove them.
    0 upgraded, 0 newly installed, 0 to remove and 486 not upgraded.
    1 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
    dpkg: dependency problems prevent configuration of libglib2.0-dev:
    libglib2.0-dev depends on python:any (>= 2.6.6-7~).
    
    dpkg: error processing libglib2.0-dev (--configure):
    dependency problems - leaving unconfigured
    Errors were encountered while processing:
    libglib2.0-dev
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    knoppix@Microknoppix:~/ntopngtr2/ntopng-1.1_6932$
    
    • jordanm
      jordanm almost 10 years
      Bug report is here: bugs.debian.org/cgi-bin/bugreport.cgi?bug=747928. It's closed, but it was closed with an upload to experimental and I don't think the "fix" is correct.
    • Alen Milakovic
      Alen Milakovic almost 10 years
      I think an obvious question is - why are there debian sources listed, but the installed packages don't belong to any of them? For the record, I'm not familar with Knoppix, so I can't say what is correct or normal here.
    • Alen Milakovic
      Alen Milakovic almost 10 years
      One formatting comment - a big block of output is not very readable. It is better to divide this up into pieces, with subheadings, then it is easier to read.
  • barlop
    barlop almost 10 years
    thanks, those commands fixed it. I did get some interesting output from the first command sudo apt-get -t stable dist-upgrade I saw it cover some packages i'd had issues with, and I think it or the third command apt-get dist-upgrade then suggested I do apt-get update --fix-missing. I did that too. And with the sudo apt-get dist-upgrade I think it gave me a messaggez about not enough free space in /var... and that it couldn't remove the python2.7 directory as it's nto empty. Nevertheless, after those commands I could do sudo apt-get install python no errors. And start python.
  • barlop
    barlop almost 10 years
    While that works now, I made a debian usb too, and will use that. for some reason it runs faster as well.
  • barlop
    barlop almost 10 years
    +1 Thanks. I think you were right re package version issues as shown by apt-cache policy libc6, I have included a link here pastebin.com/raw.php?i=f80k2WBs showing the output of the command now that it works. No doubt other packages were probably at fault too. I have also taken your advice and have tried Debian proper. It runs very nicely. I prefer it to knoppix. Thanks for all the help and advice. I have accepted braiam's answer because it directly fixes the issue with knoppix. But i'm also following your suggestion now of using Debian.
  • barlop
    barlop about 9 years
    @barlop re speed, that was a usb disk issue rather than distro issue, turned out the kingston was slow and the sandisk was faster.