[Solved] Error while upgrading package "util-linux"

Moderators: odroid, mdrjr

[Solved] Error while upgrading package "util-linux"

Unread postby Jojo » Mon May 28, 2018 4:35 pm

Hi,

lately I got notified by the Software Updater, that a bunch of upgrade were available. I left all of them marked to be installed, but the upgrade process failed.
I I tried to upgrade again manually by "apt-get update" and "apt-get upgrade". Here is where it fails:
Code: Select all
odroid@odroid-vu8c:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  libharfbuzz-icu0 linux-tools-generic
The following packages will be upgraded:
  chromium-browser chromium-codecs-ffmpeg-extra libblkid1 libcurl3
  libcurl3-gnutls libfdisk1 libldap-2.4-2 libmount1 libpoppler-glib8
  libpoppler58 libprocps4 libsmartcols1 libuuid1 linux-firmware linux-libc-dev
  linux-tools-common mount poppler-utils procps snapd xdg-utils
  xul-ext-calendar-timezones
22 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
1 not fully installed or removed.
Need to get 46.7 MB/112 MB of archives.
After this operation, 10.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ports.ubuntu.com/ubuntu-ports xenial-updates/universe arm64 chromium-browser arm64 66.0.3359.181-0ubuntu0.16.04.1 [45.7 MB]
Get:2 http://ports.ubuntu.com/ubuntu-ports xenial-updates/universe arm64 chromium-codecs-ffmpeg-extra arm64 66.0.3359.181-0ubuntu0.16.04.1 [900 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports xenial-proposed/main arm64 libldap-2.4-2 arm64 2.4.42+dfsg-2ubuntu3.3 [134 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports xenial-updates/universe arm64 xul-ext-calendar-timezones arm64 1:52.8.0+build1-0ubuntu0.16.04.1 [9,288 B]
Fetched 46.7 MB in 1min 6s (700 kB/s)                                         
Setting up util-linux (2.27.1-6ubuntu3.6) ...
update-alternatives: error: /var/lib/dpkg/alternatives/pager corrupt: invalid status
dpkg: error processing package util-linux (--configure):
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
 util-linux
E: Sub-process /usr/bin/dpkg returned an error code (1)
odroid@odroid-vu8c:~$


Then I did "apt-get install -f" which I thought would help sometimes:
Code: Select all
odroid@odroid-vu8c:~$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 24 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up util-linux (2.27.1-6ubuntu3.6) ...
update-alternatives: error: /var/lib/dpkg/alternatives/pager corrupt: invalid status
dpkg: error processing package util-linux (--configure):
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
 util-linux
E: Sub-process /usr/bin/dpkg returned an error code (1)


Actually I am at a point, where I can't fix this by myself. Could anyone please help me with this? I am running the official HK Ubuntu image.

Thanks a lot,
Jojo
Last edited by Jojo on Tue May 29, 2018 4:38 pm, edited 1 time in total.
How to ask questions the smart way:
http://www.catb.org/esr/faqs/smart-questions.html
Jojo
 
Posts: 524
Joined: Mon May 18, 2015 12:13 am
Location: Germany
languages_spoken: english, german
ODROIDs: C1, C1+, C2, HC1, HC2, VU8C

Re: Error while upgrading package "util-linux"

Unread postby meveric » Mon May 28, 2018 10:21 pm

you might want to check what /var/lib/dpkg/alternatives/pager is and what it does to fail should be a text file maybe it got damaged/corrupted.
You should also be able to find the post install script of util-linux under /var/lib/dpkg/info/util-linux.postinst and can try to run it with bash -x to see on which command it stops.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 9454
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go

Re: Error while upgrading package "util-linux"

Unread postby Jojo » Tue May 29, 2018 4:54 am

Hi meveric and think you for your help!

I've found the /var/lib/dpkg/alternatives/pager file. It is a text file, which contains the following:
Code: Select all
odroid@odroid-vu8c:/var/lib/dpkg/alternatives$ cat pager
Package: logrotate
Status: install ok unpacked
Priority: important
Section: admin
Installed-Size: 108
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: arm64
Version: 3.8.7-2ubuntu2.16.04.2
Config-Version: 3.8.7-2ubuntu2
Depends: libacl1 (>= 2.2.51-8), libc6 (>= 2.17), libpopt0 (>= 1.14), libselinux1 (>= 1.32), cron | anacron | cron-daemon, base-passwd (>= 2.0.3.4)
Suggests: mailx
Breaks: postgresql-common (<= 126)
Conffiles:
 /etc/cron.daily/logrotate da9c29ed0b408ffd88d05c3d8e881e94
 /etc/logrotate.conf 4316e462f3c800bebcf43aa9d4fcf4b0
Description: Log rotation utility
 The logrotate utility is designed to simplify the administration of
 log files on a system which generates a lot of log files.  Logrotate
 allows for the automatic rotation compression, removal and mailing of
 log files.  Logrotate can be set to handle a log file daily, weekly,
 monthly or when the log file gets to a certain size.  Normally, logrotate
 runs as a daily cron job.
Homepage: https://fedorahosted.org/logrotate/
Original-Maintainer: Paul Martin <pm@debian.org>
odroid@odroid-vu8c:/var/lib/dpkg/alternatives$


And here is what I get, when I try to run the postinst script from the shell manually:
Code: Select all
odroid@odroid-vu8c:/var/lib/dpkg/info$ sudo bash -x util-linux.postinst [sudo] password for odroid:
+ set -e
+ update-alternatives --install /usr/bin/pager pager /bin/more 50 --slave /usr/share/man/man1/pager.1.gz pager.1.gz /usr/share/man/man1/more.1.gz
update-alternatives: error: /var/lib/dpkg/alternatives/pager corrupt: invalid status
odroid@odroid-vu8c:/var/lib/dpkg/info$


Does this help anyhow?

Greetings!
How to ask questions the smart way:
http://www.catb.org/esr/faqs/smart-questions.html
Jojo
 
Posts: 524
Joined: Mon May 18, 2015 12:13 am
Location: Germany
languages_spoken: english, german
ODROIDs: C1, C1+, C2, HC1, HC2, VU8C

Re: Error while upgrading package "util-linux"

Unread postby meveric » Tue May 29, 2018 10:56 am

the pager file is broken.
It should look something like this:
Code: Select all
auto
/usr/bin/pager
pager.1.gz
/usr/share/man/man1/pager.1.gz

/bin/less
77
/usr/share/man/man1/less.1.gz
/bin/more
50
/usr/share/man/man1/more.1.gz


You have the info of the "logrotate" package inside the pager file, so that file is clearly broken. Sadly I'm not sure what provides the file /var/lib/dpkg/alternatives/pager in the first place, you can try putting the text in there from my file, maybe it works.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 9454
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go

Re: Error while upgrading package "util-linux"

Unread postby Jojo » Tue May 29, 2018 4:37 pm

Hi meveric,

thanks a ton! Replacing the content of "my" pager file with the content of "your" pager file seemed to fix it. I was able to run the whole update/upgrade/dist-upgrade process again without any errors :) .

Greetings!
How to ask questions the smart way:
http://www.catb.org/esr/faqs/smart-questions.html
Jojo
 
Posts: 524
Joined: Mon May 18, 2015 12:13 am
Location: Germany
languages_spoken: english, german
ODROIDs: C1, C1+, C2, HC1, HC2, VU8C


Return to Issues

Who is online

Users browsing this forum: No registered users and 2 guests