0

I am using a Debian testing system as a persistent live system on a USB stick (using live-build). This means that the kernel etc. cannot be upgraded, since they are on a read only partition.

I've been using this kind of system for about 13 years now and never run into any problems with aptitude and apt-get for installing packages. Recently though I built a new system (I do this once every six months or so) and then after that something I was trying to install must have tried to install an upgrade to the kernel. This failed. This interfered with package installation but I managed to work around it.

However, recently I first started getting an error that linux-image-5.18.0-2-rt-amd64 needed to be upgraded but could not be, since the package was not in the repositories. Every install of any package then began failing with Could not generate list of packages to download.

Following advice from some of the answers I found here, I tried aptitude remove linux-image-5.18.0-2-rt-amd64, since I in any case do not need a real time kernel. I got this error:

Removing linux-image-5.18.0-2-rt-amd64 (5.18.5-1) ...
/etc/kernel/postrm.d/initramfs-tools:
I: update-initramfs is disabled (live system is running on read-only media).
/etc/kernel/postrm.d/z50-raspi-firmware:
raspi-firmware: missing /boot/firmware, did you forget to mount it?
run-parts: /etc/kernel/postrm.d/z50-raspi-firmware exited with return code 1
dpkg: error processing package linux-image-5.18.0-2-rt-amd64 (--remove):
 installed linux-image-5.18.0-2-rt-amd64 package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-5.18.0-2-rt-amd64
Processing was halted because there were too many errors.

Now, whatever package I try to install, the same thing happens and the install fails. I have tried apt-get-f install, but that just tries to repeat the above operation and fails. I have tried with both aptitude and apt and both fail.

I know many answers refer to making changes in the `/var/lib/dpkg/info' directory, but I did not find a clear explanation of what those changes actually imply, so I've been kind of scared of making them.

What should I do in this situation?

2
  • That looks as if you accidentally included the RT kernel in you original build of this live-USB stick. I don't think there any easy way out, except just building a new stick (and making sure you dont make the same mistake again :-))
    – Tonny
    Commented Aug 17, 2022 at 9:13
  • @Tonny It's nowhere in my install lists :-( but more importantly all the installs were working fine until recently. It's only literally today that things stopped working. I've installed hundreds of packages on this stick with no trouble.
    – ShankarG
    Commented Aug 17, 2022 at 9:39

1 Answer 1

0

I managed to get it working again, at least for now. I don't know if this is the right way, or indeed if I've screwed up something else, but posting this for other users' reference.

First I did this, following this answer to another question:

sudo rm /var/lib/dpkg/info/linux-image-5.18.0-2-rt-amd64.*

Then I did this, following this answer:

sudo dpkg -P linux-image-5.18.0-2-rt-amd64

The latter executed without any problems - I don't even know if the first command was required.

Now I can install packages again!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .