0

Unable to install pip , getting error

E: Unable to correct problems, you have held broken packages.

details:

uname -a
Linux a123-45-678-90 4.4.0-116-generic #140~14.04.1-Ubuntu SMP Fri Feb 16 09:25:20 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

which python
/usr/local/bin/python

python --version
Python 2.7.6

which pip , doesn't output anything.

sudo apt-get install pip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package pip

sudo apt-get update && sudo apt-get install python-pip

Ign http://dl.google.com stable InRelease
Hit http://dl.google.com stable Release.gpg                                    
Hit http://dl.google.com stable Release                                        
Hit http://dl.google.com stable/main amd64 Packages                            
Ign http://us.archive.ubuntu.com trusty InRelease                              
Hit http://security.ubuntu.com trusty-security InRelease                       
Get:1 http://us.archive.ubuntu.com trusty-updates InRelease [65.9 kB]          
Hit http://security.ubuntu.com trusty-security/main Sources                    
Hit http://ppa.launchpad.net trusty InRelease                                  
Ign https://apt.datadoghq.com stable InRelease                                 
Hit https://apt.datadoghq.com stable Release.gpg                               
Ign http://dl.google.com stable/main Translation-en_US                         
Hit http://us.archive.ubuntu.com trusty-backports InRelease                    
Hit http://security.ubuntu.com trusty-security/restricted Sources              
Hit https://apt.datadoghq.com stable Release                                   
Ign http://dl.google.com stable/main Translation-en                            
Hit https://apt.datadoghq.com stable/6 amd64 Packages                          
Hit https://apt.datadoghq.com stable/6 i386 Packages                           
Hit http://us.archive.ubuntu.com trusty Release.gpg                            
Get:2 https://apt.datadoghq.com stable/6 Translation-en_US            
Hit http://security.ubuntu.com trusty-security/universe Sources                
Get:3 http://us.archive.ubuntu.com trusty-updates/main Sources [427 kB]        
Hit http://ppa.launchpad.net trusty InRelease                                  
Hit http://security.ubuntu.com trusty-security/multiverse Sources              
Hit http://security.ubuntu.com trusty-security/main amd64 Packages             
Hit http://ppa.launchpad.net trusty InRelease                                  
Get:4 http://us.archive.ubuntu.com trusty-updates/restricted Sources [6,322 B] 
Get:5 http://us.archive.ubuntu.com trusty-updates/universe Sources [231 kB]    
Hit http://security.ubuntu.com trusty-security/restricted amd64 Packages       
Get:6 http://us.archive.ubuntu.com trusty-updates/multiverse Sources [7,424 B] 
Hit http://security.ubuntu.com trusty-security/universe amd64 Packages         
Get:7 http://us.archive.ubuntu.com trusty-updates/main amd64 Packages [1,141 kB]
Hit http://ppa.launchpad.net trusty/main amd64 Packages                        
Ign https://apt.datadoghq.com stable/6 Translation-en_US                       
Ign https://apt.datadoghq.com stable/6 Translation-en                          
Hit http://security.ubuntu.com trusty-security/multiverse amd64 Packages       
Get:8 http://us.archive.ubuntu.com trusty-updates/restricted amd64 Packages [17.2 kB]
Hit http://ppa.launchpad.net trusty/main i386 Packages                         
Hit http://security.ubuntu.com trusty-security/main i386 Packages              
Get:9 http://us.archive.ubuntu.com trusty-updates/universe amd64 Packages [518 kB]
Get:10 http://us.archive.ubuntu.com trusty-updates/multiverse amd64 Packages [14.6 kB]
Hit http://security.ubuntu.com trusty-security/restricted i386 Packages        
Get:11 http://us.archive.ubuntu.com trusty-updates/main i386 Packages [1,068 kB]
Hit http://ppa.launchpad.net trusty/main Translation-en                        
Hit http://security.ubuntu.com trusty-security/universe i386 Packages          
Get:12 http://us.archive.ubuntu.com trusty-updates/restricted i386 Packages [17.1 kB]
Get:13 http://us.archive.ubuntu.com trusty-updates/universe i386 Packages [500 kB]
Hit http://security.ubuntu.com trusty-security/multiverse i386 Packages        
Get:14 http://us.archive.ubuntu.com trusty-updates/multiverse i386 Packages [15.0 kB]
Hit http://ppa.launchpad.net trusty/main amd64 Packages                        
Hit http://security.ubuntu.com trusty-security/main Translation-en             
Hit http://us.archive.ubuntu.com trusty-updates/main Translation-en            
Hit http://us.archive.ubuntu.com trusty-updates/multiverse Translation-en      
Hit http://security.ubuntu.com trusty-security/multiverse Translation-en       
Hit http://ppa.launchpad.net trusty/main i386 Packages                         
Hit http://security.ubuntu.com trusty-security/restricted Translation-en       
Hit http://us.archive.ubuntu.com trusty-updates/restricted Translation-en      
Hit http://us.archive.ubuntu.com trusty-updates/universe Translation-en        
Hit http://security.ubuntu.com trusty-security/universe Translation-en         
Hit http://us.archive.ubuntu.com trusty-backports/main Sources          
Hit http://ppa.launchpad.net trusty/main Translation-en           
Hit http://us.archive.ubuntu.com trusty-backports/restricted Sources           
Hit http://us.archive.ubuntu.com trusty-backports/universe Sources             
Hit http://us.archive.ubuntu.com trusty-backports/multiverse Sources           
Hit http://us.archive.ubuntu.com trusty-backports/main amd64 Packages      
Hit http://ppa.launchpad.net trusty/main amd64 Packages            
Hit http://us.archive.ubuntu.com trusty-backports/restricted amd64 Packages    
Hit http://us.archive.ubuntu.com trusty-backports/universe amd64 Packages      
Hit http://us.archive.ubuntu.com trusty-backports/multiverse amd64 Packages    
Hit http://ppa.launchpad.net trusty/main i386 Packages             
Hit http://us.archive.ubuntu.com trusty-backports/main i386 Packages           
Hit http://us.archive.ubuntu.com trusty-backports/restricted i386 Packages     
Hit http://us.archive.ubuntu.com trusty-backports/universe i386 Packages       
Hit http://us.archive.ubuntu.com trusty-backports/multiverse i386 Packages 
Hit http://ppa.launchpad.net trusty/main Translation-en            
Hit http://us.archive.ubuntu.com trusty-backports/main Translation-en
Hit http://us.archive.ubuntu.com trusty-backports/multiverse Translation-en
Hit http://us.archive.ubuntu.com trusty-backports/restricted Translation-en
Hit http://us.archive.ubuntu.com trusty-backports/universe Translation-en
Hit http://us.archive.ubuntu.com trusty Release   
Hit http://us.archive.ubuntu.com trusty/main Sources
Hit http://us.archive.ubuntu.com trusty/restricted Sources
Hit http://us.archive.ubuntu.com trusty/universe Sources
Hit http://us.archive.ubuntu.com trusty/multiverse Sources
Hit http://us.archive.ubuntu.com trusty/main amd64 Packages
Hit http://us.archive.ubuntu.com trusty/restricted amd64 Packages
Hit http://us.archive.ubuntu.com trusty/universe amd64 Packages
Hit http://us.archive.ubuntu.com trusty/multiverse amd64 Packages
Hit http://us.archive.ubuntu.com trusty/main i386 Packages
Hit http://us.archive.ubuntu.com trusty/restricted i386 Packages
Hit http://us.archive.ubuntu.com trusty/universe i386 Packages
Hit http://us.archive.ubuntu.com trusty/multiverse i386 Packages
Hit http://us.archive.ubuntu.com trusty/main Translation-en
Hit http://us.archive.ubuntu.com trusty/multiverse Translation-en
Hit http://us.archive.ubuntu.com trusty/restricted Translation-en
Hit http://us.archive.ubuntu.com trusty/universe Translation-en
Ign http://us.archive.ubuntu.com trusty/main Translation-en_US                 
Ign http://us.archive.ubuntu.com trusty/multiverse Translation-en_US           
Ign http://us.archive.ubuntu.com trusty/restricted Translation-en_US           
Ign http://us.archive.ubuntu.com trusty/universe Translation-en_US             
Fetched 4,029 kB in 7s (564 kB/s)                                              
Reading package lists... Done
W: Ignoring Provides line with DepCompareOp for package gdb-minimal
W: Ignoring Provides line with DepCompareOp for package gdb-minimal
W: You may want to run apt-get update to correct these problems
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:
 python-pip : Depends: python-colorama but it is not going to be installed
              Depends: python-distlib but it is not going to be installed
              Depends: python-html5lib but it is not going to be installed
              Depends: python-pkg-resources but it is not going to be installed
              Depends: python-requests but it is not going to be installed
              Depends: python-setuptools (>= 0.6c1) but it is not going to be installed
              Depends: python-six but it is not going to be installed
              Depends: python:any (>= 2.7.5-5~)
              Depends: python:any (< 2.8)
              Recommends: python-dev-all (>= 2.6) but it is not installable
              Recommends: python-wheel but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

How do i resolve this issue E: Unable to correct problems, you have held broken packages. ? Does it depend on dpkg ? I'm not sure if /usr/***/dpkg file's been deleted ? Tried re-installing dpkg, but no success. I don't mind in re-trying all again

If it's depending upon dpkg, how do i un-install and re-install from fresh.

New contributor
StackGuru is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
0

It seems problem is occurring because of presence of external repository.

  1. First remove all the external repositories.
    Please refer this post for help How can PPAs be removed?

  2. Create a backup of your sources.list file
    sudo cp /etc/apt/sources.list /etc/apt/sources.list.bac

  3. Open /etc/apt/sources.list file in your favorite editor and delete everything.
  4. Go here: http://repogen.simplylinux.ch/
  5. Select your country.
  6. Select the release.
  7. Check all the option in Ubuntu Branches.
  8. Check all the option in Ubuntu Updates except Proposed option.
  9. Check all the option in Ubuntu Partner Repos and Ubuntu Extras Repos.
  10. Click on Generate List.
  11. Copy the output in the editor and save it.

Now run :

sudo apt-get clean
sudo apt-get update
sudo apt-get install -f

Your Answer

StackGuru is a new contributor. Be nice, and check out our Code of Conduct.

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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