My friend has screwed up apt and I need advice on troubleshooting it
Trying to fix somebody else's problem long-distance when you are both in isolation is not easy. It becomes even more difficult when the person at the coalface doesn't fully understand what is going on. She has been using AntiX for two years now and does her own weekly updates using synaptic, but now she has a snafu.
She wasn't able to explain to me exactly how she got into this mess, but it must have been an interrupted update. The first thing we tried was a command line update using apt upgrade. It failed and instructed her to run dpkg --configure -a by hand, so she tried to do that, but it stalled. So I thought we'd try to get a list of what was pending and update packages individually until we find out which package is broken. I hoped to be able to use synaptic for that but it won't run. So I asked her to run dpkg --yet-to-unpack, hoping that would give us our list. It ran successfully but gave us nothing! I don't know much about the internals of apt, despite having been a Debian user for years, but I gather that unpacking goes to completion before any configuration is done. The break has obviously happened during this configuration stage. How do we find out what these packages are? Or alternatively, is there an emergency command that will clear the blockage. |
|
OK, she has now tried that. Unfortunately apt-get simply refuses to run. It just refers her back to a manual run of dpkg --configure -a. Which then freezes as before.
I'm sure we could crack this if we could use a more specific option than "-a". There must be one particular package in the pipeline that is breaking dpkg. If we could only find out what it is, it could be uninstalled and the rest of the update carried out properly. I'm not sure but I think this is the update that had all the wifi firmware in it. Where do downloaded packages go? And, more important, where do they get unpacked? Is there any kind of directory listing that would tell us what's in the pipeline? |
Quote:
Code:
dpkg -l | grep '^.[^ic]' |
|
Quote:
Quote:
|
Quote:
you may also try: apt clean, sometimes helps. |
Quote:
Quote:
I think I'll have to spend the next day or so exploring the options on my own AntiX system before going back to my friend. |
Quote:
|
Using aptitude is (probably) out. I've got AntiX running in front of me now and aptitude is not part of the default install so my friend won't have it either. I wouldn't want her to try installing it while the whole apt system is in such a mess.
On the other hand the dpkg -l|grep pipeline suggested by shruggy seems to work very well. So that is the next thing we shall try. I also had a look at the /var/lib/dpkg/status directory. Unfortunately it contains all installed packages so it's huge. But piping just the Status lines through more might yield something useful. I shall arrange another long-range session and report back. Thanks for all your help so far. |
If there's some breakage in /var/lib/dpkg/status then dpkg -C will probably catch it.
sudo dpkg -V also may reveal some clues, but it's 1) rather time-consuming, and 2) may generate too much noise. |
It seems that ssh is installed on AntiX by default.
Wouldn't that be the best option, make your friend start sshd and you can ssh into the machine and fix it? |
Quote:
It's definitely an idea for the future though. If I had a permanent account on that machine and a way of logging in, problems like this would be much easier to solve. I do have access to the root account actually but I bet sshd is configured by default not to allow remote root logins. It certainly would be on any machine of mine! |
Once in, you change to root using su.
It's not something I have any real experience of though, I just had a go at it a couple of times when I was in the inquisitive stage of using Linux/BSD. |
|
hazel,
One for the future perhaps, if you cannot take control via ssh: TeamViewer https://www.teamviewer.com/en/download/linux/ Debian 10 or antiX 19: https://linux.jadoel.info/ Ubuntu: https://community.teamviewer.com/t5/...Ubuntu/ta-p/45 There is also AnyDesk: https://anydesk.com/en/downloads/linux |
I think we've cleared it! We just had a one-hour telephone session starting with sudo dpkg -C, which gave a marvellously detailed list showing exactly where each package had stopped. Exactly what I wanted. Thanks, shruggy!
We ran sudo dpkg --configure --pending as suggested by dpkg itself, and after a while everything cleared. After that, sudo apt upgrade worked. There was an unwanted library to be autoremoved and three new dependencies to be installed but I think it all went smoothly. We shall reconvene tomorrow to try the next update and upgrade, and to check if synaptic works (she prefers to use synaptic). But I think we're over the hump. |
hazel,
Glad to hear that you appear to have fixed the problem. |
Everything OK! Synaptic works again and the backlog of new updates that built up over the past three weeks has been cleared. I have now worked out exactly what caused the problem and have explained how to deal with similar events in future.
The stalled update included a package called apt-antix, which I assume contains updated repo addresses. apt found evidence of a previous edit in the relevant file (which must have been done by some script or other) so it asked whether it was OK to proceed and overwrite the edited file with a new one. And of course nothing more happened. It just sat and waited for an answer. And my friend thought something had gone wrong, panicked and interrupted the update. That was what left the system in such a mess. When we cleared the blockage together yesterday, the same question came up and I told her to answer 'Y'. I've also given her a general lesson on answering questions posed by synaptic. She already knows not to OK an update that contains substantial deletions because that's not normal. Now she knows that overwriting a configuration file is nearly always OK. All the same, when the curfew is lifted, I shall create an account for myself on that machine, so that I can log in remotely when necessary. The whole experience makes me all the more grateful for how much more simple updating is on Slackware :). |
All times are GMT -5. The time now is 09:03 PM. |