Web lists-archives.com

Re: apt 101 (was: Re: More info)




On Fri, Oct 05, 2018 at 11:03:31AM -0400, rhkramer@xxxxxxxxx wrote:
> On Friday, October 05, 2018 07:25:29 AM Reco wrote:
> > On Fri, Oct 05, 2018 at 07:03:13AM -0400, rhkramer@xxxxxxxxx wrote:
> > > Can someone describe (or point to) a description of how dist-upgrade
> > > determines the more important app?  (Oh, I'm guessing it has to do with
> > > the whatever it is called label on each package, something like
> > > required, recommended, ... (I may be using the wrong words).  Supposed
> > > dist-upgrade has to choose between two packages that have the same
> > > label?
> > 
> > I'm afraid I lost you here.
> > Is 'more important' refers to dependency alternatives? Package
> > priorities? Something else?
> > By 'label' did you mean 'Tag' field or something else?
> > 
> > Let's try to do it this way.
> > Execute 'apt show bash', observe there result.
> > Ask your question once more, but this time use 'apt show bash' as a
> > guide.
> 
> Thanks for your reply!
> 
> Ok, I ran 
> <quote>
> root@s31:~# apt show bash
> Package: bash
<your_usual_stable_bash_was here.>
> </quote>
> 
> I'm not sure I know enough to re-phrase the question. I'm also surprised / 
> confused to see the two tags: "Essential: yes" and "Priority: required" -- I 
> presume that is not redundant information, but at first glance it seems so.

Ok, let's start from the beginning.
Any package has a name, that's 'Package:'.
Any package has a version, that's 'Version:'.
Any package has 'Priority' field, that matters to Debian-Installer very
much, and does not matter to anyone else.

You do not remove a package designated as 'Essential' as it *will* break
your installation. An attempt to remove Essential package via apt-get
should force apt-get to display very verbose confirmation dialog.

Nearly any package has tags ('Tag:' field), only used for searching.

These package fields have nothing to do with upgrades.


> Anyway, I am just "fishing" for information on how dist-upgrade decides which 
> package is more important to install (when faced with such  a decision).

In a nutshell:

All installed packages are evaluated for the need of version bump aka
upgrade.
If package dependencies ('Depends', 'Recommends') require something
that's not installed it's included in the installation list.
If package's 'Depends' field contains several entities separated by pipe
symbol - the first of this gets installed unless other entity is
required by another package.
If new package's 'Conflicts' field contain something that's installed it
will be de-installed.


> I suppose I can live without knowing that ;-)

'apt-get -s dist-upgrade' will keep this sacred knowledge to itself so
you won't have to ☺

Reco