我是 Ubuntu 新手。当我尝试使用命令执行软件包升级时,apt upgrade
我收到有关未满足依赖项的错误:
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:
libc6-dbg : Depends: libc6 (= 2.23-0ubuntu9) but 2.23-0ubuntu7 is installed
libc6-dev : Depends: libc6 (= 2.23-0ubuntu9) but 2.23-0ubuntu7 is installed
E: Unmet dependencies. Try using -f.
我也尝试执行建议的命令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:
dkms dleyna-server folks-common gir1.2-accountsservice-1.0 gir1.2-caribou-1.0 gir1.2-clutter-1.0
gir1.2-cogl-1.0 gir1.2-coglpango-1.0 gir1.2-gck-1 gir1.2-gcr-3 gir1.2-gdesktopenums-3.0
gir1.2-gdm-1.0 gir1.2-gkbd-3.0 gir1.2-gmenu-3.0 gir1.2-gnomebluetooth-1.0 gir1.2-gnomedesktop-3.0
gir1.2-gweather-3.0 gir1.2-mutter-3.0 gir1.2-networkmanager-1.0 gir1.2-nmgtk-1.0
gir1.2-polkit-1.0 gir1.2-telepathyglib-0.12 gir1.2-telepathylogger-0.2 gir1.2-upowerglib-1.0
gir1.2-xkl-1.0 gjs gnome-backgrounds gnome-contacts gnome-control-center-data gnome-icon-theme
gnome-icon-theme-symbolic gnome-online-accounts gnome-shell-common gnome-themes-standard-data
libcaribou-common libcaribou0 libchamplain-0.12-0 libcolord-gtk1 libdleyna-connector-dbus-1.0-1
libdleyna-core-1.0-3 libfolks-eds25 libfolks-telepathy25 libfolks25 libgjs0e libgoa-backend-1.0-1
libgsoap8 libgssdp-1.0-3 libgupnp-1.0-4 libgupnp-av-1.0-2 libgupnp-dlna-2.0-3
libmission-control-plugins0 libmozjs-24-0v5 libpython-all-dev libpython-dev libpython2.7-dev
libqt4-opengl libqt5x11extras5 libsdl1.2debian libtelepathy-logger3 libvncserver1
linux-headers-4.8.0-36 linux-headers-4.8.0-36-generic linux-headers-4.8.0-52
linux-headers-4.8.0-52-generic linux-image-4.8.0-36-generic linux-image-4.8.0-52-generic
linux-image-extra-4.8.0-36-generic linux-image-extra-4.8.0-52-generic
linux-signed-image-4.8.0-52-generic python-all python-all-dev python-dev python-pkg-resources
python-setuptools python-wheel python2.7-dev realmd snap-confine telepathy-mission-control-5
virtualbox-dkms
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
libc6 libc6:i386
Suggested packages:
glibc-doc glibc-doc:i386 locales:i386
The following packages will be upgraded:
libc6 libc6:i386
2 upgraded, 0 newly installed, 0 to remove and 55 not upgraded.
3 not fully installed or removed.
Need to get 5 703 kB of archives.
After this operation, 4 096 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ua.archive.ubuntu.com/ubuntu xenial-updates/main amd64 util-linux amd64 2.27.1-6ubuntu3.3 [849 kB]
Get:2 http://ua.archive.ubuntu.com/ubuntu xenial-updates/main i386 libc6 i386 2.23-0ubuntu9 [2 269 kB]
Get:3 http://ua.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libc6 amd64 2.23-0ubuntu9 [2 586 kB]
Fetched 5 703 kB in 0s (5 937 kB/s)
Preconfiguring packages ...
dpkg: error processing package util-linux (--configure):
package util-linux is not ready for configuration
cannot configure (current status 'half-installed')
Errors were encountered while processing:
util-linux
E: Sub-process /usr/bin/dpkg returned an error code (1)
我无法处理这个问题。请帮助我。
我尝试sudo apt autoremove
按照@Peshmerge 的建议先执行。以下是我得到的结果:
ybilash@ubuntu-machine:~$ sudo apt autoremove
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:
libc6-dbg : Depends: libc6 (= 2.23-0ubuntu9) but 2.23-0ubuntu7 is installed
libc6-dev : Depends: libc6 (= 2.23-0ubuntu9) but 2.23-0ubuntu7 is installed
E: Unmet dependencies. Try using -f.
ybilash@ubuntu-machine:~$ sudo apt -f autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
libc6 libc6:i386
Suggested packages:
glibc-doc glibc-doc:i386 locales:i386
The following packages will be upgraded:
libc6 libc6:i386
2 upgraded, 0 newly installed, 0 to remove and 101 not upgraded.
3 not fully installed or removed.
Need to get 0 B/5 703 kB of archives.
After this operation, 4 096 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
dpkg: error processing package util-linux (--configure):
package util-linux is not ready for configuration
cannot configure (current status 'half-installed')
Errors were encountered while processing:
util-linux
E: Sub-process /usr/bin/dpkg returned an error code (1)
命令存在同样的问题sudo apt-get install --reinstall util-linux
:
ybilash@ubuntu-machine:~$ sudo apt-get install --reinstall util-linux
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:
libc6-dbg : Depends: libc6 (= 2.23-0ubuntu9) but 2.23-0ubuntu7 is to be installed
libc6-dev : Depends: libc6 (= 2.23-0ubuntu9) but 2.23-0ubuntu7 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
ybilash@ubuntu-machine:~$ 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:
libc6 libc6:i386
Suggested packages:
glibc-doc glibc-doc:i386 locales:i386
The following packages will be upgraded:
libc6 libc6:i386
2 upgraded, 0 newly installed, 0 to remove and 101 not upgraded.
3 not fully installed or removed.
Need to get 0 B/5 703 kB of archives.
After this operation, 4 096 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
dpkg: error processing package util-linux (--configure):
package util-linux is not ready for configuration
cannot configure (current status 'half-installed')
Errors were encountered while processing:
util-linux
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
该软件包util-linux
已安装一半,因此您必须使用此命令重新安装它
sudo apt-get install --reinstall util-linux
更新
如果上述解决方案不起作用。
- 运行
apt-cache show util-linux
以获取系统上软件包的当前版本。 - 从以下位置下载相同版本的软件包发射台。
- 使用安装下载的软件包
sudo dpkg -i [package-name]