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 !

    • mumblerfish@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      10 months ago

      This is such an important thing to learn when using linux. If you want to be able to rescue your setup and not just reinstall: live usb!

      To do a rescue on a system that does not boot, then you may also have to enter your environment and fix things, you do that by chroot. I always forget what steps are necessary, so I always look it up in the gentoo handbook: https://wiki.gentoo.org/wiki/Handbook:AMD64/Full/Installation#Chrooting It is the same principle with any live media.

  • hendrik@palaver.p3x.de
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    10 months ago

    Clear up some space first and then try something like this:

    dpkg --force-all --configure -a  
    apt --fix-broken install  
    apt-get -f install  
    

    I’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.

  • user28282912@piefed.social
    link
    fedilink
    English
    arrow-up
    1
    ·
    10 months ago

    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 -a to 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 autoremove should leave you with only the latest 2 kernel packages by default.