我遇到错误“apt-get -f install”,请帮我修复它

我遇到错误“apt-get -f install”,请帮我修复它

所以上次我有点破坏了我的 Ubuntu 服务器并且出现了以下错误,我想说我删除了一些东西libjpeg8:i386,现在我无法安装任何软件包!

root@s1:~# apt-get install php-apc 
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:  
libgd3:i386 : Depends: libjpeg8:i386 (>= 8c) but it is not going to be installed  
libgphoto2-6:i386 : Depends: libjpeg8:i386 (>= 8c) but it is not going to be installed  
libsane:i386 : Depends: libjpeg8:i386 (>= 8c) but it is not going to be installed  
libtiff5:i386 : Depends: libjpeg8:i386 (>= 8c) but it is not going to be installed  
libv4lconvert0:i386 : Depends: libjpeg8:i386 (>= 8c) but it is not going to be installed  
php-apc : Depends: php5-apcu but it is not going to be installed 
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

root@s1:~# 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:
  libjpeg8:i386
The following NEW packages will be installed:
  libjpeg8:i386
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
11 not fully installed or removed.
Need to get 0 B/2,188 B of archives.
After this operation, 26.6 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 247834 files and directories currently installed.)
Preparing to unpack .../libjpeg8_8c-2ubuntu8_i386.deb ...
Unpacking libjpeg8:i386 (8c-2ubuntu8) ...
dpkg: error processing archive /var/cache/apt/archives/libjpeg8_8c-2ubuntu8_i386.deb (--unpack):
 trying to overwrite shared '/usr/share/doc/libjpeg8/copyright', which is different from other instances of package libjpeg8:i386
Errors were encountered while processing:
 /var/cache/apt/archives/libjpeg8_8c-2ubuntu8_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

这解决了我的问题,很抱歉打扰你们,感谢大家的支持!

sudo dpkg -i --force-overwrite /var/cache/apt/archives/var/cache apt/archives/libjpeg8_8c-2ubuntu8_i386.deb 

运行以下命令检查所有问题是否解决:

sudo apt-get -f install

如果仍然有问题,请重新运行第一步,并保留任何 dpkg:错误处理(...)

相关内容