My turn: OSMC Update Error

For a week now I’ve been getting the following on one of my two OSMC RaspPis:
OSMC Update Error
Error installing:
Please report this on the OSMC forum.

I enabled all logging, rebooted, and tried a manual update where I got the same message.
Logs uploaded to http://paste.osmc.io/nulahulero

Let me know if you need additional information

This suggests you may have corrupted APT downloads from a previous download attempt, or that there is a problem reaching the raspbian servers:

16:05:20 132.299667 T:2697720816   DEBUG: OSMC UPDATE COMMS: Connection active.
16:05:20 132.306091 T:2697720816   DEBUG: OSMC UPDATE COMMS: data = ["apt_error", {"exception": "Error Type and Args: SystemError : ('E:Unable to parse package file /var/lib/apt/lists/mirrordirector.raspbian.org_raspbian_dists_jessie_main_binary-armhf_Packages (1), E:The package lists or status file could not be parsed or opened.',) \n\n Traceback (most recent call last):\n  File \"/usr/share/kodi/addons/script.module.osmcsetting.updates/resources/lib/apt_cache_action.py\", line 72, in __init__\n    self.act()\n  File \"/usr/share/kodi/addons/script.module.osmcsetting.updates/resources/lib/apt_cache_action.py\", line 115, in act\n    action()\n  File \"/usr/share/kodi/addons/script.module.osmcsetting.updates/resources/lib/apt_cache_action.py\", line 236, in update\n    self.cache = apt.Cache()\n  File \"/usr/lib/python2.7/dist-packages/apt/cache.py\", line 107, in __init__\n    self.open(progress)\n  File \"/usr/lib/python2.7/dist-packages/apt/cache.py\", line 154, in open\n    self._cache = apt_pkg.Cache(progress)\nSystemError: E:Unable to parse package file /var/lib/apt/lists/mirrordirector.raspbian.org_raspbian_dists_jessie_main_binary-armhf_Packages (1), E:The package lists or status file could not be parsed or opened.\n", "package": "", "error": ""}]
16:05:20 132.309738 T:2858415088   DEBUG: Previous line repeats 1 times.
16:05:20 132.310822 T:2858415088   DEBUG: script.module.osmcsetting.updates : comm_from_script - [u'apt_error', {u'exception': u'Error Type and Args: SystemError : (\'E:Unable to parse package file /var/lib/apt/lists/mirrordirector.raspbian.org_raspbian_dists_jessie_main_binary-armhf_Packages (1), E:The package lists or status file could not be parsed or opened.\',) \n\n Traceback (most recent call last):\n  File "/usr/share/kodi/addons/script.module.osmcsetting.updates/resources/lib/apt_cache_action.py", line 72, in __init__\n    self.act()\n  File "/usr/share/kodi/addons/script.module.osmcsetting.updates/resources/lib/apt_cache_action.py", line 115, in act\n    action()\n  File "/usr/share/kodi/addons/script.module.osmcsetting.updates/resources/lib/apt_cache_action.py", line 236, in update\n    self.cache = apt.Cache()\n  File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 107, in __init__\n    self.open(progress)\n  File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 154, in open\n    self._cache = apt_pkg.Cache(progress)\nSystemError: E:Unable to parse package file /var/lib/apt/lists/mirrordirector.raspbian.org_raspbian_dists_jessie_main_binary-armhf_Packages (1), E:The package lists or status file could not be parsed or opened.\n', u'error': u'', u'package': u''}]

I would log in with SSH and run the following command to clean the package cache:

sudo apt-get clean

Then try updating again.

Thanks for the response. Unfortunately this didn’t fix the issue.

I verified that the following file exists:
osmc@osmc2:~$ ls -l /var/lib/apt/lists/mirrordirector.raspbian.org_raspbian_dists_jessie_main_binary-armhf_Packages
-rw-r–r-- 1 root root 46667352 Jun 2 03:12 /var/lib/apt/lists/mirrordirector.raspbian.org_raspbian_dists_jessie_main_binary-armhf_Packages

osmc@osmc2:~$ head /var/lib/apt/lists/mirrordirector.raspbian.org_raspbian_dists_jessie_main_binary-armhf_Packages
Package: 0ad
Version: 0.0.17-1
Architecture: armhf
Maintainer: Debian Games Team pkg-games-devel@lists.alioth.debian.org
Installed-Size: 8815
Pre-Depends: dpkg (>= 1.15.6~)
Depends: 0ad-data (>= 0.0.17), 0ad-data (<= 0.0.17-1), 0ad-data-common (>= 0.0.17), 0ad-data-common (<= 0.0.17-1), libboost-filesystem1.55.0, libc6 (>= 2.15), libcurl3-gnutls (>= 7.16.2), libenet7, libgcc1 (>= 1:4.4.0), libgl1-mesa-glx | libgl1, libgloox12, libicu52 (>= 52~m1-1~), libjpeg62-turbo (>= 1:1.3.1), libminiupnpc10 (>= 1.9.20140610), libmozjs-24-0, libnvtt2, libopenal1 (>= 1.14), libpng12-0 (>= 1.2.13-4), libsdl1.2debian (>= 1.2.11), libstdc++6 (>= 4.9), libvorbisfile3 (>= 1.1.2), libwxbase3.0-0 (>= 3.0.2), libwxgtk3.0-0 (>= 3.0.2), libx11-6, libxcursor1 (>> 1.1.2), libxml2 (>= 2.9.0), zlib1g (>= 1:1.2.0)
Homepage: http://play0ad.com/
Priority: optional
Section: games

osmc@osmc2:~$ tail /var/lib/apt/lists/mirrordirector.raspbian.org_raspbian_dists_jessie_main_binary-armhf_Packages
MD5sum: 7f3f0229acf71f4e90b10a32ef54ffc8
Description: transparent application fuzzer
Zzuf is a transparent fuzzer. It works by intercepting applications’ file
and network operations and changing random bits in their input. Its behaviour
is deterministic, making it easy to reproduce bugs.
.
Zzuf has support for variable fuzzing ratio, character filtering, fuzzing
decision based on filenames and optional network fuzzing. It can also stop
processes that run for too long or that output too much data.

Any other thoughts?

sudo rm /var/lib/apt/lists/*
sudo apt-get update
sudo apt-get dist-upgrade

Result of last operation:

osmc@osmc2:~$ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... The following packages were automatically installed and are no longer required:
  libasn1-8-heimdal libgssapi3-heimdal libhcrypto4-heimdal libheimbase1-heimdal libheimntlm0-heimdal libhx509-5-heimdal libkrb5-26-heimdal libroken18-heimdal libwind0-heimdal
  rbp1-image-4.4.6-3-osmc
Use 'apt-get autoremove' to remove them.
Done
The following packages will be upgraded:
  dmsetup dpkg initramfs-tools libdevmapper-event1.02.1 libdevmapper1.02.1 libexpat1 libidn11 liblvm2app2.2 libsmbclient libssl1.0.0 libwbclient0 libxml2 openssl perl-base samba-common
  samba-libs tzdata
17 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 12.1 MB of archives.
After this operation, 33.8 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main dpkg armhf 1.17.27 [2930 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ jessie/main perl-base armhf 5.20.2-3+deb8u5 [1101 kB]
Get:3 http://mirrordirector.raspbian.org/raspbian/ jessie/main dmsetup armhf 2:1.02.90-2.2+deb8u1 [66.5 kB]
Get:4 http://mirrordirector.raspbian.org/raspbian/ jessie/main libdevmapper1.02.1 armhf 2:1.02.90-2.2+deb8u1 [138 kB]
Get:5 http://mirrordirector.raspbian.org/raspbian/ jessie/main libssl1.0.0 armhf 1.0.1t-1+deb8u2 [852 kB]
Get:6 http://mirrordirector.raspbian.org/raspbian/ jessie/main libidn11 armhf 1.29-1+deb8u1 [133 kB]
Get:7 http://mirrordirector.raspbian.org/raspbian/ jessie/main libxml2 armhf 2.9.1+dfsg1-5+deb8u2 [705 kB]
Get:8 http://mirrordirector.raspbian.org/raspbian/ jessie/main libdevmapper-event1.02.1 armhf 2:1.02.90-2.2+deb8u1 [34.8 kB]
Get:9 http://mirrordirector.raspbian.org/raspbian/ jessie/main libexpat1 armhf 2.1.0-6+deb8u2 [60.3 kB]
Get:10 http://mirrordirector.raspbian.org/raspbian/ jessie/main liblvm2app2.2 armhf 2.02.111-2.2+deb8u1 [381 kB]
Get:11 http://mirrordirector.raspbian.org/raspbian/ jessie/main libwbclient0 armhf 2:4.2.10+dfsg-0+deb8u3 [116 kB]
Get:12 http://mirrordirector.raspbian.org/raspbian/ jessie/main libsmbclient armhf 2:4.2.10+dfsg-0+deb8u3 [138 kB]
Get:13 http://mirrordirector.raspbian.org/raspbian/ jessie/main samba-libs armhf 2:4.2.10+dfsg-0+deb8u3 [4244 kB]
Get:14 http://mirrordirector.raspbian.org/raspbian/ jessie/main samba-common all 2:4.2.10+dfsg-0+deb8u3 [239 kB]
Get:15 http://mirrordirector.raspbian.org/raspbian/ jessie/main tzdata all 2016d-0+deb8u1 [185 kB]
Get:16 http://mirrordirector.raspbian.org/raspbian/ jessie/main initramfs-tools all 0.120+deb8u2 [96.3 kB]
Get:17 http://mirrordirector.raspbian.org/raspbian/ jessie/main openssl armhf 1.0.1t-1+deb8u2 [653 kB]
Fetched 12.1 MB in 19s (607 kB/s)
Preconfiguring packages ...
E: Sub-process /usr/bin/dpkg returned an error code (2)
E: Failed to write temporary StateFile /var/lib/apt/extended_states.tmp

More interesting is that at this point /bin and /usr/bin seem to be gone (‘bash’ cannot find ‘ls’ and ‘sudo’ binaries).

Looks like it’s time for a re-install

Hmmm, I moved the SD Card to my Linux laptop where I do my re-imaging and both partitions were auto-mounted just fine. Now I’m not sure what to do since I don’t want to re-image if I don’t need to.

You have experienced severe filesystem corruption

Please verify your SD card and power supply and reinstall OSMC

Are you using a Kingston SD card?

No, I have a PNY SD-K04G that came with the RaspPi when I originally purchased it.

I’ve reinstalled OSMC, restored my last backup, and seem to be good again.

Fantastic :slight_smile:

Hi also new to kodi and osmc did any automatic update today Got ask do you want to install update? of course yes, did it and got a constant sad face loop

how i solved downloaded putty got my raspb2 ip adress from my router and did the following commandsosmc@localhost:~$ sudo apt-get clean
osmc@localhost:~$ sudo apt-get dist-upgrade

E: Unmet dependencies. Try using -f.
osmc@localhost:~$ sudo apt-get -f install

while in booting cycle it suddenly restarted like normal