Routine system update failed (Ubuntu 22.04.4 LTS)
Ralf Mardorf
kde.lists at yahoo.com
Sat Sep 21 16:10:11 UTC 2024
On Sun, 2024-09-22 at 00:38 +1000, Karl Auer wrote:
> On Sat, 2024-09-21 at 16:23 +0200, Ralf Mardorf via ubuntu-users
> wrote:
> > Or do it vice versa like this:
> >
> > sudo apt update || exit
> > sudo apt autoremove || exit
> > sudo apt clean || exit
>
> What?!?
>
> for x in update autoremove clean ; do
> {
> sudo apt $x || exit
> }
> done
This is just an easy explanation. A loop does make it unnecessary
complex. Actually I would also add a value to the "exit" command, e.g.
"exit 1".
However, it's also to consider to use "set -e" / "set +e".
More information about the ubuntu-users
mailing list