有时,当我安装东西时,我会收到如下错误:
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:
package1 : Depends: package2 (>= 1.8) but 1.7.5-1ubuntu1 is to be installed
E: Unable to correct problems, you have held broken packages.
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?
package-management apt ppa dependencies software-installation
从 10.04 升级到 12.04 后,我尝试安装不同的软件包。例如 ia32-libs 和 Skype (4.0)。
尝试安装这些时,我收到“无法纠正问题,您保存了损坏的软件包”错误消息。
命令的输出:
sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Run Code Online (Sandbox Code Playgroud)
运行后:
sudo dpkg --configure -a
foo@foo:~$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Run Code Online (Sandbox Code Playgroud) 我是这里的新手,所以请多多包涵。
我正在使用 ubuntu 14.04。
我尝试使用以下命令输入 mysql:
mysql -u root -p
Run Code Online (Sandbox Code Playgroud)
我收到以下消息:
The program mysql can be found on the following packages:
* mysql-client-core-5.5
* mariadb-client-core-5.5
* mysql-client-core-5.6
* percona-xtrabd-cluster-client-5.5
Run Code Online (Sandbox Code Playgroud)
然后我输入:
sudo apt-get install mysql-client-core-5.6
Run Code Online (Sandbox Code Playgroud)
安装后,我尝试使用以下命令再次连接到 mysql:
mysql -u root -p
Run Code Online (Sandbox Code Playgroud)
然后我收到错误消息:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Run Code Online (Sandbox Code Playgroud)
网上查了一下,发现需要安装mysql服务器,所以写了下面的命令
sudo apt-get install mysql-server
Run Code Online (Sandbox Code Playgroud)
然后我收到了消息:
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are …Run Code Online (Sandbox Code Playgroud) mysql package-management apt dependencies software-installation
我在我的 Ubuntu16.04 上成功安装了 python3 和 pip3,但是 pip3 install 坏了。我该如何解决这个问题?的错误信息pip3 install如下:
# pip3 install xlwt
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
ModuleNotFoundError: No module named 'pip._vendor.requests'
Run Code Online (Sandbox Code Playgroud)
输出 sudo -H pip3 install --upgrade pip
sudo -H pip3 install --upgrade pip
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 21, in <module> …Run Code Online (Sandbox Code Playgroud) 如果我尝试在 Ubuntu 14.04 上安装 mongo:
sudo apt-get install -y mongodb-org
Run Code Online (Sandbox Code Playgroud)
我收到错误:
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:
mongodb-org : Depends: mongodb-org-shell …Run Code Online (Sandbox Code Playgroud) 我在升级后的 Ubuntu 上安装 vim 时遇到问题。当我尝试安装 vim 时:
sudo apt-get install vim
Run Code Online (Sandbox Code Playgroud)
我收到此错误消息,说我损坏了包裹。
The following packages have unmet dependencies.
vim : Depends: libpython3.6 (>= 3.6.4~rc1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Run Code Online (Sandbox Code Playgroud)
我试着用
sudo apt-get update
sudo apt-get -f install
Run Code Online (Sandbox Code Playgroud)
我的 python 版本是 3.6.5。所以我很困惑 vim 缺少某些东西。因为在升级到 18.04 之前,我已经安装了 vim 并且运行良好。
dpkg --get-selections | grep hold
Run Code Online (Sandbox Code Playgroud)
也不显示任何持有的包裹。
但我仍然得到同样的错误。有任何想法吗?
谢谢!
编辑:
我通过将我的 python 包降级到 vim 请求的版本来解决这个问题。谢谢您的帮助。我解决了这个问题
sudo aptitude install -f vim
Run Code Online (Sandbox Code Playgroud)