apt and apt-get - was Re: follow-up (and problems) about: recommendation for all-in-one printer?

Chris Green cl at isbd.net
Sat Nov 7 10:26:50 UTC 2020


On Sat, Nov 07, 2020 at 01:10:54AM +0100, Ralf Mardorf via ubuntu-users wrote:
> 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.
> 
Yes, agreed, why not simply run the individual commands at the prompt,
and avoid all those sudo prefixes (see below).

[snip]

I simply do:-

    sudo -i

followed by (at the root prompt):-

    apt update
    apt upgrade
    apt autoremove
    apt clean

I only do the 'apt clean' occasionally, it clears out the apt cache
which can clear quite a bit of space.  An alternative is 'apt
autoclean', look at the apt-get man page to see exactly what they do
(it does what that 'mv' command does basically).


-- 
Chris Green




More information about the ubuntu-users mailing list