Ubuntu : Unable to correct problems, you have held broken packages
Solution 1
Option 1: You can try:
sudo apt-get upgrade
The 'upgrade' option tries to solve all dependencies in installed packages. Often this is enough to solve broken packages
Option 2: If your package was installed from a 'deb' file and not from repositories, it may be that the new one you are trying to install is causing a conflict, and as a result you need first to remove the previous version of the package. You can do that from Software Center or directly with:
sudo apt-get remove libapache2-mod-wsgi
sudo apt-get clean
sudo apt-get autoclean
then
sudo apt-get update
sudo apt-get install libapache2-mod-wsgi
Hope that helps!
Solution 2
I have also the same problem for sudo apt-get install npm.
Tried
sudo apt-get remove npm
sudo apt-get remove nodejs
then
sudo apt-get clean
sudo apt-get autoclean
then sudo apt-get install nodejs sudo apt-get install npm
solved for me!
Solution 3
This will work for virtualenv pip wheel errorcode1 problems and also E unable to locate package problems
sudo apt-get update
sudo apt-get install python-software-properties
sudo apt-get install apt-file
sudo apt-file update
sudo apt-get install software-properties-common
sudo apt-get install <your filename>
user1161599
Updated on January 12, 2021Comments
-
user1161599 over 3 years
trying to install this, I am getting the 'Unable to correct problems, you have held broken packages' error message.
Apache version
Server version: Apache/2.4.2 (Ubuntu) Server built: Jun 27 2012 07:23:35
# aptitude install libapache2-mod-wsgi The following NEW packages will be installed: apache2.2-common{ab} libapache2-mod-wsgi 0 packages upgraded, 2 newly installed, 0 to remove and 0 not upgraded. Need to get 299 kB of archives. After unpacking 1,047 kB will be used. The following packages have unmet dependencies: apache2 : Conflicts: apache2.2-common but 2.2.22-1ubuntu1.5 is to be installed. apache2.2-common : Depends: apache2.2-bin (= 2.2.22-1ubuntu1.5) but it is not going to be installed. Depends: apache2-utils but it is not going to be installed. apache2-bin : Conflicts: apache2.2-common but 2.2.22-1ubuntu1.5 is to be installed. apache2-data : Conflicts: apache2.2-common but 2.2.22-1ubuntu1.5 is to be installed. The following actions will resolve these dependencies: Keep the following packages at their current version: 1) apache2.2-common [Not Installed] 2) libapache2-mod-wsgi [Not Installed] Accept this solution? [Y/n/q/?] Y No packages will be installed, upgraded, or removed. 0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B of archives. After unpacking 0 B will be used.
Any help appretiated
-
Bangash over 9 yearsI am also new to Ubuntu, installed today. I was installing VLC and its giving me the same problem, what to do ?
-
lesolorzanov over 9 yearsupgrade may be damaging to the system if you don't know what you are doing. It
-
Jayakrishnan Nair about 6 years
sudo apt
instead ofsudo apt-get
should work as well