(Edit: I always forget that Beehaw will convert every ampersand character in code segments to &. Have this in mind when reading the code below. Do you have these problems too with your instance?)

If you update your system from terminal, do you have a shortcut that bundles bunch of commands? I’m on EndevourOS/Arch using Flatpak. Rustup is installed and managed by itself. The empty command is a function to display and delete files in the trash using the program trash-cli. In my .bashrc:

alias update='eos-update --yay \
    ; flatpak uninstall --unused \
    ; flatpak update \
    ; rustup update \
    ; empty'

empty() {
    trash-empty -f --dry-run |
        awk '{print $3}' |
        grep -vF '/info/'
    trash-empty -f
}

I just need to type update. Also there are following two aliases, which are used very rarely, at least months apart and are not part of the main update routine:

alias mirrors='sudo reflector \
        --protocol https \
        --verbose \
        --latest 25 \
        --sort rate \
        --save /etc/pacman.d/mirrorlist \
    && eos-rankmirrors --verbose \
    && yay -Syyu'

alias clean='paccache -rk3 \
    && paccache -ruk1 \
    && journalctl --vacuum-time=4weeks \
    && balooctl6 disable \
    && balooctl6 purge \
    && balooctl6 enable \
    && trash-empty -f'

This question is probably asked a million times, but the replies are always fun and sometimes reveals improvements from others to adapt.

  • toastal
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 months ago

    You should at least consider nixos-rebuild --use-remote-sudo switch over raw-dogging sudo.

    • flashgnash@lemm.ee
      link
      fedilink
      arrow-up
      1
      ·
      2 months ago

      What does remote sudo actually do I thought it was meant to be for doing remote builds over ssh

      • toastal
        link
        fedilink
        arrow-up
        1
        ·
        2 months ago

        It’ll call sudo at the point it needs to at the end regardless of remote or not. There have been a couple of bugs in the past trying to run the whole process under sudo & --use-remote-sudo was always recommended as a fix.

        • flashgnash@lemm.ee
          link
          fedilink
          arrow-up
          1
          ·
          2 months ago

          Have tried using it this way though the glaring issue for me is that I have to type the password at the end rather than start, meaning I’ll start a rebuild, go for something else then it’ll time out on the sudo password

          • toastal
            link
            fedilink
            arrow-up
            1
            ·
            edit-2
            2 months ago

            That is a different story & a usability pain I can share 😅 …but assuming there wasn’t a GC, the build is cached, just needs another switch—& I am willing to take that as opposed to having the whole process running as root.

            • flashgnash@lemm.ee
              link
              fedilink
              arrow-up
              2
              ·
              2 months ago

              I suppose I could write a custom script that runs sudo echo or something so it’s cached