apt and apt-get - was Re: follow-up (and problems) about: recommendation for all-in-one printer?
Ralf Mardorf
kde.lists at yahoo.com
Sat Nov 7 00:10:54 UTC 2020
On Fri, 6 Nov 2020 21:59:04 +0000, Bret Busby wrote:
>So, for clarity, what then, is the better syntax for the following
>command?
>
>sudo apt-get -y update && sudo apt-get -y dist-upgrade && sudo apt-get
>-y autoremove && sudo apt-get -y autoclean
>
>Thank you in anticipation.
While the yes flag is appropriate for one or the other script usage,
it's completely inappropriate for general usage. As a matter of
principle always read the output, even if you think that you anyway
don't have the skills to rate all the output. You never know, there
might be output you do understand and if you read it, you might decide
to chose a "no".
That's what I usually run:
sudo apt update && \
sudo apt-file update && \
sudo auto-apt updatedb && \
sudo auto-apt update-local && \
sudo apt full-upgrade && \
sudo apt autoremove
sudo mv -i /var/cache/apt/archives/* /root/tmp_trash/
In the above case the && approach might not be to everybody's taste.
You probably want to run:
sudo apt update && \
sudo apt full-upgrade && \
sudo apt autoremove
There might be cases when running
sudo apt update && \
sudo apt upgrade
and then to check if
sudo apt full-upgrade
would change something, might make sense. If so, then definitively by
not using the yes flag. At the moment I can't imagine anything
for a regular, no third party repository and/or no local installs
tainted desktop Ubuntu, that running "upgrade" could be good for, just
running "full-upgrade" should be required. After that run
sudo apt autoremove
How to manage the cache depends on your maintenance and/or backup
strategy. Yes, you could use clean or autoclean.
More information about the ubuntu-users
mailing list