Skip to main content

Bashrc Update Alias

These days we have all sorts of methods for updating software on Linux systems. Personally, I have systems running Fedora, Ubuntu, both with flatpaks & snaps.

Wouldn't it be nice to have a single bash alias for updating your local system, regardless of origin?

This is my update alias used across all systems, dumped into my ~/.bashrc file

alias updoots="sudo su -c ' \
  hash apt 2>/dev/null && \
    apt update && \
    apt dist-upgrade -y && \
    apt autoremove --purge -y && \
    apt autoclean; \
  hash dnf 2>/dev/null && \
    dnf update -y && \
    dnf autoremove -y; \
  hash flatpak 2>/dev/null && \
    flatpak update -y && \
    flatpak uninstall --unused -y; \
  hash snap 2>/dev/null && \
    snap refresh; \
  '"