[arch-general] Installing base unattended without specific packages
Hey fellow Arch Users, I am currently playing around with the GitLab CI and automatic building of Arch packages. My modified Arch Linux Docker image should include base and base- devel, but without all of the kernel and hardware stuff. This is the command, that does not work as expected: pacman -Syu --needed --noconfirm --noprogressbar --ignore linux,linux- firmware base base-devel git The packages linux and linux-firmware still get installed. I would prefer if there would be a way to install base, but without all of the irrelevant stuff for containers. I would propose something like base-container for this group. Kind regards,-- Sefa Eyeoglu Free Software Developer scrumplex.net[1] -------- [1] https://scrumplex.net
On 14.05.2019 23:08, Sefa Eyeoglu via arch-general wrote:
Hey fellow Arch Users,
I am currently playing around with the GitLab CI and automatic building of Arch packages. My modified Arch Linux Docker image should include base and base- devel, but without all of the kernel and hardware stuff. This is the command, that does not work as expected:
pacman -Syu --needed --noconfirm --noprogressbar --ignore linux,linux- firmware base base-devel git
The packages linux and linux-firmware still get installed. I would prefer if there would be a way to install base, but without all of the irrelevant stuff for containers. I would propose something like base-container for this group.
Hi Sefa, that has been discussed extensively without any firm solution so far. Latest example: https://lists.archlinux.org/pipermail/arch-dev-public/2019-March/029491.html Regards, Khorne
On 5/14/19 11:08 PM, Sefa Eyeoglu via arch-general wrote:
This is the command, that does not work as expected:
pacman -Syu --needed --noconfirm --noprogressbar --ignore linux,linux- firmware base base-devel git
simply repeat the --ignore option instead of trying to delimit the parameter somehow. --ignore linux --ignore linux-firmware -- Rob (coderobe) O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
On 5/14/19 5:08 PM, Sefa Eyeoglu via arch-general wrote:
Hey fellow Arch Users,
I am currently playing around with the GitLab CI and automatic building of Arch packages. My modified Arch Linux Docker image should include base and base- devel, but without all of the kernel and hardware stuff. This is the command, that does not work as expected:
pacman -Syu --needed --noconfirm --noprogressbar --ignore linux,linux- firmware base base-devel git
The packages linux and linux-firmware still get installed. I would prefer if there would be a way to install base, but without all of the irrelevant stuff for containers. I would propose something like base-container for this group.
The --ignore flag does not do what you think it does, it just has the same result as if you had listed it in pacman.conf in IgnorePkg Note the documentation: "Directs pacman to ignore upgrades of package even if there is one available." If you explicitly specify both packages on the command-line (which you did when you listed "base") then they will still get installed. Actually, pacman will interactively prompt you about whether you actually want to install them, and --noconfirm will default to "yes". This is relevant e.g. when you have "linux" ignored because you don't want to upgrade it with every pacman -Syu, but you do want to, occasionally, update it manually -- if IgnorePkg stopped you from specifying it on the command line, then it would be literally impossible to ever update, without modifying your config files in /etc, then running a manual update, then reverting your config files in /etc. I do not foresee us changing --ignorepkg to operate with a different codepath following different rules that differ from IgnorePkg, both because I think this is misuse of the feature, and because users will then confuse the two and think they are the same when they are not. ... OTOH you can achieve your desired goal like this: $ pacman -Sqg base| grep -Fxv -f <(printf 'linux-firmware\nlinux\n') # see list of packages in base, minus two that you want to exclude This list can be further piped to pacman -S - -- Eli Schwartz Bug Wrangler and Trusted User
On Mittwoch, 15. Mai 2019 15:12:13 CEST Eli Schwartz via arch-general wrote:
On 5/14/19 5:08 PM, Sefa Eyeoglu via arch-general wrote:
Hey fellow Arch Users,
I am currently playing around with the GitLab CI and automatic building of Arch packages. My modified Arch Linux Docker image should include base and base- devel, but without all of the kernel and hardware stuff. This is the command, that does not work as expected:
pacman -Syu --needed --noconfirm --noprogressbar --ignore linux,linux- firmware base base-devel git
The packages linux and linux-firmware still get installed. I would prefer if there would be a way to install base, but without all of the irrelevant stuff for containers. I would propose something like base-container for this group. The --ignore flag does not do what you think it does, it just has the same result as if you had listed it in pacman.conf in IgnorePkg
Note the documentation: "Directs pacman to ignore upgrades of package even if there is one available."
If you explicitly specify both packages on the command-line (which you did when you listed "base") then they will still get installed. Actually, pacman will interactively prompt you about whether you actually want to install them, and --noconfirm will default to "yes".
This is relevant e.g. when you have "linux" ignored because you don't want to upgrade it with every pacman -Syu, but you do want to, occasionally, update it manually -- if IgnorePkg stopped you from specifying it on the command line, then it would be literally impossible to ever update, without modifying your config files in /etc, then running a manual update, then reverting your config files in /etc.
I do not foresee us changing --ignorepkg to operate with a different codepath following different rules that differ from IgnorePkg, both because I think this is misuse of the feature, and because users will then confuse the two and think they are the same when they are not.
...
OTOH you can achieve your desired goal like this:
$ pacman -Sqg base| grep -Fxv -f <(printf 'linux-firmware\nlinux\n') # see list of packages in base, minus two that you want to exclude
This list can be further piped to pacman -S -
Thanks for all of your replies. I just decided on just removing linux and linux-firmware afterwards, as it is the cleanest solution for me. As it is just a docker image I am building I don't really care about build time as it is built weekly and just used for packaging. I was just hoping, that there would be an easy way to exclude packages from a group uninteractively. But just removing them is good enough for me. Thanks for all your suggestions though. Kins regards Sefa Eyeoglu Free Software Developer scrumplex.net[1] -------- [1] https://scrumplex.net
On 5/16/19 7:44 AM, Sefa Eyeoglu via arch-general wrote:
On Mittwoch, 15. Mai 2019 15:12:13 CEST Eli Schwartz via arch-general wrote:
On 5/14/19 5:08 PM, Sefa Eyeoglu via arch-general wrote:
Hey fellow Arch Users,
I am currently playing around with the GitLab CI and automatic building of Arch packages. My modified Arch Linux Docker image should include base and base- devel, but without all of the kernel and hardware stuff. This is the command, that does not work as expected:
pacman -Syu --needed --noconfirm --noprogressbar --ignore linux,linux- firmware base base-devel git
The packages linux and linux-firmware still get installed. I would prefer if there would be a way to install base, but without all of the irrelevant stuff for containers. I would propose something like base-container for this group. The --ignore flag does not do what you think it does, it just has the same result as if you had listed it in pacman.conf in IgnorePkg
Note the documentation: "Directs pacman to ignore upgrades of package even if there is one available."
If you explicitly specify both packages on the command-line (which you did when you listed "base") then they will still get installed. Actually, pacman will interactively prompt you about whether you actually want to install them, and --noconfirm will default to "yes".
This is relevant e.g. when you have "linux" ignored because you don't want to upgrade it with every pacman -Syu, but you do want to, occasionally, update it manually -- if IgnorePkg stopped you from specifying it on the command line, then it would be literally impossible to ever update, without modifying your config files in /etc, then running a manual update, then reverting your config files in /etc.
I do not foresee us changing --ignorepkg to operate with a different codepath following different rules that differ from IgnorePkg, both because I think this is misuse of the feature, and because users will then confuse the two and think they are the same when they are not.
...
OTOH you can achieve your desired goal like this:
$ pacman -Sqg base| grep -Fxv -f <(printf 'linux-firmware\nlinux\n') # see list of packages in base, minus two that you want to exclude
This list can be further piped to pacman -S -
Thanks for all of your replies. I just decided on just removing linux and linux-firmware afterwards, as it is the cleanest solution for me. As it is just a docker image I am building I don't really care about build time as it is built weekly and just used for packaging. I was just hoping, that there would be an easy way to exclude packages from a group uninteractively. But just removing them is good enough for me. Thanks for all your suggestions though.
pacman is not designed to be scriptable, you could however use pacutils. $ pacsift --repo core --exact --group base | pacsift --exact --invert --name linux --name linux-firmware | sudo pacinstall. Honestly, using a pipeline of simple unix tools seems reasonable to me. Far more reasonable than removing the packages after the fact, since docker layers will result in you carrying around the uninstalled content anyway, unless you are already doing semi-complicated scripting things in a single docker run command. -- Eli Schwartz Bug Wrangler and Trusted User
On Tue, 14 May 2019 23:08:35 +0200 Sefa Eyeoglu via arch-general <arch-general@archlinux.org> wrote:
Hey fellow Arch Users,
I am currently playing around with the GitLab CI and automatic building of Arch packages. My modified Arch Linux Docker image should include base and base- devel, but without all of the kernel and hardware stuff. This is the command, that does not work as expected:
pacman -Syu --needed --noconfirm --noprogressbar --ignore linux,linux- firmware base base-devel git
The packages linux and linux-firmware still get installed. I would prefer if there would be a way to install base, but without all of the irrelevant stuff for containers. I would propose something like base-container for this group.
Kind regards,-- Sefa Eyeoglu Free Software Developer scrumplex.net[1]
-------- [1] https://scrumplex.net
Hi Sefa, that has been discussed extensively without any firm solution so far. Latest example: https://lists.archlinux.org/pipermail/arch-dev-public/2019-March/029491.html Regards, Khorne
On Tue, 14 May 2019 23:08:35 +0200, Sefa Eyeoglu via arch-general wrote:
The packages linux and linux-firmware still get installed. I would prefer if there would be a way to install base, but without all of the irrelevant stuff for containers.
Hi, first run pactree -r linux-firmware pactree -r linux to ensure that without doubts nothing depends on those packages. It unlikely does. If the packages are definitively unneeded, build empty dummy packages and e.g. use the year as "epoch". pkgname=linux pkgver=05.16 pkgrel=1 epoch=2019 pkgdesc="Dummy package" arch=('any') provides=('linux') pkgname=linux-firmware pkgver=05.16 pkgrel=1 epoch=2019 pkgdesc="Dummy package" arch=('any') provides=('linux-firmware') I don't know if this workaround is need, but is should do the job. Regards, Ralf
On Thu, May 16, 2019 at 08:08:19 +0200, Ralf Mardorf via arch-general wrote:
On Tue, 14 May 2019 23:08:35 +0200, Sefa Eyeoglu via arch-general wrote:
The packages linux and linux-firmware still get installed. I would prefer if there would be a way to install base, but without all of the irrelevant stuff for containers.
Hi,
first run
pactree -r linux-firmware pactree -r linux
to ensure that without doubts nothing depends on those packages. It unlikely does. If the packages are definitively unneeded, build empty dummy packages and e.g. use the year as "epoch".
If nothing depends on linux or linux-firmware, what is the point of installing dummy packages? Dummy packages are IMHO just a very broken and hacky way to work around unnecessary dependencies. This doesn't appear to be the case here. Best, Tinu
On Thu, 16 May 2019 10:40:26 +0200, Tinu Weber wrote:
If nothing depends on linux or linux-firmware, what is the point of installing dummy packages?
I agree, after installing all packages simply removing the unwanted packages makes more sense. I just was uncertain, if the OP for what reason ever might need to "reinstall" groups inside the container. To avoid installing the packages in the first place Eli's reply seems to provide the easiest solution.
participants (6)
-
Eli Schwartz
-
Khorne
-
Ralf Mardorf
-
Robin Broda
-
Sefa Eyeoglu
-
Tinu Weber