Error in last update

i got this error in the last update:

File list file of the package “rbp2-image-4.14.26-2-osmc” cannot be opened: No permission

how to solve?

It’s probably a file corruption, possibly due to a broken SD card. What’s the output from running the following command:

ls -l /var/lib/dpkg/info/rbp2-image-4.14.26-2-osmc*
>      -rw-r--r-- 1 root root     0 Mai 10  2018 /var/lib/dpkg/info/rbp2-image-4.14.26-2-osmc.list
>      -rwxr-xr-x 1 root root 11354 Mär 15  2018 /var/lib/dpkg/info/rbp2-image-4.14.26-2-osmc.postrm

It’s probably a file corruption, possibly due to a broken SD card.

everything is working fine though …

SD cards don’t always just fail, they start with bad cells so you may see minor file corruption that will quickly get worse as more and more cells in the card fail.

ok, so is that the “solution”?

No, I’m sure @dillthedog will help you get the update working, I was just point out that the card can partially fail.

That’s an old kernel version, and the permissions look to be fine, though the package already seems to have been removed.

I guess the next step is to provide the output from running

sudo apt-get update
sudo apt-get autoremove
sudo apt-get dist-upgrade

and the URL from running grab-logs -A

https://paste.osmc.tv/erujenuwaz

Don’t forget the output from running

osmc@B2RASP2:~$ sudo apt-get update
OK:1 raspotify | A Spotify Connect client that mostly Just Works™ jessie InRelease
OK:2 http://apt.sonarr.tv master InRelease
OK:3 Index of /repo/debian jessie InRelease
Ign:4 Index of /debian stretch InRelease
OK:5 http://security.debian.org stretch/updates InRelease
Holen:7 Index of /debian stretch-updates InRelease [91.0 kB]
OK:8 Index of /debian stretch Release
OK:6 Index of /osmc/osmc/apt stretch InRelease
Es wurden 91.0 kB in 21 s geholt (4’309 B/s).
Paketlisten werden gelesen… Fertig
osmc@B2RASP2:~$ sudo apt-get autoremove
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen… Fertig
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 8 nicht aktualisiert.
osmc@B2RASP2:~$ sudo apt-get dist-upgrade
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen… Fertig
Paketaktualisierung (Upgrade) wird berechnet… Fertig
Die folgenden Pakete werden aktualisiert (Upgrade):
bind9-host dnsutils libbind9-140 libdns162 libisc160 libisccc140 libisccfg140 liblwres141
8 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
Es müssen noch 0 B von 2’683 kB an Archiven heruntergeladen werden.
Nach dieser Operation werden 0 B Plattenplatz zusätzlich benutzt.
Möchten Sie fortfahren? [J/n] j
dpkg: nicht behebbarer fataler Fehler, Abbruch:
Dateilisten-Datei des Paketes »rbp2-image-4.14.26-2-osmc« kann nicht geöffnet werden: Keine Berechtigung
E: Sub-process /usr/bin/dpkg returned an error code (2)

Your log shows that you still have eight kernels installed on your system, when only two should be there – the current and one previous version – so something is failing to work correctly.

It also looks like you have port 22 forwarded from your router – and your Pi is being hammered by hackers trying to break in. That’s not good since it only needs one to succeed… You really need to consider a reinstall since there’s no way to guarantee the security of the installation. If you really need external SSH access in the future, move to a high port number.

As to the current problem, what happens when you try to run:

sudo apt-get -y purge rbp2-image-4.14.26-2-osmc
sudo apt-get -y purge rbp2-image-4.14.34-1-osmc

both times no success:

> osmc@B2RASP2:~$ sudo apt-get -y purge rbp2-image-4.14.26-2-osmc
> Paketlisten werden gelesen... Fertig
> Abhängigkeitsbaum wird aufgebaut.
> Statusinformationen werden eingelesen.... Fertig
> Die folgenden Pakete werden ENTFERNT:
> rbp2-image-4.14.26-2-osmc*
> 0 aktualisiert, 0 neu installiert, 1 zu entfernen und 8 nicht aktualisiert.
> Nach dieser Operation werden 0 B Plattenplatz zusätzlich benutzt.
> dpkg: nicht behebbarer fataler Fehler, Abbruch:
> Dateilisten-Datei des Paketes »rbp2-image-4.14.26-2-osmc« kann nicht geöffnet werden: Keine Berechtigung
> E: Sub-process /usr/bin/dpkg returned an error code (2)
> osmc@B2RASP2:~$ sudo apt-get -y purge rbp2-image-4.14.34-1-osmc
> Paketlisten werden gelesen... Fertig
> Abhängigkeitsbaum wird aufgebaut.
> 
> Statusinformationen werden eingelesen.... Fertig
> 
> Die folgenden Pakete werden ENTFERNT:
> 
> rbp2-image-4.14.34-1-osmc*
> 0 aktualisiert, 0 neu installiert, 1 zu entfernen und 8 nicht aktualisiert.
> Nach dieser Operation werden 0 B Plattenplatz zusätzlich benutzt.
> dpkg: nicht behebbarer fataler Fehler, Abbruch:
> Dateilisten-Datei des Paketes »rbp2-image-4.14.26-2-osmc« kann nicht geöffnet werden: Keine Berechtigung
> E: Sub-process /usr/bin/dpkg returned an error code (2)

It also looks like you have port 22 forwarded from your router – and your Pi is being hammered by hackers trying to break in.

i need the access and check the logs once in a while. i know people try to log in over ssh all the time but i would not call that hacking … anyway, i will consider choosing a higher portnumber.

The next step is to try and view the contents of some files:

cat /var/lib/dpkg/info/rbp2-image-4.14.26-2-osmc.list
cat /var/lib/dpkg/info/rbp2-image-4.14.34-1-osmc.list

I know they should be empty but this is a permissions test. And for completeness:

less /var/lib/dpkg/info/rbp2-image-4.14.26-2-osmc.postrm
ls -la /var/lib/dpkg

file #1: no permission
file #2-4: readable

osmc@B2RASP2:~$ cat /var/lib/dpkg/info/rbp2-image-4.14.26-2-osmc.list
    cat: /var/lib/dpkg/info/rbp2-image-4.14.26-2-osmc.list: Keine Berechtigung
    osmc@B2RASP2:~$ cat /var/lib/dpkg/info/rbp2-image-4.14.34-1-osmc.list
    osmc@B2RASP2:~$ 
    osmc@B2RASP2:~$ 
    osmc@B2RASP2:~$ less /var/lib/dpkg/info/rbp2-image-4.14.26-2-osmc.postrm
    osmc@B2RASP2:~$ ls -la /var/lib/dpkg
    insgesamt 2648
    drwxr-xr-x  8 root root    4096 Mai 11 23:39 .
    drwxr-xr-x 41 root root    4096 Jan 24 13:25 ..
    drwxr-xr-x  2 root root    4096 Apr 30 15:17 alternatives
    -rw-r--r--  1 root root     418 Mai 11 23:39 available
    -rw-r--r--  1 root root     418 Mai 11 23:38 available-old
    -rw-r--r--  1 root root       8 Mär 15  2015 cmethopt
    -rw-r--r--  1 root root    1511 Jan 11  2018 diversions
    -rw-r--r--  1 root root    1617 Jan 11  2018 diversions-old
    drwxr-xr-x  2 root root  249856 Apr 30 15:17 info
    -rw-r-----  1 root root       0 Mai 11 23:39 lock
    drwxr-xr-x  2 root root    4096 Feb 23  2015 parts
    -rw-r--r--  1 root root     211 Jan 24 13:26 statoverride
    -rw-r--r--  1 root root     174 Mai 10  2018 statoverride-old
    -rw-r--r--  1 root root 1196519 Mai 11 23:39 status
    -rw-r--r--  1 root root 1196517 Mai 11 23:39 status-old
    drwxr-xr-x  2 root root    4096 Mai  3 22:34 tmp.ci
    drwxr-xr-x  2 root root    4096 Apr 23 18:46 triggers
    drwxr-xr-x  2 root root    4096 Mai 11 23:39 updates

Let’s try to remove and re-create the file:

sudo rm -f /var/lib/dpkg/info/rbp2-image-4.14.26-2-osmc.list

If that works:

sudo touch /var/lib/dpkg/info/rbp2-image-4.14.26-2-osmc.list

not possible to remove the file.

osmc@B2RASP2:~$ sudo rm -f /var/lib/dpkg/info/rbp2-image-4.14.26-2-osmc.list

rm: das Entfernen von '/var/lib/dpkg/info/rbp2-image-4.14.26-2-osmc.list' ist nicht möglich: Die Operation ist nicht erlaubt

It looks like it’s either a broken card or a filesystem corruption.

You can try to force a filesystem check (fsck) with the commands sudo touch /forcefsck and then reboot. If the file is still there and you still can’t remove it, then you’re looking at a reinstall on a new card.

/forcefsck did not help (even after activating autocorrect)
so i guess this means i have to restore from backup …

ok, i recovered from my backup on a new sd-card and successfully upgraded the system.
is this the most recent kernel?

osmc@B2RASP2:~$ uname -r
4.14.78-4-osmc

That’s the one I’m on, so yes.