Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to install python-dev

Tags:

python

ubuntu

When I try to install python-dev, libxml2-dev, libxslt-dev for Python2 on my Ubuntu 14.04, I get the following error:

E: Unable to correct problems, you have held broken packages
E: Unable to correct problems, you have held broken packages
E: Unable to correct problems, you have held broken packages
Reading package lists...
Building dependency tre...
Reading state information...
Some packaghes 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 nor been moved out of Incoming. 
The following information may help to resolve the situation:
The following packages have unmet dependecies:
python-dev : Depends: libpython-dev (= 2.7.5-5ubuntu3) but it is not going to be installed
Depends: python2.7-dev (>= 2.7.5-1~) but it is not going to be installed

What exactly to I need to do in order to fix this? The error is not very clear...

like image 825
ChikChak Avatar asked Mar 04 '26 19:03

ChikChak


1 Answers

You may just need to repair the unstable state. Reboot and try...

sudo apt-get update --fix-missing

and

sudo dpkg --configure -a

and

sudo apt-get install -f

If the problem of a broken package still exists, the solution is to edit the dpkg status file manually.

$ sudo nano /var/lib/dpkg/status #(you can use vim or gedit instead of nano)

Locate the corrupt package, and remove the whole block of information about it and save the file.

# Unlock the dpkg – (message /var/lib/dpkg/lock)
sudo fuser -vki /var/lib/dpkg/lock
sudo dpkg --configure -a

From this link.

like image 138
RightmireM Avatar answered Mar 07 '26 09:03

RightmireM