无法使用 apt-get 安装 - 缺少 python

无法使用 apt-get 安装 - 缺少 python

我刚刚将 Xubuntu 更新到 18.04,现在蓝牙已经失效了。我尝试安装 blueman,但出现了以下错误:

nicolas@nicolas-UX530UX:~$ sudo apt-get install python3
[sudo] password for nicolas: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3 is already the newest version (3.6.5-3ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
nicolas@nicolas-UX530UX:~$ sudo apt-get install blueman
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:
 blueman : Depends: libpython3.6 (>= 3.6.0~b2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
nicolas@nicolas-UX530UX:~$ 

据我所知,它询问的是 python > 3.6.0,正如你所见,我拥有的是 3.6.5。

我也尝试过这个,但没有改善:

sudo apt-get install --reinstall python3

有人有想法吗?

更新:我无法安装任何与 python 相关的东西,所以这不是与蓝牙相关的问题:

nicolas@nicolas-UX530UX:~$ sudo apt-get install krita
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:
 krita : Depends: libpython3.6 (>= 3.6.4~rc1) but it is not going to be installed
         Recommends: libpython3-dev but it is not going to be installed
         Recommends: python3-pyqt5 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

更新2:我尝试手动安装python3.6,但因依赖libpython3.6-stdlib而失败:

nicolas@nicolas-UX530UX:~$ sudo apt install libpython3.6
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:
 libpython3.6 : Depends: libpython3.6-stdlib (= 3.6.5-3) but 3.6.6-1+xenial1 is to be installed
E: Unable to correct problems, you have held broken packages.
nicolas@nicolas-UX530UX:~$ sudo apt install libpython3.6-stdlib
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libpython3.6-stdlib is already the newest version (3.6.6-1+xenial1).
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

更新 3 这是我的 ppa 列表,但我不知道是否应该删除其中一些以及删除哪一个?

nicolas@nicolas-UX530UX:~$ sudo ls /etc/apt/sources.list.d
deadsnakes-ubuntu-ppa-xenial.list            nilarimogard-ubuntu-webupd8-xenial.list.save
deadsnakes-ubuntu-ppa-xenial.list.distUpgrade        ondrej-ubuntu-php-xenial.list
dropbox.list                         ondrej-ubuntu-php-xenial.list.distUpgrade
dropbox.list.distUpgrade                 ondrej-ubuntu-php-xenial.list.save
dropbox.list.save                    skype-stable.list
google-chrome.list                   skype-stable.list.distUpgrade
google-chrome.list.distUpgrade               skype-stable.list.save
google-chrome.list.save                  teamviewer.list
nilarimogard-ubuntu-webupd8-xenial.list          teamviewer.list.distUpgrade
nilarimogard-ubuntu-webupd8-xenial.list.distUpgrade  teamviewer.list.save

答案1

更新
以下软件包具有未满足的依赖关系:

blueman : Depends: libpython3.6 (>= 3.6.0~b2) but it is not going to be installed

您只需要安装,python3.6而不是python3
尝试按照以下命令:

sudo apt-get purge python3.6
sudo apt-get autoremove && sudo apt-get autoclean
sudo apt-get install python3.6*

或者你有其他版本 3.5 / 3.7,你可以运行sudo apt-get install libpython3.6=3.6.0~b2

然后重新安装你的 blueman,sudo apt-get install --reinstall blueman

答案2

对于那些在对 Python3 进行了一些不道德的(对 Debian 而言)删除(并且没有正确使用)后仍然无法重新安装 Python3 的人apt-get remove python3,我提供了这个 100% 恢复步骤。

https://stackoverflow.com/a/58980420/4379130

答案3

最好避免清除python3.6(如其他答案所述)!这也会删除 gnome 和其他必需品。

检查一下你有什么 Python 东西:

apt list --installed | grep python

更具体地说,这可能有助于:

apt list --installed | grep python | grep xenial

例如,我必须删除来自 xenial 的内容:

sudo apt remove libpython3.6-minimal libpython3.6-stdlib python3.6-minimal

相关内容