无法使用 apt-get 安装任何东西

无法使用 apt-get 安装任何东西

例如当我尝试时:

sudo apt-get install gparted

我收到以下错误:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
gparted is already the newest version (0.25.0-1).
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 libpcap0.8 : Breaks: libpcap0.8:i386 (!= 1.7.4-2) but 1.4.0-2 is to be installed
 libpcap0.8:i386 : Breaks: libpcap0.8 (!= 1.4.0-2) but 1.7.4-2 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

(是的,我知道 GParted 已经安装好了。这只是一个例子)。Ubuntu 尝试帮助我并建议使用sudo apt-get -f install。但是当我尝试时:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  libpcap0.8:i386
The following packages will be upgraded:
  libpcap0.8:i386
1 upgraded, 0 newly installed, 0 to remove and 110 not upgraded.
2 not fully installed or removed.
Need to get 0 B/121 kB of archives.
After this operation, 20,5 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 219902 files and directories currently installed.)
Preparing to unpack .../libpcap0.8_1.7.4-2_i386.deb ...
Unpacking libpcap0.8:i386 (1.7.4-2) over (1.4.0-2) ...
dpkg: error processing archive /var/cache/apt/archives/libpcap0.8_1.7.4-2_i386.deb (--unpack):
 trying to overwrite shared '/usr/share/doc/libpcap0.8/CREDITS.gz', which is different from other instances of package libpcap0.8:i386
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Processing triggers for libc-bin (2.23-0ubuntu5) ...
Errors were encountered while processing:
 /var/cache/apt/archives/libpcap0.8_1.7.4-2_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

任何帮助,将不胜感激。

答案1

似乎你还没有完全安装 2 个包...也许

sudo dpkg --configure -a 

将为您完成工作

答案2

我只遇到过几次这样的问题,每次我都可以通过打开软件与更新在第一个选项卡上Ubuntu 软件转变下载自(例如美国的服务器)。关闭并选择重新加载软件源列表后(关闭时询问软件与更新) 它又能正常工作了。

可能是损坏的软件源列表,只需切换服务器即可修复。可能值得一试,并且可以毫无风险地更改(并改回)。

祝你好运!

相关内容