①The following packages have unmet dependencies:
aptitude : Depends: libapt-pkg5.0 (>= 1.1) but it is not going to be installed
Recommends: libparse-debianchangelog-perl but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
②sudo apt-get install aptitude安装包报错:The following packages have unmet dependencies
我按照此教程:为树莓派更换国内镜像源,更换树莓派镜像源为国内的 清华源 后,在使用 sudo apt-get install aptitude 时,出现依赖包错误的问题,具体错误信息如下:
pi@raspberrypi:~ $ sudo apt-get install aptitude- 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:
- aptitude : Depends: libapt-pkg5.0 (>= 1.1) but it is not going to be installed
- Recommends: libparse-debianchangelog-perl but it is not going to be installed
- E: Unable to correct problems, you have held broken packages.
当出现此错误的时候,我也是找了很久,还去论坛上发帖求助(论坛传送门:树莓派更换清华源,安装aptitude报错),但是都没有得到有用的答案。
经过不懈的查找原因,终于在一篇文章中发现了些许端倪,文章链接:树莓派失败到放弃!,相关信息截图如下:
看到这里,我突然想到,我自己就是在网上百度一个换源的方法,直接就用了,也没管是哪个版本,好了,那么原因应该就是这个。
首先我使用命令: lsb_release -a ,查看当前树莓派系统版本,具体信息如下,此版本的代号为 “buster”
pi@raspberrypi:~ $ lsb_release -a- No LSB modules are available.
- Distributor ID: Raspbian
- Description: Raspbian GNU/Linux 10 (buster)
- Release: 10
- Codename: buster
然后我去看了一下使用镜像源的地址,使用的版本代号为 “stretch” ,如下
deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi- deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi

于是,我去对应文件,把 stretch 修改为 buster ,大功告成✌️✌️✌️!
修改完毕后,记得执行如下命令,更新软件源列表!
sudo apt-get update- sudo apt-get upgrade
此时,应该会有很多东西需要更新,慢慢等待即可,国内镜像源网速还是挺好的;
更新完毕之后,即可再次安装 aptitude ,使用如下命令:
sudo apt-get install aptitude
大功告成✌️✌️✌️,我终于解决了这个该死的问题,希望对你有所帮助!