Every atp command returns an avalanche of errors, I freed up some space but the package management stuff seems gone and I can’t seem to fix it. Should I fresh install?
SOLUTION: Okay first of all thanks to all the people who replied to me and pointed me to the right direction, the issue was I was having full disk space and missing a few apt libraries which prevented the commands to run succesfully. I solved by freeing up some space, chrooting inside my corrupted environment from a live USB (there’s plenty of guides online on how to do this correctly), I downloaded (from debian package search) and installed manually with dpkg a few packages: apt-transport-https, curl, and libnettle8t64 which apt-transport-https required and which was the one actually solving the problem. After that apt --fix-broken install could run succesfully and every further apt command worked without issues, upgraded the system and now it is booting fine! Again, thank you so much @mumblerfish@lemmy.world, @utopiah@lemmy.ml @hendrik@palaver.p3x.de, @ThanksForAllTheFish@sh.itjust.works, @BassTurd@lemmy.world, @IsoKiero@sopuli.xyz !
Try cleaning up space through a live usb of any distro.
Removed by mod
In case anyone is tempted, don’t run this
Yeah, you need a sudo in front of it otherwise it won’t work.
Also
--no-preserve-root
Clear up some space first and then try something like this:
dpkg --force-all --configure -a apt --fix-broken install apt-get -f installI’ve had issues like that before and oftentimes it’s recoverable. A bit unfortunately if the wrong packages got damaged. Can be quite an effort to get it going again and it depends on the exact situation.
The first command worked, the second one is still showing up
http have died unexpectedly error 127Hmm, sorry. I’d guess your internet connection doesn’t work any more. So apt can’t fetch the packages. That’s kind of hard to debug, though. You’d somehow need to fix networking before you can proceed. But we don’t really know what broke. And if that’s really the only issue at play.
Maybe a Live-USB stick and a rescue mode can help here?! Other than that I’m out of options.
You might have too many old kernels installed. This would potentially fill up the /boot partition. One way to check this is:
df -h
Look for the line indicating space left for /boot.
You can then get a list of the installed kernels with:
dpkg --get-selections | grep -v deinstall | grep linux-image
If you need to remove old ones, use
uname -ato identify the running kernel (should be the latest version if you’ve rebooted after the last kernel update) then remove all of the older kernel packages with:sudo apt remove -y linux-image-amd64-xxxx
More generally speaking, I think that
sudo apt autoremoveshould leave you with only the latest 2 kernel packages by default.apt autoremove says dependencies are lacking
apt --fix-broken install gives me:
method http has died unexpectedly
What kind of errors you’re getting? First what you can try is to run ‘dpkg --configure -a’. If that doesnt help we need more information on what’s going on.
I get dependency errors when trying to execute that dpkg command, other apt commands, if I execute --fix-broken I get:
method http has died unexpectedlyOther apt commands give me:
Dependencies not met(I freed up disk space)
What errors excactly? Copy and paste what you’re getting from your terminal. Also post output of ‘df -h’.
This is usually the recommended way to fix such dependency problems.
sudo apt-get -f installapt-get -f install
I tried it already, but I get
method http has died unexpectedlyhttps subprocess error code 127Another way to try to fix dependency problems, including complicated ones that apt cannot solve, is to use the magnificent aptitude deb helper. If you have aptitude not installed you can possibly still install it with dpkg. Download aptitude deb file and the aptitude-common deb file and save them to disk. For example for Debian : https://packages.debian.org/trixie/aptitude With dpkg it is in dependency problems situations still possible to install new software. Maybe dpkg --force-all or something like that is needed.
Make sure to make backups of your valuable things first via a Linux live session.
After you have aptitude installed, try e.g. :
sudo aptitude updateor
sudo aptitude install ncdu(or install some other small program you didn’t have installed already)It may already show a suggestion solution.
Oof… it actually happened to me and it’s not 1 problem but 2 namely :
- you ran out of disk space while updating
- AND one of the messed up packages is one that is required for the upgrade process, e.g. curl or wget (sorry can’t recall which it actually is)
so that leaves you in a terrible stable. You can still clean up this mess BUT that’s tricky. Basically you have to
- actually find out what’s taking up space (often old kernels) or “just” give up on data temporarily (basically you move your /home, or part of it, to a USB stick) via rescue mode (you need to be familiar with the CLI) or remount the disk on another working system
- get the actually missing packages via another working system then install locally (typically
dpkgon.debfiles but NOTapt getbecause that requires connectivity and thus packages you do not have anymore) the bare minimum you need then finish the update.
For me it was on a small temporary system (e.g. RPi for HomeAssistant) so it was basically easier to recover from a recent backup after formatting.
It’s annoying but it’s actually not that bad.
Edit: clarified on the broken state and dpkg vs apt get
And this is why you want atomic updates folks…
Cool, bro. RTFM that shit first, eh. More answers may be found HERE






