0

I currently use this handy alias I call "updt" on a daily basis in the following manner:

alias updt='sudo apt update -y && sudo apt upgrade -y'

I was wondering if anything could possibly go wrong if I changed it to this:

alias updt='sudo apt update -y && sudo apt full-upgrade -y && sudo apt autoremove -y'

Could I face any unintended consequences like instability or broken software in general? Be advised that I'm very new to Linux.

1

1 Answer 1

3

Lots of terrible things are possible. It's a big world. You can make those terrible things less likely several ways:

  1. Read output instead of suppressing it. The output is there to tell you what is happening. It's there to tell you what went wrong. On a bad day, you NEED it.

  2. Avoid using the -y flag: Confirmation dialogs are the brightly-painted guardrails that keep your car from flying off the cliff into the sea. Use it for the intended purpose.

  3. Learn how to use Unattended Upgrades (built into apt) instead of hacking together your own script. UU will happily update/upgrade your system in the background daily, has many configuration options, can pull from only certain repos if you so choose, and can be triggered either by you (sudo unattended-upgrade) or by a cron job/systemd timer. It's smart enough to only run once daily regardless of triggering method, and you already have it as part of apt.

YES, it's possible for an apt-update/upgrade to cause problems with your system. However, the human admin is almost always the real cause of the disaster - they ignored months of warning messages, they added an unofficial or wrong-release repo, they unwittingly removed a critical lib or application, they installed some conflicting software they found on some random github site, etc.

You must log in to answer this question.