0

I'm new to Ubuntu. When I'm trying to perform upgrade of packages using command apt upgrade I'm getting the error about unmet dependencies:

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.

I also tried to execute suggesting command apt-get -f install but in this time I faces with following error:

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)

I can't manage myself with it. Please help.

I tried to execute sudo apt autoremove first like @Peshmerge suggested. Here what I've got:

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)

The same issue with sudo apt-get install --reinstall util-linux command:

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 Answers1

1

The package util-linux is half-installed, so you have to reinstall it using this command

sudo apt-get install --reinstall util-linux

Update

If the mentioned solution doesn't work.

  1. Run apt-cache show util-linux to get the current version of the package on your system.
  2. Download the package with the same version from Launchpad.
  3. Install the downloaded package using sudo dpkg -i [package-name]

Thanks to fidel150992

Peshmerge
  • 688
  • Please see my updates – fidel150992 Jul 23 '17 at 07:47
  • Please check this, be careful when running remove command https://askubuntu.com/questions/490671/fix-half-installed-package – Peshmerge Jul 23 '17 at 07:57
  • I can't remove util-linux using 'sudo dpkg --remove --force-remove-reinstreq --dry-run util-linux', seams it's important package for system that I can't remove. The error: dpkg: error processing package util-linux (--remove): this is an essential package; it should not be removed Errors were encountered while processing: util-linux – fidel150992 Jul 23 '17 at 08:20
  • Indeed, sorry for my bad suggestion. Try to download the package util-linux and install it manually. – Peshmerge Jul 23 '17 at 08:23
  • 1
    Bingo, it works :) Thanks so much for your efforts. I executed command 'apt-cache show util-linux' to get version of my package, downloaded the same version of it from https://launchpad.net/ubuntu/xenial/amd64/util-linux/2.27.1-6ubuntu3.3 and manually installed it using command 'sudo dpkg -i util-linux_2.27.1-6ubuntu3.3_amd64.deb' – fidel150992 Jul 23 '17 at 08:44