Update error

Hi there

I have an issue with the update process: Reading package lists… Done
Building dependency tree
Reading state information… Done
E: The package rbp2-image-4.4.27-7-osmc needs to be reinstalled, but I can’t find an archive for it.

The update of 2017-02-05 failed to complete, leaving the machine in an inconsistent state.

It might be possible to fix, if you’re prepared to search on google for “The package needs to be reinstalled, but I can’t find an archive for it” and try out the various suggestions, but there’s also the possibility that the problem is more system-wide than just one package and that some kind of corruption occurred during the update. (After all, what caused it to stop?)

IMO, the easiest solution would probably be to back up your data as best you can and reinstall using the latest version of OSMC.

1 Like

You could try sudo apt-cache clean && sudo apt-get update && sudo apt-get install -f

The command clears the cache and reloads the package list and then attempts to repair anything which it finds amiss. It is possible that doing this will cause the system to re-download the missing archive/ Otherwise I would imagine that you may have to re-install. Take a back-up of the /home/osmc/.kodi directory (either in the shell or using the backup tool in the MyOSMC GUI) before you do and you should be able to restore your preferences and library after reinstalling.

1 Like

I searched for the error message and found the root cause as being that the status of the package (probably defined in /var/lib/dpkg/status) was something other than “ok” and rbp2-image-4.4.27-7-osmc needed to be reinstalled. But, rbp2-image-4.4.27-7-osmc no longer exists in the OSMC repo because it has since been replaced by rbp2-image-4.4.27-9-osmc. This mismatch occurred because the original (failed) update occurred in February 2017. It seemed likely that this would not be the only mismatch after two months have elapsed.

Do you know if apt-cache clean would have overcome this mismatch between what is in /var/lib/dpkg/status and what’s now available in the repo?

apt-cache clean won’t touch dpkg’s status

dpkg maintains package state (and integrity)
apt cache maintains the list of available packages for installation. dpkg state is later queried when installation of the Deb is handled.

Paste the full output of sudo apt-get update && sudo apt-get dist-upgrade please.

That was also my understanding - but it’s always useful to clarify the point.

Given the way the February update simply stopped part-way through, I felt there was a possibility of multiple such anomalies occurring, plus the ever-present risk of data corruption. The least troublesome path for the OP therefore seemed to be a reinstall.

osmc@osmc:~$ sudo apt-get update && sudo apt-get dist-upgrade
Ign http://ftp.debian.org jessie InRelease
Get:1 http://ftp.debian.org jessie-updates InRelease [145 kB]
Get:2 http://security.debian.org jessie/updates InRelease [63.1 kB]
Hit http://apt.osmc.tv jessie InRelease
Hit http://ftp.debian.org jessie Release.gpg
Hit http://ftp.debian.org jessie Release
Get:3 http://security.debian.org jessie/updates/main armhf Packages [357 kB]
Get:4 http://apt.osmc.tv jessie/main armhf Packages/DiffIndex [2023 B]
Get:5 http://security.debian.org jessie/updates/contrib armhf Packages [1138 B]
Get:6 http://ftp.debian.org jessie-updates/main armhf Packages/DiffIndex [7408 B]
Get:7 http://security.debian.org jessie/updates/non-free armhf Packages [14 B]
Get:8 http://ftp.debian.org jessie-updates/contrib armhf Packages [32 B]
Get:9 http://ftp.debian.org jessie-updates/non-free armhf Packages/DiffIndex [736 B]
Get:10 http://security.debian.org jessie/updates/contrib Translation-en [1211 B]
Get:11 http://security.debian.org jessie/updates/main Translation-en [202 kB]
Get:12 http://ftp.debian.org jessie-updates/contrib Translation-en [14 B]
Get:13 http://ftp.debian.org jessie-updates/main Translation-en/DiffIndex [2704 B]
Get:14 http://ftp.debian.org jessie-updates/non-free Translation-en/DiffIndex [736 B]
Hit http://ftp.debian.org jessie/main armhf Packages
Hit http://ftp.debian.org jessie/contrib armhf Packages
Hit http://ftp.debian.org jessie/non-free armhf Packages
Hit http://ftp.debian.org jessie/contrib Translation-en
Hit http://ftp.debian.org jessie/main Translation-en
Hit http://ftp.debian.org jessie/non-free Translation-en
Get:15 http://security.debian.org jessie/updates/non-free Translation-en [14 B]
Ign http://apt.osmc.tv jessie/main Translation-en
Fetched 783 kB in 21s (37.0 kB/s)
Reading package lists… Done
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: The package rbp2-image-4.4.27-7-osmc needs to be reinstalled, but I can’t find an archive for it.