0

I know python is already there when the Ubuntu is installed.

While, some other user used my machine has tried to install some other third party tools (eg : mockSSH etc) another version of the Python has been installed. And now some important softwares like meld is not there.

When I try to install them, it yells me Unable to correct problems, you have held broken packages..

Error :

me@my-pc:~$ sudo apt-get install meld
[sudo] password for me: 
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:
 meld : Depends: python:any (< 2.8)
        Depends: python:any (>= 2.7.5-5~)
        Depends: python-gi (>= 3.8) but it is not going to be installed
        Depends: python-gi-cairo but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I tried various ways (eg : fix broken, installing with aptitude, install custom packages etc) but nothing worked.

Eg : 1. Force Installing

me@my-pc:~$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.4.0-31 linux-headers-4.4.0-31-generic linux-headers-4.4.0-96 linux-headers-4.4.0-96-generic linux-headers-4.4.0-97 linux-headers-4.4.0-97-generic linux-image-4.4.0-31-generic
  linux-image-4.4.0-96-generic linux-image-4.4.0-97-generic linux-image-extra-4.4.0-31-generic linux-image-extra-4.4.0-96-generic linux-image-extra-4.4.0-97-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
  1. Installing with aptitude
me@my-pc:~$ sudo aptitude -f install meld
The following NEW packages will be installed:
  meld python:i386{ab} python-cairo{a} python-gi{a} python-gi-cairo{a} python-minimal:i386{a} python2.7:i386{a}

python2.7-minimal:i386{a} 0 packages upgraded, 8 newly installed, 0 to remove and 1 not upgraded. Need to get 2,447 kB of archives. After unpacking 8,988 kB will be used. The following packages have unmet dependencies: python : Conflicts: python:i386 but 2.7.11-1 is to be installed. python:i386 : Conflicts: python but 2.7.13-1 is installed. The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     meld [Not Installed]                               
2)     python:i386 [Not Installed]                        
3)     python-cairo [Not Installed]                       
4)     python-gi [Not Installed]                          
5)     python-gi-cairo [Not Installed]                    

     Leave the following dependencies unresolved:         
6)     python-minimal:i386 recommends python:i386         


Accept this solution? [Y/n/q/?]  
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.

When I check for python it lists these.

me@my-pc:~$ python
python             python2.7          python2-config     python3.5          python3.5m         python3-config     python3m-config    
python2            python2.7-config   python3            python3.5-config   python3.5m-config  python3m           python-config  

My problem is, how to fix these broken packages and install the python as it should be?

  • 1
    It would be better if you known which software was installed before package breakage (see /var/log/dpkg.log for packages). Also you can try graphical aptitude mode (sudo aptitude). Select Actions | Cancel pending actions and then Search | Find broken (or <b>) then carefully follow aptitude's recommendations. – N0rbert Nov 27 '17 at 12:03
  • Thanx Nornert. I got the answer. This was also helpful. – namalfernandolk Nov 27 '17 at 17:34
1

I got the solution

Since it says there's a conflict I tried to install the python_2.7.11-1 via deb.

sudo dpkg -i python_2.7.11-1_amd64.deb

There I got below problem.

dpkg: regarding python_2.7.11-1_amd64.deb containing python, pre-dependency problem:
 python pre-depends on python-minimal (= 2.7.11-1)
  python-minimal is not installed.

So, I tried to install python-minimal.

sudo apt-get install python-minimal

WIth that it set up all the related things.

And I tried sudo aptitude install meld and it worked! Thanks all for the support!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.