• Which tool for upgrade in commandline?

    From Hans@21:1/5 to All on Tue Aug 27 21:10:01 2024
    Dear list,

    over the many years we got different tools for upgrading debian in the commandline. These tools behave differently and also we get different results, when eecuting.

    First, we have the oldest, whcih is apt-get.
    apt-get update, apt-get upgrade or apt-get full-upgrade does a good job.

    However, we also have aptitude, but
    aptitude update, aptitude upgrade and aptitude full-upgrade are doing also a good job, but not the same as apt-get does. Also it looks, aptitude update loads its own list and is not using the list from apt-get (otherwise it could not explain, why aptitude and apt-get every time reloads the new list, when
    one of the other was eecuted before). Also the dependencies in both tools are handled different.

    And at last, we have apt, which (as far as I now), soemtimes is calling apt- get, and sometimes is calling aptitude.

    This is somehow rather irritating!

    So, my question is: Which one is recommended, when updating and upgrading is used in a script, so that it causes as little as possible pain?

    It means: When the script is not eecuted daily, but let us say, every two weeks, and we have lots of packages.

    At the moment I am using aptitude, this works great in short periods, but
    after al longer time, it crashes, because some dependencies could not resolve.

    Independent of my personal use: Which one is recommended?

    Thanks for reading. Short answer will be ok.

    Best

    Hans

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael =?utf-8?B?S2rDtnJsaW5n?=@21:1/5 to All on Tue Aug 27 21:30:01 2024
    On 27 Aug 2024 21:03 +0200, from hans.ullrich@loop.de (Hans):
    So, my question is: Which one is recommended, when updating and upgrading is used in a script, so that it causes as little as possible pain?

    apt-get and friends, including the dpkg set of tools if necessary.

    I believe apt even prints a message to that effect when started.

    See also the introductory paragraph of the apt(8) man page.

    --
    Michael Kjörling 🔗 https://michael.kjorling.se “Remember when, on the Internet, nobody cared that you were a dog?”

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eike Lantzsch ZP5CGE / KY4PZ@21:1/5 to All on Tue Aug 27 21:30:01 2024
    On Tuesday, 27 August 2024 15:03:02 -04 Hans wrote:
    Dear list,

    over the many years we got different tools for upgrading debian in the commandline. These tools behave differently and also we get different results, when eecuting.

    First, we have the oldest, whcih is apt-get.
    apt-get update, apt-get upgrade or apt-get full-upgrade does a good
    job.

    However, we also have aptitude, but
    aptitude update, aptitude upgrade and aptitude full-upgrade are doing
    also a good job, but not the same as apt-get does. Also it looks,
    aptitude update loads its own list and is not using the list from
    apt-get (otherwise it could not explain, why aptitude and apt-get
    every time reloads the new list, when one of the other was eecuted
    before). Also the dependencies in both tools are handled different.

    And at last, we have apt, which (as far as I now), soemtimes is
    calling apt- get, and sometimes is calling aptitude.

    This is somehow rather irritating!

    Do you really mean irritating or just confusing?
    "irritating" equals the German "verrgert"; while
    "confusing" is what Germans just find "irritierend".
    :-)


    So, my question is: Which one is recommended, when updating and
    upgrading is used in a script, so that it causes as little as
    possible pain?

    It means: When the script is not eecuted daily, but let us say, every
    two weeks, and we have lots of packages.

    At the moment I am using aptitude, this works great in short periods,
    but after al longer time, it crashes, because some dependencies could
    not resolve.

    Independent of my personal use: Which one is recommended?

    Thanks for reading. Short answer will be ok.

    Best

    Hans

    I'd like to know too. I usually use apt. Sometimes aptitude when I'm
    looking for something - me being lazy. But I find aptitude to be
    inconvenient when trying to resolve dependency problems. Packages which aptitude will not purge can easily be deinstalled, including all
    configuration files, by invoking apt purge for example.

    All the best
    --
    Eike Lantzsch KY4PZ / ZP5CGE

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andrew M.A. Cater@21:1/5 to Hans on Tue Aug 27 21:30:01 2024
    On Tue, Aug 27, 2024 at 09:03:02PM +0200, Hans wrote:
    Dear list,

    This is somehow rather irritating!

    So, my question is: Which one is recommended, when updating and upgrading is used in a script, so that it causes as little as possible pain?


    apt-get is potentially the most basic. Aptitude resolves dependencies differently and sometimes more effectively. Apt as such I don't use (even though I named the whole idea :) )

    apt-get normally "just works" which is why it is recommended for upgrading between Debian major releases.

    It means: When the script is not eecuted daily, but let us say, every two weeks, and we have lots of packages.


    There is something about the number of packages installed at once and interdependencies - maybe run whichever more often. Installing 20 packages
    at a time may be easier than installing 80 packages at once, for example.

    At the moment I am using aptitude, this works great in short periods, but after al longer time, it crashes, because some dependencies could not resolve.

    Independent of my personal use: Which one is recommended?


    Whichever one works for you ... there is no definitive answer.

    Thanks for reading. Short answer will be ok.

    ok - the short answer you already predicted :)

    Best

    Hans


    All the very best, as ever,

    Andy
    (amacater@debian.org)




    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael =?utf-8?B?S2rDtnJsaW5n?=@21:1/5 to All on Tue Aug 27 21:40:01 2024
    On 27 Aug 2024 19:28 +0000, from amacater@einval.com (Andrew M.A. Cater):
    apt-get [...] is recommended for upgrading between Debian major releases.

    Is it, though?

    https://www.debian.org/releases/stable/amd64/release-notes/ch-upgrading.en.html#updating-lists

    https://www.debian.org/releases/stable/amd64/release-notes/ch-upgrading.en.html#minimal-upgrade

    https://www.debian.org/releases/stable/amd64/release-notes/ch-upgrading.en.html#upgrading-full

    `apt` is named as the primary tool and the example command lines use
    it; `apt-get` is mentioned in a couple of corresponding notes,
    particularly with regards to its benefits when used from scripts.

    --
    Michael Kjörling 🔗 https://michael.kjorling.se “Remember when, on the Internet, nobody cared that you were a dog?”

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Joe@21:1/5 to Hans on Tue Aug 27 21:40:01 2024
    On Tue, 27 Aug 2024 21:03:02 +0200
    Hans <hans.ullrich@loop.de> wrote:

    Dear list,

    over the many years we got different tools for upgrading debian in
    the commandline. These tools behave differently and also we get
    different results, when eecuting.

    First, we have the oldest, whcih is apt-get.
    apt-get update, apt-get upgrade or apt-get full-upgrade does a good
    job.

    However, we also have aptitude, but
    aptitude update, aptitude upgrade and aptitude full-upgrade are doing
    also a good job, but not the same as apt-get does. Also it looks,
    aptitude update loads its own list and is not using the list from
    apt-get (otherwise it could not explain, why aptitude and apt-get
    every time reloads the new list, when one of the other was eecuted
    before). Also the dependencies in both tools are handled different.

    I believe they use different cache structures, and if tool A has been
    used since tool B was last used, next time tool B is used it will not
    know what has been upgraded while it has 'been away', and will refresh
    its own cache.

    And at last, we have apt, which (as far as I now), soemtimes is
    calling apt- get, and sometimes is calling aptitude.

    This is somehow rather irritating!

    So, my question is: Which one is recommended, when updating and
    upgrading is used in a script, so that it causes as little as
    possible pain?

    It means: When the script is not eecuted daily, but let us say, every
    two weeks, and we have lots of packages.

    At the moment I am using aptitude, this works great in short periods,
    but after al longer time, it crashes, because some dependencies could
    not resolve.

    Independent of my personal use: Which one is recommended?


    I believe apt is currently recommended. Having said that, sometimes the
    upgrade notes for a new Stable recommend using a particular tool, and
    obviously you would go with that advice. I seem to recall that apt will
    not just use one of the earlier upgrade tools, but will do a bit of
    tidying up afterwards. With the earlier tools, the package cache has to
    be manually cleared periodically.

    My experience of apt-get and aptitude is that aptitude has a better
    resolver and will often clear a medium-sized pile of packages when
    apt-get won't. However, it achieves this improved performance at the
    expense of speed and simplicity. If you run Unstable, especially, and
    leave upgrading too long, aptitude can be overwhelmed by several hundred packages to organise, and will apparently just hang. Aptitude should be
    fine on Stable, which should never have more than about a dozen
    packages upgradable, unless you leave it for many months. I'd still use
    apt.

    --
    Joe

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bret Busby@21:1/5 to Hans on Tue Aug 27 22:30:01 2024
    On 28/8/24 03:03, Hans wrote:
    Dear list,

    over the many years we got different tools for upgrading debian in the commandline. These tools behave differently and also we get different results,
    when eecuting.

    First, we have the oldest, whcih is apt-get.
    apt-get update, apt-get upgrade or apt-get full-upgrade does a good job.

    However, we also have aptitude, but
    aptitude update, aptitude upgrade and aptitude full-upgrade are doing also a good job, but not the same as apt-get does. Also it looks, aptitude update loads its own list and is not using the list from apt-get (otherwise it could not explain, why aptitude and apt-get every time reloads the new list, when one of the other was eecuted before). Also the dependencies in both tools are handled different.

    And at last, we have apt, which (as far as I now), soemtimes is calling apt- get, and sometimes is calling aptitude.

    This is somehow rather irritating!

    So, my question is: Which one is recommended, when updating and upgrading is used in a script, so that it causes as little as possible pain?

    It means: When the script is not eecuted daily, but let us say, every two weeks, and we have lots of packages.

    At the moment I am using aptitude, this works great in short periods, but after al longer time, it crashes, because some dependencies could not resolve.

    Independent of my personal use: Which one is recommended?

    Thanks for reading. Short answer will be ok.

    Best

    Hans




    apt update && apt full-upgrade -y && apt autoremove -y && apt autoclean

    Simple.

    ..
    Bret Busby
    Armadale
    West Australia
    (UTC+0800)
    ..............

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andy Smith@21:1/5 to Bret Busby on Tue Aug 27 22:50:02 2024
    Hi,

    On Wed, Aug 28, 2024 at 04:25:20AM +0800, Bret Busby wrote:
    On 28/8/24 03:03, Hans wrote:
    So, my question is: Which one is recommended, when updating and upgrading is
    used in a script, so that it causes as little as possible pain?

    […]

    apt update && apt full-upgrade -y && apt autoremove -y && apt autoclean

    "apt" will say when it is used in a script that its user interface
    is not yet stable (i.e. its output could change at any time) so it
    should not be used in scripts.

    Other replies have already covered the correct answer for
    non-interactive use.

    Thanks,
    Andy

    --
    https://bitfolk.com/ -- No-nonsense VPS hosting

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Wright@21:1/5 to Joe on Wed Aug 28 06:50:01 2024
    On Tue 27 Aug 2024 at 20:32:04 (+0100), Joe wrote:
    On Tue, 27 Aug 2024 21:03:02 +0200 Hans wrote:

    First, we have the oldest, whcih is apt-get.
    apt-get update, apt-get upgrade or apt-get full-upgrade does a good
    job.

    So, my question is: Which one is recommended, when updating and
    upgrading is used in a script, so that it causes as little as
    possible pain?

    It means: When the script is not eecuted daily, but let us say, every
    two weeks, and we have lots of packages.

    At the moment I am using aptitude, this works great in short periods,
    but after al longer time, it crashes, because some dependencies could
    not resolve.

    Independent of my personal use: Which one is recommended?

    For scripts, apt-get has the advantage that it doesn't get changed
    from release to release, but always behaves the same way.

    I believe apt is currently recommended. Having said that, sometimes the upgrade notes for a new Stable recommend using a particular tool, and obviously you would go with that advice. I seem to recall that apt will
    not just use one of the earlier upgrade tools, but will do a bit of
    tidying up afterwards. With the earlier tools, the package cache has to
    be manually cleared periodically.

    For upgrading one release to another, apt is currently recommended,
    but I think it's assumed that you do this by typing the commands
    rather than just running a script, so you can check for success at
    each step.

    My experience of apt-get and aptitude is that aptitude has a better
    resolver and will often clear a medium-sized pile of packages when
    apt-get won't. However, it achieves this improved performance at the
    expense of speed and simplicity. If you run Unstable, especially, and
    leave upgrading too long, aptitude can be overwhelmed by several hundred packages to organise, and will apparently just hang. Aptitude should be
    fine on Stable, which should never have more than about a dozen
    packages upgradable, unless you leave it for many months. I'd still use
    apt.

    With anything up to stable, I've never had a problem using apt-get.
    For example, last week I upgraded a buster (oldoldstable) system that
    was last upgraded in early March. A mere 171 packages with one command.

    But sure, for testing and beyond, the quirks in the resolvers will
    make a difference as there are more packages to upgrade and not even
    a guarantee that the distribution is complete.

    Cheers,
    David.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?J=C3=B6rg-Volker_Peetz?=@21:1/5 to All on Wed Aug 28 16:00:01 2024
    See also
    Debian Reference
    Chapter 2. Debian package management
    2.2.1. apt vs. apt-get / apt-cache vs. aptitude

    https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_literal_apt_literal_vs_literal_apt_get_literal_literal_apt_cache_literal_vs_literal_aptitude_literal

    Regards,
    Jörg.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)