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?

  • utopiah@lemmy.ml
    link
    fedilink
    arrow-up
    6
    ·
    3 hours 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 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 the 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.

  • brooke592@sh.itjust.works
    link
    fedilink
    arrow-up
    12
    ·
    7 hours ago

    Sorry that happened to you.

    The distro developers should implement a solution so that updating without enough space doesn’t break your system. They could prevent the update or at least warn you that there’s not enough space and bad things can happen.

  • BassTurd@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    6 hours ago

    As others pointed out, it looks like you lost networking. If you can boot to a live USB, you can chroot into your environment with networking to maybe have better luck with the repair commands.

  • hendrik@palaver.p3x.de
    link
    fedilink
    English
    arrow-up
    20
    ·
    edit-2
    10 hours 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.

    • dontblink@feddit.itOP
      link
      fedilink
      English
      arrow-up
      9
      ·
      10 hours ago

      The first command worked, the second one is still showing up http have died unexpectedly error 127

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

        Hmm, 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.

  • user28282912@piefed.social
    link
    fedilink
    English
    arrow-up
    9
    ·
    11 hours 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.

    • dontblink@feddit.itOP
      link
      fedilink
      English
      arrow-up
      4
      ·
      edit-2
      10 hours ago

      apt autoremove says dependencies are lacking

      apt --fix-broken install gives me: method http has died unexpectedly

  • IsoKiero@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    6
    ·
    11 hours ago

    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.

    • dontblink@feddit.itOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      11 hours ago

      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 unexpectedly

      Other apt commands give me:

      Dependencies not met

      (I freed up disk space)

      • IsoKiero@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        4
        ·
        10 hours ago

        What errors excactly? Copy and paste what you’re getting from your terminal. Also post output of ‘df -h’.

      • lemmyreader@lemmy.ml
        link
        fedilink
        English
        arrow-up
        3
        ·
        edit-2
        10 hours ago

        This is usually the recommended way to fix such dependency problems.

        sudo apt-get -f install

        • dontblink@feddit.itOP
          link
          fedilink
          English
          arrow-up
          3
          ·
          edit-2
          10 hours ago

          apt-get -f install

          I tried it already, but I get method http has died unexpectedly https subprocess error code 127

          • lemmyreader@lemmy.ml
            link
            fedilink
            English
            arrow-up
            4
            ·
            10 hours ago

            Another 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 update

            or

            sudo aptitude install ncdu (or install some other small program you didn’t have installed already)

            It may already show a suggestion solution.