无法升级 Ubuntu 14.04 或在其上安装新应用程序

无法升级 Ubuntu 14.04 或在其上安装新应用程序

我无法升级 Ubuntu 14.04 或安装任何新软件,因为我总是收到以下错误:

Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 libc6-dev : Depends: linux-libc-dev but it is not going to be installed
 libnss3 : Breaks: libnss3:i386 (!= 2:3.19.2-1ubuntu1) but 2:3.26.2-0ubuntu0.14.04.3 is to be installed
 libnss3:i386 : Breaks: libnss3 (!= 2:3.26.2-0ubuntu0.14.04.3) but 2:3.19.2-1ubuntu1 is to be installed
 libnss3-nssdb : Depends: libnss3 (= 2:3.26.2-0ubuntu0.14.04.3) but 2:3.19.2-1ubuntu1 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

我尝试跑步

sudo apt-get -f install

但它不起作用,因为我在输出中收到以下错误:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  account-plugin-windows-live kde-l10n-ar kde-l10n-engb libntdb1 libupstart1
  linux-headers-3.16.0-30 linux-headers-3.16.0-30-generic
  linux-image-3.16.0-30-generic linux-image-extra-3.16.0-30-generic
  python-ntdb python-pexpect python-renderpm python-reportlab
  python-reportlab-accel
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libnss3
The following packages will be upgraded:
  libnss3
1 upgraded, 0 newly installed, 0 to remove and 146 not upgraded.
3 not fully installed or removed.
Need to get 1,126 kB of archives.
After this operation, 30.7 kB disk space will be freed.
Do you want to continue? [Y/n] Y
Get:1 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libnss3 amd64 2:3.26.2-0ubuntu0.14.04.3 [1,126 kB]
Fetched 1,126 kB in 5s (214 kB/s)    
(Reading database ... 292354 files and directories currently installed.)
Preparing to unpack .../libnss3_2%3a3.26.2-0ubuntu0.14.04.3_amd64.deb ...
Unpacking libnss3:amd64 (2:3.26.2-0ubuntu0.14.04.3) over (2:3.19.2-1ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/libnss3_2%3a3.26.2-0ubuntu0.14.04.3_amd64.deb (--unpack):
 trying to overwrite shared '/usr/share/doc/libnss3/changelog.Debian.gz', which is different from other instances of package libnss3:amd64
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/libnss3_2%3a3.26.2-0ubuntu0.14.04.3_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

编辑:顶部状态栏中时钟旁边出现一个错误图标,其中包含文本

发生错误,请从右键菜单运行包管理器或在终端中运行 apt-get 来查看错误所在。错误消息为:“错误:Brokencount > 0”。这通常意味着您安装的包有未满足的依赖关系。

点击显示更新在这个图标菜单中我得到了窗口(新的重要安全和硬件支持更新。

警告:您当前硬件启用堆栈的安全更新已于 2016-08-04 结束http://wiki.ubuntu.com/1404_HWE_EOL

通过尝试单击此窗口上的“安装”,它仍然会显示安装错误。

我该如何修复我的系统以便能够升级?

答案1

错误消息中解释了该问题:

dpkg: error processing archive /var/cache/apt/archives/libnss3_2%3a3.26.2-0ubuntu0.14.04.3_amd64.deb (--unpack):
 trying to overwrite shared '/usr/share/doc/libnss3/changelog.Debian.gz', which is different from other instances of package libnss3:amd64

这是一个罕见的错误,并且可能有多种原因。如果此错误频繁出现,则不要反复修复它 - 您必须调查和修复更深层次的问题。

怎么修:由于您可能没有使用更改日志文件,请尝试重命名它。如果安装成功,您可以安全地删除它。

sudo mv /usr/share/doc/libnss3/changelog.Debian.gz /usr/share/doc/libnss3/changelog.Debian.gz.bak
sudo apt-get upgrade
sudo apt-get -f install
sudo rm /usr/share/doc/libnss3/changelog.Debian.gz.bak

如果您在此过程中遇到任何错误消息,停止

相关内容