Depends, python2.7-minimal (= 2.7.15_rc1-1) 问题解决方法使用 aptitude 安装以及与 apt-get 的区别
1. 問題現(xiàn)象
使用命令 sudo apt install python2.7 安裝 Python2 時(shí)報(bào)如下錯(cuò)誤
wohu@ubuntu1804:/etc/apt$ sudo apt install python2.7
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:python2.7 : Depends: python2.7-minimal (= 2.7.15~rc1-1) but it is not going to be installedDepends: libpython2.7-stdlib (= 2.7.15~rc1-1) but 2.7.17-1~18.04ubuntu1 is to be installed
E: Unable to correct problems, you have held broken packages.
2. 解決方案
2.1 安裝 aptitude
sudo apt-get install aptitude 
2.2 使用 aptitude 安裝 python2.7
sudo aptitude install python2.7
依次選擇 n,y, y
wohu@ubuntu1804:/etc/apt$ sudo aptitude install python2.7The following actions will resolve these dependencies:Keep the following packages at their current version:
1)     python2.7 [Not Installed]                          
2)     python2.7-minimal [Not Installed]                  Leave the following dependencies unresolved:         
3)     python2.7-minimal recommends python2.7             Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:Downgrade the following packages:                                            
1)     libpython2.7 [2.7.17-1~18.04ubuntu1 (now) -> 2.7.15~rc1-1 (bionic)]        
2)     libpython2.7-minimal [2.7.17-1~18.04ubuntu1 (now) -> 2.7.15~rc1-1 (bionic)]
3)     libpython2.7-stdlib [2.7.17-1~18.04ubuntu1 (now) -> 2.7.15~rc1-1 (bionic)] Accept this solution? [Y/n/q/?] y
The following packages will be DOWNGRADED:libpython2.7 libpython2.7-minimal libpython2.7-stdlib 
The following NEW packages will be installed:python2.7 python2.7-minimal{a} 
0 packages upgraded, 2 newly installed, 3 downgraded, 0 to remove and 34 not upgraded.
Need to get 4,826 kB of archives. After unpacking 4,105 kB will be used.
Do you want to continue? [Y/n/?] y
3. aptitude 與 apt-get 的區(qū)別
aptitude 與 apt-get 一樣,是 Debian 及其衍生系統(tǒng)中功能極其強(qiáng)大的包管理工具。與 apt-get 不同的是,aptitude 在處理依賴問題上更佳一些。
舉例來說,aptitude 在刪除一個(gè)包時(shí),會(huì)同時(shí)刪除本身所依賴的包。這樣,系統(tǒng)中不會(huì)殘留無用的包,整個(gè)系統(tǒng)更為干凈。
有的問題 apt-get 解決不了,必須使用 aptitude 解決,有的問題,用 aptitude 解決不了,必須使用 apt-get 。
-  aptitude解決得更好的地方:install,remove,reinstall(apt-get無此功能), show(apt-get無此功能), search(apt-get無此功能), hold(apt-get無此功能), unhold(apt-get無此功能),
-  apt-get解決得更好的地方: source(aptitude無此功能), build-dep (低版本的aptitude沒有build-dep功能)
-  apt-get跟aptitude沒什么區(qū)別的地方:update, upgrade (apt-get upgrade=aptitude safe-upgrade, apt-get dist-upgrade=aptitude full-upgrgade)
總結(jié)
以上是生活随笔為你收集整理的Depends, python2.7-minimal (= 2.7.15_rc1-1) 问题解决方法使用 aptitude 安装以及与 apt-get 的区别的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: 乌镇外地车限行规定
- 下一篇: Ubuntu 安装 CUDA 和 cuD
