Can't update OSMC

If I try from OSMC it says can’t update libc-2.19-17 please report.

If I try from command line “sudo apt-get update && sudo apt-get dist-upgrade” I get…

Preparing to unpack …/libc6-dev_2.19-17_armhf.deb …
Unpacking libc6-dev:armhf (2.19-17) over (2.19-15) …
Preparing to unpack …/libc-dev-bin_2.19-17_armhf.deb …
Unpacking libc-dev-bin (2.19-17) over (2.19-15) …
Preparing to unpack …/libc-bin_2.19-17_armhf.deb …
Unpacking libc-bin (2.19-17) over (2.19-15) …
Setting up libc-bin (2.19-17) …
(Reading database … 36796 files and directories currently installed.)
Preparing to unpack …/libc6_2.19-17_armhf.deb …
Unpacking libc6:armhf (2.19-17) over (2.19-15) …
Setting up libc6:armhf (2.19-17) …
Processing triggers for libc-bin (2.19-17) …
(Reading database … 36796 files and directories currently installed.)
Preparing to unpack …/locales_2.19-17_all.deb …
Unpacking locales (2.19-17) over (2.19-15) …
dpkg-deb (subprocess): decompressing archive member: lzma error: compressed data is corrupt
dpkg-deb: error: subprocess returned error exit status 2
dpkg: error processing archive /var/cache/apt/archives/locales_2.19-17_all.deb (–unpack):
cannot copy extracted data for ‘./usr/share/locale/it/LC_MESSAGES/libc.mo’ to ‘/usr/share/locale/it/LC_MESSAGES/libc.mo.dpkg-new’: unexpected end of file or stream
Preparing to unpack …/libcap2_1%3a2.24-8_armhf.deb …
Unpacking libcap2:armhf (1:2.24-8) over (1:2.24-7) …
Errors were encountered while processing:
/var/cache/apt/archives/locales_2.19-17_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Is this on a Pi 1 or Pi 2 ?

It appears that the package locales_2.19-17_all.deb is corrupt. This is a package that is part of Raspbian (Pi 1) or Debian (Pi 2) so it’s possible the file on their servers is corrupt or that the download got corrupted for some reason.

I’m not seeing this on my Pi 2 so it’s more likely that your download got corrupted. (Are you connecting through a firewall or transparent proxy ?)

You could try deleting the file from the apt cache to force it to be re-downloaded on next attempt like so:

sudo rm /var/cache/apt/archives/locales_2.19-17_all.deb

If that doesn’t work and if it is a problem with the file on the servers it will get fixed eventually so I’d leave it a few hours and try again.

It’s on a Pi1, I’d tried sudo apt-get clean which I thought cleared the cache but it just does the same when you try again.
No firewalls or proxy etc and never had a problem before.

I guess I’ll have to wait for someone to realise and fix it on the server :slight_smile:

Ah. I don’t have a Pi 1 handy to test, and the Pi 1 uses the Raspbian APT repo, so there could be a problem there that I wouldn’t see on my Pi 2. I would imagine it will get sorted as soon as someone notices it. It won’t cause your system any harm - only that one package will still be on an older version.

As it’s not an OSMC package but just an underlying OS package you won’t see any visible difference.

Yeah it’s just a pain :smile:

If I run sudo apt-get update && sudo apt-get dist-upgrade it says I have 44 updates but the whole thing fails with this one error it seems :pensive:

Unless you haven’t updated in forever, you’re unlikely to have 44 updates waiting…

Are you sure most of those are not “recommended” packages - which will not actually get installed ? (We disable automatic installation of recommended packages)

I updated just over a week ago, within OSMC I think it only wanted 10 updates but still failed, from the command line it wants 44.

root@osmc:~# apt-get update && apt-get dist-upgrade
Get:1 http://mirrordirector.raspbian.org jessie InRelease [14.9 kB]
Get:2 http://apt.osmc.tv jessie InRelease [2868 B]
Get:3 http://mirrordirector.raspbian.org jessie/main armhf Packages [8965 kB]
Get:4 http://apt.osmc.tv jessie/main armhf Packages [17.5 kB]
Ign http://apt.osmc.tv jessie/main Translation-en
Get:5 http://mirrordirector.raspbian.org jessie/contrib armhf Packages [37.4 kB]
Get:6 http://mirrordirector.raspbian.org jessie/non-free armhf Packages [70.2 kB]
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en
Ign http://mirrordirector.raspbian.org jessie/main Translation-en
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en
Fetched 9108 kB in 55s (163 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  armv6l-network-osmc armv6l-remote-osmc bsdutils libasn1-8-heimdal libblkid1 libc-bin libc-dev-bin libc6 libc6-dev libcap2 libcap2-bin
  libgcrypt20 libgssapi3-heimdal libgudev-1.0-0 libhcrypto4-heimdal libheimbase1-heimdal libheimntlm0-heimdal libhx509-5-heimdal
  libkrb5-26-heimdal libmount1 libmysqlclient18 libpam-systemd libparted2 libroken18-heimdal librtmp1 libsmartcols1 libssl1.0.0 libsvn1
  libsystemd0 libtiff5 libudev1 libuuid1 libwind0-heimdal locales mount multiarch-support mysql-common openssl perl-base subversion systemd
  systemd-sysv udev util-linux
44 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 24.2 MB of archives.
After this operation, 312 kB disk space will be freed.
Do you want to continue? [Y/n]

Today there’s 45 updates and a different error…

Preparing to unpack .../util-linux_2.25.2-6_armhf.deb ...
Unpacking util-linux (2.25.2-6) over (2.25.2-5) ...
dpkg: error processing archive /var/cache/apt/archives/util-linux_2.25.2-6_armhf.deb (--unpack):
 unable to create `/etc/init.d/hwclock.sh.dpkg-new' (while processing `./etc/init.d/hwclock.sh'): Input/output error
update-alternatives: warning: forcing reinstallation of alternative /bin/less because link group pager is broken
update-alternatives: warning: skip creation of /usr/share/man/man1/pager.1.gz because associated file /usr/share/man/man1/less.1.gz (of link group pager) doesn't exist
Processing triggers for mime-support (3.58) ...
Errors were encountered while processing:
 /var/cache/apt/archives/util-linux_2.25.2-6_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

That looks like a disk problem to me.

Check that you have not run out of disk space.

It’s a 32gb SD card so loads of room.

I ran apt-get clean after this and then run the update again, it wanted 42 updates and bombed out at the original error place again.

I’ve just tried apt-get check with this result, my last experience of force install was it trashed my install and I had to rebuild, what do you reckon?

osmc@osmc:~$ sudo apt-get check
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-dev : Depends: libc6 (= 2.19-17) but 2.19-15 is installed
E: Unmet dependencies. Try using -f.

Please use the log uploader to post your full APT (term and history) logs, as there is something very odd going on there.

Ok I’m looking at this wrong or perhaps the logs are only written to when it completes?

I looked at:-
/var/log/apt/term.log last entry 30th march 12:02
/var/log/dpkg.log last entry 30th march 12:02
/var/log/apt/history.log last entry 30th march 12:02

Is that the right logs? and if so why is the last few days not in it?

Yes it’s these two I’m interested in:

/var/log/apt/term.log
/var/log/apt/history.log

As to why there seem to be no later entries than the 30th March - I have no idea. Have you done any successful updates since then ? All updates and package installation/uninstall are logged to these two files, whether you use apt at the command line yourself or use the OSMC updater.

Is the system date and time correct ?

BTW using -f with dist-upgrade should be safe, as we use that option already in /usr/bin/manual-update, which is the script that does the “external” updates with the blue progress screen. So you could try:

sudo apt-get update && sudo apt-get -f dist-upgrade

To see if it will fix things up now. (Assuming that yesterdays bad package is fixed)

this could be the works of a bad/broken sd card, or power supply that caused this… any errors in dmesg ?

Ok there’s some weird sh#t going on…

I ran apt-get update and checked the log, entries where there so rebooted the log reverted back to the last entry of 30th March.

I run Domoticz with my house automation on it as well and noticed in the main log file it boots with what appears to be the time of 30th March 12:03 then later reverts to the time now. Logs for devices in Domoticz are ok to the 30th March then blank till now. Logs for Pi memory and temp seem to die off around the 28th of March.

Is it rebuild time or can I fix it?
It seems to work perfectly normal in operation and it’s odd that it seems to revert back in time to the last software update.

This is the output from dmesg http://paste.osmc.io/sagudofoke.vhdl

Input/Output error when dpkg is trying to extract a package does seem to suggest a disk problem, so I would agree that it could be a faulty SD card or the card is not making reliable contact in the slot. (More so a problem with full size SD slots on the original Pi)

At the very least there is some very weird file system corruption going on which would require a reinstall. As RC2 will be out quite soon I would probably wait for that before attempting a fresh install.

There’s an upgrade path from RC1 to RC2 though?

Hopefully it’ll stay in one piece till RC2 comes out.

Yes everyone can upgrade from RC to RC2 - however the specific issue that you are having might need a fresh install as you may have either file system corruption or a bad SD card.

I was just suggesting that if you do need to do a fresh install to fix this problem then you might as well wait for RC2 as it is just around the corner.

Yeah I was planning to build on a different SD card then upgrade.
I noticed the library is stuck in time as well.

Only one issue…
I can’t download the installer, Symantec blocks and removes it as Suspicious.Cloud9

Ok I got around that but suspected virus…?