Apr 11, 2023, 3:33 AM
Post #12 of 19
(292 views)
Permalink
julien@jroy.ca wrote:
> On Mon, 2023-04-10 at 22:10 -0600, thelma@sys-concept.com wrote:
>> On 4/10/23 18:53, Dale wrote:
>>
>>
>> I've asked ChatGPT for explanation and here is what I got:
>>
>> Here are the differences between emerge -U and emerge -N:
>>
>> emerge -U: This option upgrades the specified package(s) to the
>> latest available version. It will first download the new version,
>> then build and install it. If a dependency of the package being
>> upgraded also needs to be upgraded, it will also be upgraded.
>>
>> emerge -N: This option installs the specified package(s) without
>> upgrading any dependencies. It will only download and install the
>> package(s) if they are not already installed. If any dependencies of
>> the package(s) are not already installed, the command will fail.
>>
>> In other words, emerge -U upgrades packages and their dependencies,
>> while emerge -N only installs packages without upgrading any
>> dependencies.
>>
> This is a good example of why ChatGPT cannot be trusted.
> When ChatGPT doesn't know the answer to something, rather than saying
> it doesn't know the answer, it just makes it up.
>
> The difference between -U and -N as explained by ChatGPT is wrong; in
> fact, it has nothing to do with dependencies.
>
> To have a truthful answer, let's not ask ChatGPT and instead look at
> `man 5 emerge`:
>
> --newuse, -N
> Tells emerge to include installed packages where USE
> flags have changed since compilation. This option also
> implies the --selective option. USE flag changes
> include:
>
> A USE flag was added to a package. A USE flag was
> removed from a package. A USE flag was
> turned on for
> a package. A USE flag was turned off for a package.
>
> --changed-use, -U
> Tells emerge to include installed packages where USE
> flags have changed since installation. This option
> also implies the --selective option. Unlike --newuse,
> the --changed-use option does not trigger
> reinstallation when flags that the user has not
> enabled are added orremoved.
>
> In a nutshell, `--newuse` or `-N` rebuilds packages when USE flags have
> changed, regardless of whether the changed USE flags affect the outcome
> Where as `--changed-use` or `-U` rebuilds packages when the USE flags
> have changed, AND the changed USE flags affect the outcome.
>
> For example, suppose you are on an openRC system, and a package
> introduces a new `systemd` USE flag;
> With `-N`: this package will be rebuilt with `-systemd`
> With `-U`: this package will not be rebuilt
>
The info from the man page is correct. They do two different things.
The -N will mean more recompiles of packages but it also means that when
a USE flag change is made, it also changes any packages that relates to
that. In other words, it goes deeper.
What all this comes down to, how stable and how consistent do you want
your system to be? On some systems, it may get away with doing it the
quick and fast way. In some cases it may not. It seemed to me that for
my system, going a bit deeper worked better for me. I'd rather rebuild
more packages and have a more stable system than take a quicker way and
have problems every once in a while. If one wants to try the shorter
way, see if it works for them, then that can be done. If it works,
great. If not, switching to a method that takes longer and sorts
through more packages may be needed. It's all up to the person sitting
in the chair.
Dale
:-) :-)