$ cat /etc./issue
$ Ubuntu 18.04.1 LTS
我已经从源安装了 python3.6 和 python3.7。现在我尝试安装 gnome-terminal(由于某种原因,它与 python3 一起被删除),我发出以下命令:
$ sudo apt-get install gnome-terminal
该行被执行并产生以下输出:
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:
gnome-terminal : Depends: python3 but it is not going to be installed
Depends: python3-gi but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
它一直提到python3
但它已安装,我可以这样做:
$ python3 --version
$ Python 3.6.5
如果我尝试:
$ sudo apt-get install python3
我收到以下错误:
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:
python3 : PreDepends: python3-minimal (= 3.6.5-3) but it is not going to be installed
Depends: python3.6 (>= 3.6.5-2~) but it is not going to be installed
Depends: libpython3-stdlib (= 3.6.5-3) but 3.6.7-1~18.04 is to be installed
E: Unable to correct problems, you have held broken packages.
如果我尝试:
$ sudo apt-get install python3-minimal
我得到:
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:
python3-minimal : Depends: python3.6-minimal (>= 3.6.5-2~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
等等...我该怎么办?!我已经完全没有主意了...
答案1
你可以尝试一下 aptitude。
像这样安装 aptitude:
sudo apt install aptitude
如果这不起作用,请.deb
从以下位置下载 aptitude 包这里适用于 64 位并像这样安装:
sudo dpkg -i aptitude_0.8.10-6ubuntu1_amd64.deb
或者通过双击安装下载的软件包,以便在 GUI 软件包管理器中打开它(ubuntu 软件) 并从那里安装。
之后,像这样安装 python3:
sudo aptitude install python3
Aptitude 擅长解决依赖关系,并且很可能会在您的情况下成功。