我无法在 ubuntu 上安装任何东西,并且顶行出现系统错误(这个带有白线的红色圆圈),当我想使用更新修复此问题时,我得到:
Can't install 'ubuntu-desktop'
It was impossible to install a required package. Please report this as a bug using 'ubuntu-bug ubuntu-release-upgrader-core' in a terminal.
当我尝试安装某些东西时我总是得到:
The following packages have unmet dependencies:
libjpeg8 : Depends: libjpeg-turbo8 (>= 1.1.90+svn722-1ubuntu6) but it is not going to be installed
libjpeg8-dev : Depends: libjpeg8 (= 8d-1+deb7u1) but 8c-2ubuntu8 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
当我输入时,sudo apt-get update
我得到:
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/
当我输入sudo apt-get -f install
The following package was automatically installed and is no longer required:
libjpeg-turbo8
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
libjpeg8
The following packages will be upgraded:
libjpeg8
1 upgraded, 0 newly installed, 0 to remove and 58 not upgraded.
73 not fully installed or removed.
Need to get 0 B/138 kB of archives.
After this operation, 267 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
WARNING: The following packages cannot be authenticated!
libjpeg8
Install these packages without verification? [y/N] n
E: Some packages could not be authenticated
当我选择无需验证安装(y)时,我得到:
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.4.2-0ubuntu3
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
我正在使用 Xenial 16.04 amd64 Ubuntu
感谢帮助 ;)
答案1
我遇到了类似的情况。Ubuntu 存储库中的 libjpeg8 包与 Debian 存储库中同名的包发生冲突。以下是 apt-cache 的输出,显示了发生冲突的包:
apt-cache show libjpeg8
Package: libjpeg8
Version: 8d-1+deb7u1
Installed-Size: 287
Maintainer: Bill Allombert <[email protected]>
Architecture: amd64
Depends: libc6 (>= 2.7)
Pre-Depends: multiarch-support
Description-en: Independent JPEG Group's JPEG runtime library
The Independent JPEG Group's JPEG library is a library for handling
JPEG files.
.
This package contains the shared library.
Description-md5: 4ca10faa4517c5d362c9d51d75d7a85c
Multi-Arch: same
Tag: implemented-in::c, role::shared-lib
Section: libs
Priority: optional
Filename: pool/main/libj/libjpeg8/libjpeg8_8d-1+deb7u1_amd64.deb
Size: 137708
MD5sum: 93e9da26d8ebe1a6c09e15b4276ccce7
SHA1: aff2208366f95d286da91b81d27d65e834d0d692
SHA256: 70dee072e3d06d9977fc1c495d4336991e16a91d43ce9678f4f24ae719b780c5
Package: libjpeg8
Priority: optional
Section: libs
Installed-Size: 26
Maintainer: Ubuntu Developers <[email protected]>
Architecture: amd64
Source: libjpeg8-empty
Version: 8c-2ubuntu8
Depends: libjpeg-turbo8 (>= 1.1.90+svn722-1ubuntu6)
Filename: pool/main/libj/libjpeg8-empty/libjpeg8_8c-2ubuntu8_amd64.deb
Size: 2194
MD5sum: e0f16286dd787b951ffa953987fdf6a7
SHA1: 50f0a11ba80717e17b8485567ee1be76b744ce8f
SHA256: baaecbc8e7ef55fc1887365721a7771f7d533fabca38fca878668b9c8f7ee13f
Description-en: Independent JPEG Group's JPEG runtime library (dependency package)
libjpeg8 dependency package, depending on libjpeg-turbo8.
Description-md5: c291a11286499ba1bdfddf14d8af677b
Multi-Arch: same
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 5y
Task: virt-host, ubuntu-desktop, ubuntu-usb, print-server, tomcat-server, kubuntu-desktop, edubuntu-desktop, edubuntu-usb, xubuntu-core, xubuntu-desktop, mythbuntu-frontend, mythbuntu-desktop, mythbuntu-backend-slave, mythbuntu-backend-master, lubuntu-core, ubuntustudio-desktop-core, ubuntustudio-desktop, ubuntu-gnome-desktop, ubuntu-sdk-libs, ubuntu-touch, ubuntukylin-desktop, ubuntu-mate-core, ubuntu-mate-desktop, ubuntu-mate-cloudtop
检查您的 Apt 源文件,如果看到其中提到的 Debian 存储库,请将其注释掉并尝试再次更新。
打开终端并运行以下命令:
# Create a backup of the original file
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bu
sudo nano /etc/apt/sources.list
查找以下行:
deb http://ftp.debian.org/debian/ wheezy main
通过在开头添加井号 (#) 将其注释掉,使其变成:
# deb http://ftp.debian.org/debian/ wheezy main
按 CTRL-O 保存文件,然后按 CTRL+X 退出。
再次运行更新/升级过程:
sudo apt-get update
sudo apt-get upgrade