You are not logged in.

#1 2018-05-15 13:15:24

strangelyput
Member
Registered: 2014-06-09
Posts: 8

Upgrading with --asdeps option bug or feature?

Upgrading with --asdeps, marks the packages being upgraded as implicitly installed. Is this the intended behavior?

This is problematic when installing package with, for instance:

# pacman -Syu <package_x> --asdeps

The result is not intuitive, as is would install the package_x as dependency but any upgrade that it does perform on the system, even if previously marked as explicitly installed, would be marked as implicit installation.
I would say this is a bug, but if it's not one it should at least be mentioned in the man pages and help of pacman.

Last edited by strangelyput (2018-05-15 13:17:00)

Offline

#2 2018-05-15 13:29:38

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: Upgrading with --asdeps option bug or feature?

It doesn't look like a bug to me, just a very bad idea.  Why would you add the "--asdeps" flag there?  It's doing exactly what it's supposed to.

How would you like it mentioned in the man page, it's pretty clear already:

man pacman wrote:

Install packages non-explicitly; in other words, fake their install reason to be installed as a dependency.

Last edited by Trilby (2018-05-15 13:33:10)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2018-05-15 13:32:09

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,783
Website

Re: Upgrading with --asdeps option bug or feature?

That's behaving as expected. Packages with existing database entries will retain their install reason during upgrades, and new packages will inherit the install reason you have provided.

If you want to alter the install reason for a currently installed package, use 'pacman -D'. EDIT: Looks like I'm completely wrong on this, see below.

Last edited by WorMzy (2018-05-15 13:56:03)


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#4 2018-05-15 13:42:14

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: Upgrading with --asdeps option bug or feature?

WorMzy, the OP is actually saying the opposite is happening (I think) which does seem to me to be the documented behavior.  All the packages upgraded (whether new or not) are being marked as dependencies.

I am not willing to try replicating this on my system (as the command itself is just a horrible idea to start with) but I can replicate with a single package that I already have installed:

$ pacman -Qi xorg-xrandr | grep Reason
Install Reason  : Explicitly installed

$ pacman -S xorg-xrandr --asdeps
...

$ pacman -Qi xorg-xrandr | grep Reason
Install Reason  : Installed as a dependency for another package

"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2018-05-15 13:55:19

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,783
Website

Re: Upgrading with --asdeps option bug or feature?

Huh, I'm not sure if that's changed in recent versions of pacman, or if it always did that and I'm just misremembering. Thanks for clarifying.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#6 2018-05-15 14:22:18

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Upgrading with --asdeps option bug or feature?

I'm fairly sure this is working as intended.

-Su will expand all available upgrades and add them to the explicit transaction list.
--asdeps will mark all packages in the explicit transaction list as "asdeps" (but should not modify the installation reason of existing installed packages which are upgraded only due to e.g. a versioned dependency requirement, which is sort of irrelevant when using -Su as it will still be on the explicit transaction list).

Passing either --asexplicit nor --asdeps will cause installation reasons for already-installed packages to be preserved.

So the root of the issue is you were expecting -Su to be something other than a simple alias for "pretend I explicitly listed every single package that has an available update".

tl;dr
You need two passes if you want to set the installation reason for only some packages. Or install explicitly then use -D to modify it after the fact.

Last edited by eschwartz (2018-05-15 14:23:31)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#7 2018-05-15 14:56:19

strangelyput
Member
Registered: 2014-06-09
Posts: 8

Re: Upgrading with --asdeps option bug or feature?

Eschwartz wrote:

So the root of the issue is you were expecting -Su to be something other than a simple alias for "pretend I explicitly listed every single package that has an available update".

Yes, I guess. But I would still say that the actual behavior is not what most people expect. Specially because you cannot possibly understand that from the help page.
But if this is as intended, you are absolutely right, this a very very bad idea, it should not even be possible. You could do much damage inadvertently, if you are not aware of this behavior like me (I have been using Arch for 3 or 4 years).

Maybe at least the help page should be changed?

Last edited by strangelyput (2018-05-15 15:05:00)

Offline

#8 2018-05-15 15:07:31

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: Upgrading with --asdeps option bug or feature?

strangelyput wrote:

Specially because you cannot possibly understand that from the help page.

No, you can't, apparently.  But don't make such claims about others.  It is perfectly intuitive - even obvious - to me from reading the man page.  It's ok if it isn't to you, but then elaborate on what is confusing to you, don't assume it is confusing for everyone.

---

strangelyput wrote:

... this a very very bad idea, it should not even be possible. You could do much damage inadvertently

There are countlessly many pacman commands you could use which would do much worse than this.

Doug Gwyn wrote:

UNIX was not designed to stop its users from doing stupid things, as that would also stop them from doing clever things.

---

strangelyput wrote:

Maybe at least the help page should be changed?

Trilby wrote:

How would you like it mentioned in the man page, it's pretty clear already...

Last edited by Trilby (2018-05-15 15:08:27)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#9 2018-05-15 15:10:20

strangelyput
Member
Registered: 2014-06-09
Posts: 8

Re: Upgrading with --asdeps option bug or feature?

Trilby wrote:

It doesn't look like a bug to me, just a very bad idea.  Why would you add the "--asdeps" flag there?  It's doing exactly what it's supposed to.

How would you like it mentioned in the man page, it's pretty clear already:

man pacman wrote:

Install packages non-explicitly; in other words, fake their install reason to be installed as a dependency.


Yes, but the problem is that any packages that are updated in the process change their "Install Reason". Maybe it's obvious for you that this would happen, but I would never expect this. Applying --asdeps basically randomly to packages is a bad ideia. And should not be possible. I cannot see any reason for this behavior.

Offline

#10 2018-05-15 15:12:10

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: Upgrading with --asdeps option bug or feature?

strangelyput wrote:

I cannot see any reason for this behavior.

I agree it's a bad idea.  I also cannot see any reason for it ... which is why I don't know why you did it.  But again, if you want to man page changed, suggest a change.  No one else could know what would make it clear to you, only you can tell us.

EDIT: I mean this quite matter-of-factly.  Rereading this might sound abrupt, but to me it's just fact: those who understand the man page the way it is written really can't suggest useful edits to make it clear to those who don't understand it.  As you are in the latter group you need to highlight what would make it more clear.

Last edited by Trilby (2018-05-15 15:13:26)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#11 2018-05-15 15:26:22

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Upgrading with --asdeps option bug or feature?

As Trilby said:

This seemed clear to me. Maybe this is from my perspective as someone who's involved in pacman development, but the fact remains clear... it seemed obvious to me. How can I document the unclear, if I don't realize it is in fact unclear?

You're asserting it is not clear to you. The best way to fix this is to tell us what would in fact make it clear to you. If you could help us improve our documentation, that can only be a good thing.

Feel free to suggest manpage updates, or even provide patches.
https://www.archlinux.org/pacman/#_bugs

Last edited by eschwartz (2018-05-15 15:27:27)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#12 2018-05-15 15:33:27

strangelyput
Member
Registered: 2014-06-09
Posts: 8

Re: Upgrading with --asdeps option bug or feature?

Trilby wrote:

I agree it's a bad idea.  I also cannot see any reason for it ... which is why I don't know why you did it.

Since partial upgrades are not suported and the suggested way to install packages is "pacman -Syu package_name". Using -Su with --asdeps should be discouraged. Which is not on any pacman documentation that I have looked at.


Eschwartz wrote:

Feel free to suggest manpage updates, or even provide patches.

I'll probably do that. Thank you all for the clarification.

Offline

#13 2018-05-15 15:39:44

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Upgrading with --asdeps option bug or feature?

But -Syu packagename works fine too, it assumes you're installing an explicitly installed package. -Syu && -S --asdeps packagename also works fine.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#14 2018-05-15 15:48:46

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,461

Re: Upgrading with --asdeps option bug or feature?

strangelyput wrote:

and the suggested way to install packages is "pacman -Syu package_name".

It is *a* way to install packages, I wouldn't say it is *the* way.

Offline

#15 2018-05-15 16:14:29

strangelyput
Member
Registered: 2014-06-09
Posts: 8

Re: Upgrading with --asdeps option bug or feature?

Since you guys don't see this as a problem, which I understand, and I'm not seeing an easy fix to the help page right now. I've edited the wiki, maybe it help someone in my position.

Offline

#16 2018-05-15 16:48:26

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Upgrading with --asdeps option bug or feature?

It would be slightly more intuitive if the --asdeps and --asexplicit options only applied to packages explicitly passed to pacman during the sync operation. Consider the two possibilities for the interpretation of "pacman -Syu --asdeps foo":

  1. Current situation: Install foo and all upgradable packages as dependencies. It is up to me to check which packages will be affected.

  2. Alternative: Install all upgradable packages as usual, and install foo as a dependency."

In the first case, I expect that it is of very limited use to change the install dependency of all upgradable packages given that this set depends on when the upgrade operation is run. Additional commands will always be required to determine which packages will be affected, unless a user is just randomly changing install reasons, which should have little practical use.

The second case allows a user to change the install reason of both upgradable packages and uninstalled packages in the same operation while remaining completely explicit.

The issue is trivial because it can always be resolved with

$ pacman -Syu foo
$ pacman -D --asdeps foo

but the current behavior is less useful than the one expected by OP (and likely others). Given a choice between an operation that applies changes to a variable set of packages with possible consequences for system stability when apparent deps are removed, and one which only applies changes explicitly requested by the user, with no other obvious effects on usuability, I would opt for the latter. In my opinion, the second option is of greater practical value. Of course, I expect that pacman maintains a simple internal list of packages for the sync operation and simply appends upgradable packages and dependencies to a common list along with the explicitly requested package.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

Board footer

Powered by FluxBB