Pacman

Historical bug tracker for the Pacman package manager.

The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues

This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
Tasklist

FS#53813 - [pacman] By default do not install an ignored package

Attached to Project: Pacman
Opened by Filippo Squillace (feel) - Tuesday, 25 April 2017, 08:32 GMT
Last edited by Doug Newgard (Scimmia) - Tuesday, 25 April 2017, 13:38 GMT
Task Type Bug Report
Category Packages: Core
Status Unconfirmed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 1
Private No

Details

Description:
In order to make automation easier, by default pacman should avoid installing ignored packages (with --ignore options).
Currently, it seems there is not an easy way to ignore some packages from a package group.

Additional info:
* Pacman 5.0.1-5

Steps to reproduce:

sudo pacman -S --noconfirm --ignore sudo base-devel
:: sudo is in IgnorePkg/IgnoreGroup. Install anyway? [Y/n]
....
....
....
This task depends upon

Comment by Andrew Gregory (andrewgregory) - Monday, 01 May 2017, 22:34 GMT
Why should it default to no? sudo is a member of base-devel and you told it to install base-devel. IgnorePkg is not for preventing packages from being installed, it is for preventing packages from being upgraded. You can exclude specific group members by combining `pacman -Sgq` with `grep -v`: `pacman -Sgq base-devel | grep -Fvx sudo | sudo pacman -S -`.
Comment by Filippo Squillace (feel) - Thursday, 04 May 2017, 08:11 GMT
If the purpose of the option `--ignore` is to be used for upgrades only, it looks to me that such option has a hidden behavior. I see `--ignore` option useful for a more generic reason.
Personally, if I read something like: `pacman --ignore sudo ....` I naturally translates it as: "Whatever operation pacman will perform, ignore sudo package".

Even from an example without package groups like: `pacman --ignore sudo -S grep awk sudo` should ignore installing `sudo` package. This is particularly useful for building programs upon pacman when you do not know a priori the packages involved for the given operation.

As I did not know the actual option behavior (my bad, I should have read the pacman man better), more than a bug fix consider this as a potential feature.
Comment by Andrew Gregory (andrewgregory) - Thursday, 04 May 2017, 12:24 GMT
Yes, the option is poorly named, but that example is just silly. Why would you explicitly tell pacman to install sudo if you didn't want it installed?

This change might make your particular use easier, but it would come at the expense of other possible uses. For instance, how would a tool install/update an ignored package if we change this default?
Comment by Filippo Squillace (feel) - Friday, 05 May 2017, 21:01 GMT
Let me give you a better example. Let's suppose you have a pacman wrapper script like this:
```
#!/bin/bash
pacman --ignore sudo $@
```

The script will let to the user decide which packages to install/update, whereas it is the program to enforce that installation/upgrade of sudo package should not be allowed. Such option is truly useful for expressing the need of ignoring packages when performing any pacman operations. If that's not the case, it is just misleading IMHO.

In this way `--ignore` can be used in the circumstances:
- ignore a specific package in a package group
- ignore a package specified from cli (the example above)

for any pacman operation (install/upgrade for instance).

About: "For instance, how would a tool install/update an ignored package if we change this default?"
If a package is considered ignored, it means it is not supposed to be installed/updated by all means. In this case you just simply do not need to use `--ignore` at all.
Comment by Andrew Gregory (andrewgregory) - Friday, 05 May 2017, 21:24 GMT
I am afraid this example is no better. First, it is functionally equivalent to just using IgnorePkg in pacman.conf. Second, I still do not understand why you would want a wrapper that would fail to install packages explicitly requested. What is the use case for a wrapper that does not do what it is explicitly told to do?

Again, --ignore is not some "pretend I did not tell you to install this package even though I really did" flag; it prevents updates to installed packages. Updating an ignored package is not all that uncommon. It is used to prevent the automatic update of important packages, like the kernel, to allow the user to manually update them at more appropriate times by explicitly providing them.
Comment by Filippo Squillace (feel) - Friday, 05 May 2017, 21:29 GMT
There is even a better reason why `--ignore` should behave differently. Let's suppose you want to build your own Arch based distro but for some reason such distro requires a different implementation of `sudo` in a package called `mysudo` (let's suppose this conflict with `sudo` package and is located in AUR).

In order to let the user still transparently use `pacman` command you need to ensure the user will not install `sudo` package by mistake.

With the solution I am providing this is feasible. In fact, you just need to change `/etc/pacman.conf` with the content:
IgnorePkg = sudo

In this way whatever the user will do on `sudo` package it cannot be installed.


With the current solution pacman has, pacman will sadly override `mysudo` package with `sudo` instead.
For this use case the solution you provided `pacman -Sgq base-devel | grep -Fvx sudo | sudo pacman -S -` cannot be useful as it enforces the user to explicitly ignore the `sudo` package.

Again, a quite misleading behavior IMHO.

I expressed the concerns but if you do not feel this task is so much valuable feel free to close this.
Comment by Eli Schwartz (eschwartz) - Wednesday, 13 December 2017, 21:51 GMT
I'd say instead, the mysudo package should provide/conflict/replace the sudo package.
Comment by Filippo Squillace (feel) - Friday, 17 February 2023, 22:05 GMT
After six years someone finally understood the importance of this issue! With version 6.0.2 I can finally use pacman as expected.

```
pacman -Syu --ignore sudo base-devel
...
<guess what???? it just ignores sudo and does not prompt!>
...
```


Whoever did it, a huge thanks to you!

Loading...