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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Bret Busby-2
On 06/11/2020, Colin Watson <[hidden email]> wrote:

> On Fri, Nov 06, 2020 at 02:45:51PM +0100, Liam Proven wrote:
>> `apt upgrade` is the equivalent of `apt-get upgrade`. It installs new
>> versions of existing packages but it will not add packages or
>> additional dependencies.
>
> Not quite.  "apt-get upgrade" will never add packages (it will instead
> hold upgrades if there are new dependencies that require adding
> packages), while "apt upgrade" will add packages if necessary to satisfy
> new dependencies.
>
> Neither will ever *remove* packages, though.
>
> My understanding is that the reason for this change in semantics from
> "apt-get upgrade" to "apt upgrade" is that needing to add packages is
> quite common across things like library ABI changes and is generally
> relatively harmless, so the behaviour of "apt-get upgrade" was a bit too
> annoyingly conservative in practice.
>
>> `apt full-upgrade` is the equivalent of the old `apt-get
>> dist-upgrade`. If a new version needs a new dependency or library or
>> something, it will do it.
>
> As does "apt upgrade" (but not "apt-get upgrade").  The difference
> between "apt upgrade" and "apt full-upgrade" is that the former will
> hold upgrades if there are new conflicts that require removing packages,
> while the latter will remove packages if necessary to satisfy new
> conflicts.
>
> (I agree with the recommendation to use "apt full-upgrade" in most
> cases.)
>
> --
> Colin Watson (he/him)                              [[hidden email]]
>

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.


--
Bret Busby
Armadale
West Australia
..............

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

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

Colin Watson
On Fri, Nov 06, 2020 at 09:59:04PM +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

In that, you can just replace "apt-get" with "apt" and "dist-upgrade"
with "full-upgrade".  No real functional difference, just more concise
and clearer ("dist-upgrade" has long been a rather misleading name).

--
Colin Watson (he/him)                              [[hidden email]]

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

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

ubuntu-users mailing list
In reply to this post by Bret Busby-2
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.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

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

Chris Green
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

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

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

Liam Proven
In reply to this post by Bret Busby-2
On Fri, 6 Nov 2020 at 23:01, Bret Busby <[hidden email]> 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

From my perspective, you have the switches before the command, and
you're using the old apt-get command instead of the modern
replacement.

I save the following in my command history:

apt update ; apt full-upgrade -y ; apt autoremove -y ; apt purge ; apt clean

I know Ralf et al will disapprove, but I don't care about being nagged
about supplemental packages. Just do it and get out of my way.

AIUI `&&` only does the next command if the previous one succeeded
whereas `;` just carries on. I don't care. Do as much as you can and
get out of my way. Also, it's less typing.


--
Liam Proven – Profile: https://about.me/liamproven
Email: [hidden email] – gMail/gTalk/gHangouts: [hidden email]
Twitter/Facebook/LinkedIn/Flickr: lproven – Skype: liamproven
UK: +44 7939-087884 – ČR (+ WhatsApp/Telegram/Signal): +420 702 829 053

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users