错误 sudo apt-get install -f

错误 sudo apt-get install -f
(Reading database ... 152963 files and directories currently installed.)
Preparing to unpack .../libjpeg8_8d-1+deb7u1_amd64.deb ...
Unpacking libjpeg8:amd64 (8d-1+deb7u1) over (8c-2ubuntu8) ...
dpkg: error processing archive /var/cache/apt/archives/libjpeg8_8d-1+deb7u1_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/libjpeg.so.8', which is also in package libjpeg-turbo8:amd64 1.3.0-0ubuntu2  
Errors were encountered while processing: /var/cache/apt/archives/libjpeg8_8d-1+deb7u1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

我猜您正在尝试安装该libjpeg8软件包,但是您已经安装了另一个版本(可能是旧的?)libjpeg8

因此,您可以尝试删除已安装的版本并重新安装较新的版本,或者dpkg通过以下方式强制覆盖冲突的文件:

sudo dpkg -i --force-overwrite /var/cache/apt/archives/libjpeg8_8d-1+deb7u1_amd64.deb

运行sudo apt-get install -f检查一切是否正常。

相关内容