我无法修复从 Ubuntu 12.04 升级到 14.04.1(apt-get dist-upgrade)时发生的问题。我快疯了。
从日志复制:
>Start-Date: 2014-12-17 18:39:01
>Commandline: apt-get dist-upgrade
>Install: [..] libboost-graph-dev:amd64 (1.48.0.2), klogd:amd64 (1.5-6ubuntu1)
>Error: Sub-process /usr/bin/dpkg returned an error code (1)
>End-Date: 2014-12-17 18:40:19
Start-Date: 2014-12-17 18:41:51
Commandline: apt-get -f install
Upgrade: glib-networking-common:amd64 (2.32.1-1ubuntu2, 2.40.0-1), gvfs-common:amd64 (1.12.1-0ubuntu1.2, 1.20.1-1ubuntu1), libc6-dev:amd64 (2.15-0ubuntu15~ppa1, 2.19-0ubuntu6.4), gvfs:i386 (1.12.1-0ubuntu1.2, 1.20.1-1ubuntu1), libc-dev-bin:amd64 (2.15-0ubuntu15~ppa1, 2.19-0ubuntu6.4), glib-networking-services:amd64 (2.32.1-1ubuntu2, 2.40.0-1), libc6:amd64 (2.15-0ubuntu15~ppa1, 2.19-0ubuntu6.4), libc6:i386 (2.15-0ubuntu15~ppa1, 2.19-0ubuntu6.4), gvfs-daemons:amd64 (1.12.1-0ubuntu1.2, 1.20.1-1ubuntu1)
Error: Sub-process /usr/bin/dpkg returned an error code (1)
End-Date: 2014-12-17 18:41:55
实际上我无法升级、安装或删除,因为会出现以下错误:
~# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
glib-networking:i386 : Depends: glib-networking-services:i386 (>= 2.40.0-1)
Depends: glib-networking-common:i386 (= 2.40.0-1)
gvfs:i386 : Depends: gvfs-libs:i386 (= 1.12.1-0ubuntu1.2) but 1.20.1-1ubuntu1 is installed
gvfs-daemons : Depends: gvfs-libs (= 1.12.1-0ubuntu1.2) but 1.20.1-1ubuntu1 is installed
Recommends: policykit-1-gnome but it is not installed
Recommends: gvfs but it is not installed
gvfs-libs : Depends: gvfs-common (= 1.20.1-1ubuntu1) but 1.12.1-0ubuntu1.2 is installed
gvfs-libs:i386 : Depends: gvfs-common:i386 (= 1.20.1-1ubuntu1)
libc-dev-bin : Depends: libc6 (> 2.19) but 2.15-0ubuntu15~ppa1 is installed
libc6-dev : Depends: libc6 (= 2.19-0ubuntu6.4) but 2.15-0ubuntu15~ppa1 is installed
libglib2.0-0 : Depends: libc6 (>= 2.17) but 2.15-0ubuntu15~ppa1 is installed
libglib2.0-0:i386 : Depends: libc6:i386 (>= 2.17) but 2.15-0ubuntu15~ppa1 is installed
libudev1 : Depends: libc6 (>= 2.17) but 2.15-0ubuntu15~ppa1 is installed
libudev1:i386 : Depends: libc6:i386 (>= 2.17) but 2.15-0ubuntu15~ppa1 is installed
E: Unmet dependencies. Try using -f.
添加 -f 后,与上一个错误唯一的区别如下:
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies
我发现有较旧的 PPA,并且我对其进行了更新:
deb http://it.archive.ubuntu.com/ubuntu/ utopic main
deb-src http://it.archive.ubuntu.com/ubuntu/ utopic main
deb http://security.ubuntu.com/ubuntu utopic-security main
deb-src http://security.ubuntu.com/ubuntu utopic-security main
#deb http://it.archive.ubuntu.com/ubuntu/ utopic-updates main universe restricted multiverse
#deb-src http://it.archive.ubuntu.com/ubuntu/ utopic-updates main universe restricted multiverse
因此,我对根据 dpkg --configure -a 产生错误的每个数据包使用了以下命令:
echo "libc6-dev hold" | dpkg --set-selections
结果如下:
# dpkg --get-selections | grep hold
desktop-file-utils hold
glib-networking:i386 hold
gvfs-libs hold
gvfs-libs:i386 hold
libc-dev-bin hold
libc6-dev hold
libgcrypt11-dev hold
libglib2.0-0 hold
libglib2.0-0:i386 hold
libglib2.0-bin hold
libglib2.0-dev hold
libgnutls-dev hold
libpcre3-dev hold
libpolkit-agent-1-0 hold
libpolkit-gobject-1-0 hold
libsecret-1-0 hold
libsecret-1-0:i386 hold
libudev1 hold
libudev1:i386 hold
libudisks2-0 hold
udisks2 hold
但是,我再次遇到了升级、安装和删除的一些问题。这是我发现的唯一“奇怪”的输出:
# apt-get remove libc6-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
build-essential : Depends: libc6-dev but it is not going to be installed or
libc-dev
comerr-dev : Depends: libc6-dev but it is not going to be installed or
libc-dev
e2fslibs-dev : Depends: libc6-dev but it is not going to be installed or
libc-dev
glib-networking:i386 : Depends: glib-networking-services:i386 (>= 2.40.0-1)
Depends: glib-networking-common:i386 (= 2.40.0-1)
gvfs:i386 : Depends: gvfs-libs:i386 (= 1.12.1-0ubuntu1.2) but 1.20.1-1ubuntu1 is to be installed
gvfs-daemons : Depends: gvfs-libs (= 1.12.1-0ubuntu1.2) but 1.20.1-1ubuntu1 is to be installed
Recommends: policykit-1-gnome but it is not going to be installed
Recommends: gvfs but it is not going to be installed
gvfs-libs : Depends: gvfs-common (= 1.20.1-1ubuntu1) but 1.12.1-0ubuntu1.2 is to be installed
gvfs-libs:i386 : Depends: gvfs-common:i386 (= 1.20.1-1ubuntu1)
libblkid-dev : Depends: libc6-dev but it is not going to be installed or
libc-dev
libbz2-dev : Depends: libc6-dev but it is not going to be installed or
libc-dev
libc-dev-bin : Depends: libc6 (> 2.19) but 2.15-0ubuntu15~ppa1 is to be installed
libcurl4-gnutls-dev : Depends: libc6-dev but it is not going to be installed or
libc-dev
libexif-dev : Depends: libc6-dev but it is not going to be installed
libexpat1-dev : Depends: libc6-dev but it is not going to be installed or
libc-dev
libfreetype6-dev : Depends: libc6-dev but it is not going to be installed or
libc-dev
libgcrypt11-dev : Depends: libc6-dev but it is not going to be installed or
libc-dev
libglib2.0-0 : Depends: libc6 (>= 2.17) but 2.15-0ubuntu15~ppa1 is to be installed
libglib2.0-0:i386 : Depends: libc6:i386 (>= 2.17) but 2.15-0ubuntu15~ppa1 is to be installed
libgnutls-dev : Depends: libc6-dev but it is not going to be installed or
libc-dev
libicu-dev : Depends: libc6-dev but it is not going to be installed or
libc-dev
libjpeg-turbo8-dev : Depends: libc-dev
libpcre3-dev : Depends: libc6-dev but it is not going to be installed
libsasl2-dev : Depends: libc6-dev but it is not going to be installed
libstdc++6-4.6-dev : Depends: libc6-dev (>= 2.13-0ubuntu6) but it is not going to be installed
libtiff4-dev : Depends: libc6-dev but it is not going to be installed or
libc-dev
libtool : Depends: libc6-dev but it is not going to be installed or
libc-dev
libudev1 : Depends: libc6 (>= 2.17) but 2.15-0ubuntu15~ppa1 is to be installed
libudev1:i386 : Depends: libc6:i386 (>= 2.17) but 2.15-0ubuntu15~ppa1 is to be installed
libxft-dev : Depends: libc6-dev but it is not going to be installed or
libc-dev
uuid-dev : Depends: libc6-dev but it is not going to be installed or
libc-dev
zlib1g-dev : Depends: libc6-dev but it is not going to be installed or
libc-dev
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
我希望有人能帮助我,我不想格式化 :/ 干杯
答案1
您似乎拥有来自 ppas 的 libc6、udev 等。您有吗?对于来自 ubuntu 之外的人来说,这些太基础了。
我希望你必须删除这些 ppa(来自 sources.list 等),然后重试
答案2
你试过
- 清除 apt 缓存
apt-get clean
- 清除错误信息
- 编辑您的源列表文件。
vi /etc/apt/sources.list
源列表文件更改后运行
apt-get update
然后尝试升级/安装软件包
答案3
还有一件事要尝试,那就是升级冲突的核心软件包。那就是尝试
$ sudo apt-get upgrade libc6 libc6-dev libc-dev udev
这可能会给你一个将要删除的软件包列表。 重要的是,此列表包含来自 ppas 的软件包,而不是上述核心软件包
[顺便说一句,如果你安装了 synaptic 和/或 aptitude,它会有所帮助。如果没有,不知道现在如何安装,处于损坏状态 :-( ]
更新
刚刚发现 这里 您可以尝试使用此 awk 命令列出您的过时/本地包
awk '/^Package: / {print $2}' /var/lib/dpkg/status | sort |
(awk '/^Package: / {print $2}' /var/lib/apt/lists/*_Packages | sort |
comm -23 --nocheck-order /dev/fd/3 -) 3<&0
您从中获取的列表可能是有问题的软件包列表