(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.
deleted by creator
No alias, just topgrade
alias update='sudo apt update && sudo apt upgrade -y && sudo apt dist-upgrade -y && sudo apt autoremove -y' alias update-and-reboot='sudo apt update && sudo apt upgrade -y && sudo apt dist-upgrade -y && sudo apt autoremove -y && sudo reboot' alias update-and-poweroff='sudo apt update && sudo apt upgrade -y && sudo apt dist-upgrade -y && sudo apt autoremove -y && sudo poweroff'
Using Bluefin (a Fedora atomic distro) and all of that gets done automatically behind the scenes. Flatpaks, distrobox containers, Brew, vocoder extensions, etc…
All done using topgrade: https://github.com/topgrade-rs/topgrade
#!/usr/bin/env dash set -e cd $HOME/nixcfg # flake inputs to update for input in nixpkgs nixos-hardware home-manager hosts; do nix --extra-experimental-features flakes --no-warn-dirty flake update $input done # rebuild NixOS nixos-rebuild --use-remote-sudo switch --keep-going --fallback --flake $HOME/nixcfg#$(hostname) # check for firmware upgrades fwupdmgr get-updates # print hard drive status info sudo smartctl -H /dev/nvme0n1 sudo zpool status -v -x
I actually just run the update commands individually when I feel like.
su -l 'pacman -Syu' # All regular packages pakku -Syu # All AUR packages (I know this updates regular packages, too.) flatpak-update # Update Flatpak packages with a function I wrote
Since I do not trust Flatpak (especially when it comes to driver updates and properly removing unused crap) I once created this monstrosity.
flatpak-update () { LATEST_NVIDIA=$(flatpak list | grep "GL.nvidia" | cut -f2 | cut -d '.' -f5) flatpak update flatpak remove --unused --delete-data flatpak list | grep org.freedesktop.Platform.GL32.nvidia- | cut -f2 | grep -v "$LATEST_NVIDIA" | xargs -o flatpak uninstall flatpak repair flatpak update }
The initial problem with Flatpak thinking it would be a good idea to add dozens of Nvidia drivers and re-download and update all of them on every update (causing a few gigabytes of downloaded files on every run of a normal
flatpak update
even if nothing needed to be updated) is reportedly fixed, but I just got used to my command.The initial problem with Flatpak thinking it would be a good idea to add dozens of Nvidia drivers and re-download and update all of them on every update (causing a few gigabytes of downloaded files on every run of a normal flatpak update even if nothing needed to be updated)
100% agree! Up until last year I was also using Nvidia and the Flatpak drivers for Nvidia got out of hand. I was using just a handful of applications in Flatpak, yet I had 6 different versions of the driver, each 350 MB and every of them was downloaded fully and updated every time. And that is besides other updates and other stuff. I would have needed your function so badly back then. :D
I don’t, because stuff like that is a little too touchy to wrap in a cute shell alias. If I’m going to update a box, I’m going to update a box. If I’m going to reboot a machine, I want to be reminded that I’m going to reboot a machine (which in turn is a reminder that there are other people using stuff there and not to fuck their days up without at least a little warning).
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.
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.
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.