22
submitted 3 days ago* (last edited 3 days ago) by [email protected] to c/[email protected]

(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.

you are viewing a single comment's thread
view the rest of the comments
[-] [email protected] 2 points 2 days ago

It's just bunch of commands run with a single call, an automation. As long as I know exactly what each command is doing and if I wrote the alias myself, then I think its not a problem. What problem do you see with an update-alias such as I did there? The update-command does exactly that, it updates the box with all relevant package managers.

However if other people are also using the box, then its obviously a different situation. I wouldn't want to be reckless in the operation either; respect other users, even if you can do whatever you want.

[-] [email protected] 1 points 1 day ago

It's not that. It's not getting complacent by eliding the semantics of what you're doing. It's being consciously aware that you're doing something that could possibly fuck stuff up.

[-] [email protected] 1 points 1 day ago

In fact typing these commands by hand all the time won't save you from a fuck stuff up anyway. The update-alias is the exact same command I would have typed. In fact, as an alias its less likely to make a typo and fuck stuff up. I'm doing this since 2008, when I started with Linux, and named it always "update".

Using the update command I'm always aware it changes the system. Not at least because I also often expand the alias to its full command with a shortcut (update will be replaced in the terminal with the actual commands), I also see what the output of the commands. And without my password it wouldn't do any system changes anyway.

So typing these commands everything out won't be safer, as you suggest.

this post was submitted on 25 Sep 2024
22 points (95.8% liked)

Linux

47452 readers
995 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS