原本打算安装 libgtk2.0-dev 包,报错(依赖: libgtk2.0-dev (>= 2.27.3) 但是它将不会被安装,E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系):
直觉告诉我们,需要对这些依赖包一个一个解决,一旦全部装上之后,就可以装 libgtk2.0-dev 包了,然而,现实却是,libglib2.0-dev也不能安装,产生了类似上图的错误信息(没有对应的截图)。有网友提供给出的解决方案是,编辑 /etc/apt/sources.list,注释掉所有的非官方源,只保留官方源,重新:
sudo apt-get update
sudo apt-get install libgtk2.0-dev
成功安装!
附上 Ubuntu 14.04 的标准官方源,一旦出现问题,可以用这个来恢复:
deb http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
##测试版源
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
# 源码
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
##测试版源
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
# Canonical 合作伙伴和附加
#deb http://archive.canonical.com/ubuntu/ trusty partner
#deb http://extras.ubuntu.com/ubuntu/ trusty main