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 !

  • utopiah@lemmy.ml
    link
    fedilink
    arrow-up
    12
    ·
    edit-2
    3 days ago

    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 dpkg on .deb files but NOT apt get because 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