Python Ubuntu : 无法纠正问题,您持有损坏的软件包
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23035310/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Ubuntu : Unable to correct problems, you have held broken packages
提问by user1161599
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
服务器版本:Apache/2.4.2 (Ubuntu) 服务器构建时间:2012 年 6 月 27 日 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
任何帮助appretiated
采纳答案by OM55
Option 1:You can try:
选项1:您可以尝试:
sudo apt-get upgrade
The 'upgrade' option tries to solve all dependencies in installed packages. Often this is enough to solve broken packages
'upgrade' 选项尝试解决已安装包中的所有依赖项。通常这足以解决损坏的包
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:
选项 2:如果您的软件包是从“deb”文件而不是从存储库安装的,则可能是您尝试安装的新软件包导致冲突,因此您需要首先删除以前版本的包裹。您可以从软件中心或直接使用:
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!
希望有帮助!
回答by hugoabpeixoto
I have also the same problem for sudo apt-get install npm.
我对 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
然后 sudo apt-get install nodejs sudo apt-get install npm
solved for me!
为我解决了!
回答by christianbundy
My problem was that I was doing a quiet installation, using the -qq
flags. Turning these off showed the dependency issue for me.
我的问题是我正在使用-qq
标志进行安静的安装。关闭这些显示了我的依赖性问题。
回答by Shinto Joseph
This will work for virtualenv pip wheel errorcode1 problems and also E unable to locate package problems
这将适用于 virtualenv pip wheel errorcode1 问题以及 E 无法定位包问题
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>