LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   cannot install python2.7-dev (https://www.linuxquestions.org/questions/debian-26/cannot-install-python2-7-dev-4175491990/)

pan64 01-21-2014 03:52 AM

cannot install python2.7-dev
 
Hi guys, I have a debian wheezy stable (more or less) uptodate.
I originally installed sqeeze and it was updated/upgraded time by time.
But the package management system is not ok, something went wrong and I have no idea what's happened and how to fix it.

Actually I tried to install python2.7-dev (the version available is 2.7.3-6). I downloaded the package from http://packages.debian.org.
The answer was:
Code:

The following packages have unmet dependencies:
 python2.7-dev : Depends: python2.7 (= 2.7.3-6) but 2.7.3-8 is to be installed
                Depends: libpython2.7 (= 2.7.3-6) but 2.7.3-8 is to be installed

So somehow I have 2.7.3-8 installed (of python2.7 and libpython2.7).
Can someone tell me a solution? Try to install it from jessie? Force downgrade to 2.7.3-6? Try to find a compatible version?

here is my source.list:
Code:

#

# deb cdrom:[Debian GNU/Linux 6.0.7 _Squeeze_ - Official amd64 NETINST Binary-1 20130223-18:50]/ squeeze main
# deb cdrom:[Debian GNU/Linux 6.0.7 _Squeeze_ - Official amd64 NETINST Binary-1 20130223-18:50]/ squeeze main

#deb http://ftp.hu.debian.org/debian/ squeeze main non-free contrib
#deb-src http://ftp.hu.debian.org/debian/ squeeze main non-free contrib

deb http://ftp.debian.org/debian/ wheezy main non-free contrib
deb-src http://ftp.debian.org/debian/ wheezy main non-free contrib

#deb http://ftp.hu.debian.org/debian/ experimental main
#deb-src http://ftp.hu.debian.org/debian/ experimental main


#deb http://ftp.hu.debian.org/debian/ sid main non-free contrib
#deb-src http://ftp.hu.debian.org/debian/ sid main non-free contrib

# squeeze-updates, previously known as 'volatile'
#deb http://ftp.hu.debian.org/debian/ squeeze-updates main
#deb-src http://ftp.hu.debian.org/debian/ squeeze-updates main

#deb http://backports.debian.org/debian-backports wheezy-backports main
deb http://mozilla.debian.net/ wheezy-backports iceweasel-release

#deb http://www.deb-multimedia.org wheezy main non-free
#deb http://www.deb-multimedia.org experimental main

Thanks

zhjim 01-21-2014 05:37 AM

By looking at your sources.list I would not be asthoned if you have mixed packages from different versions.

So whats the output of
Quote:

dpkg --audit
Have you tried
Quote:

apt-get install python2.7-dev

pan64 01-21-2014 05:48 AM

dpkg --audit returns nothing.
Code:

#  apt-get install python2.7-dev
Reading package lists... Done
Building dependency tree     
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python2.7-dev : Depends: python2.7 (= 2.7.3-6) but 2.7.3-8 is to be installed
                Depends: libpython2.7 (= 2.7.3-6) but 2.7.3-8 is to be installed
E: Unable to correct problems, you have held broken packages.

Code:

# dpkg -l python python2.7
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                            Version              Architecture        Description
+++-===============================-====================-====================-====================================================================
ii  python                          2.7.3-4+deb7u1      all                  interactive high-level object-oriented language (default version)
ii  python2.7                      2.7.3-8              amd64                Interactive high-level object-oriented language (version 2.7)


zhjim 01-21-2014 07:03 AM

I check this on my wheezy box
Quote:

root@VM-box-2:~# dpkg -l python python2.7
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=================================-=====================-=====================-===============
ii python 2.7.3-4+deb7u1 all interactive high-level object-oriented language (default version)
ii python2.7 2.7.3-6 amd64 Interactive high-level object-oriented language (version 2.7)
Also check packages.debian.org but did not find 2.7.3.* anywhere else then wheezy. Testing, unstable all go higher. Either you have it from sometime when testing had 2.7.3.8 or some other respositories. Or maybe a dpkg installation. Some apt-pinning on the road maybe. All I can say that the installed version of python2.7 is showing the wrong version.

Thus you can either try to correct this by removing python2.7 and reinstall. Hoping that the version magicaly align. Or dpkg --force-depends to just have it installed.

Hungry ghost 01-21-2014 08:26 AM

Quote:

Originally Posted by zhjim (Post 5102146)
Thus you can either try to correct this by removing python2.7 and reinstall.

Yes, that's what I'd do. Or rather force a direct downgrade (since by removing it the system could attempt to remove other important packages)?:

Code:

dpkg --force-downgrade -i python2.7*.deb libpython2.7*.deb
(You need to substitute the packages for the target packages and versions).

Let's cross fingers so there are not other packages that depend on this version of python2.7 and libpython2.7 :).

pan64 01-21-2014 10:37 AM

that made it worse: now I have:
Code:

# synaptic
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "/usr/lib/python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
  File "/usr/lib/python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha1
ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
  File "/usr/lib/python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha224
ERROR:root:code for hash sha256 was not found.
Traceback (most recent call last):
  File "/usr/lib/python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha256
ERROR:root:code for hash sha384 was not found.
Traceback (most recent call last):
  File "/usr/lib/python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha384
ERROR:root:code for hash sha512 was not found.
Traceback (most recent call last):
  File "/usr/lib/python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha512


Hungry ghost 01-21-2014 12:53 PM

Sorry to hear that, pan64. Probably there are other packages that depend on python2.7 and libpython2.7 version 2.7.3-8. You might want to force the installation of this version of the packages. Of course, you will probably go back to the initial problem, but other than a downgrade, I'm not sure how to solve this issue.

This is not an easy task, but maybe tracking down all the packages that depend in python2.7 and libpython2.7, v. 2.7.3-8, removing them and reinstalling them from Stable?

pan64 01-22-2014 12:17 AM

no, removing is not an option it will probably remove almost everything (for example gnome). donwgrade may solve this issue, but I need to find out which packages should be reinstalled. Is there a way to check if a package belongs to the stable release or something else?

zhjim 01-22-2014 02:01 AM

Two things might help.

For individual packages use apt-cache policy pkgname. This shows the priority of repositories for the package. Also I'm not sure if shows the actuall origin.

The other one if apt-cache showpkg pkgname | head. Which shows the /var/lib/apt/lists directory. Withtin are the package list of (all) used repositories. I guess I grep within might give.

TobiSGD 01-22-2014 02:30 AM

Why would you even start to force install different versions when you have to trouble shoot version mismatches?
You told us in the initial post that you have a
Quote:

debian wheezy stable (more or less) uptodate.
That would have been my initial point to start with. What do you even mean with more or less up to date? Have you tried to make a full system upgrade when you encountered the version mismatches and then tried to install again?

OFFTOPIC: Looking at your sources.list, is there any specific reason you don't have Debian's security repo in there?

pan64 01-22-2014 02:43 AM

I have installed sqeeze and upgraded/updated several times. As you see some of the packages have higher versions (compared to the actual stable) therefore apt-get update and apt-get upgrade do nothing. For example I do not know how python 2.7.3-8 was installed.

(OFF: I don't know about that security repo at all, it is basically the default install)


All times are GMT -5. The time now is 05:30 PM.