Score:0

Autorecovering apt for noninteractive updates

je flag

I'm running apt to keep a package up to date on an SBC that's liable to lose power. The SBC doesn't really have an accessible terminal and there are a few of them, so I'd like for something that can be done reliably without interactivity.

apt right now seems to not have a great time if the power is disconnected. In particular, there's a bunch of failure points:

rm /var/lib/dpkg/lock-frontend

to release any dead locks and fixing broken installations with

dpkg -l

and run apt install -yq --reinstall <pkg> on that, or

apt --fix-broken install -yq

But it appears that even these aren't super reliable and fix-broken won't actually fix the package in some situations.

I know this isn't 100% foolproof, but is there a way to increase the reliability so at least I don't have to manually intervene as frequently?

Essentially, I'm looking for a command that reliably that

  1. Unlocks apt
  2. Fixes any broken packages, reinstalling if necessary
  3. Force installs a package to a version

Maybe it's simpler to manually download the .deb files and install them myself?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.