Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Blacklist Option #2325

Open
vermaden opened this issue Oct 18, 2024 · 11 comments
Open

Add Blacklist Option #2325

vermaden opened this issue Oct 18, 2024 · 11 comments

Comments

@vermaden
Copy link

I have tried to find it - but failed ...

Does pkg(8) has an option to blacklist a list of packages?

This alone is a perfect example for need of such option:

For example 'mask' any kernel* packages to not install/update them - to ignore them - as a blacklist option in pkg(8)?

I know that having some additional kernel and kernel modules does not 'hurt' on Jails - but there would probable are other use cases for such option.

Regards,
vermaden

@arrowd
Copy link
Contributor

arrowd commented Oct 18, 2024

You can prevent a package from updating using pkg lock.

@vermaden
Copy link
Author

You can prevent a package from updating using pkg lock.

Yes - but that is only AFTER it has been installed.

I want to PREVENT packages from being installed.

@arrowd
Copy link
Contributor

arrowd commented Oct 18, 2024

You mean, you don't want to explicitly list packages you want to install, but instead do pkg install -x FreeBSD and let pkg filter out some of them?

@vermaden
Copy link
Author

vermaden commented Oct 18, 2024

I was thinking of something similar to pkg lock actually.

A default pkg(8) bootstrap will have 'empty' lock list and 'empty' blacklist list.

Then you can add - for example pkg blacklist lsblk and the lsblk will never be installed - and pkg unblacklist lsblk to allow its installation. Same for kernel packages for PKGBASE.

@arrowd
Copy link
Contributor

arrowd commented Oct 18, 2024

I still don't get it. If you don't want some package to be installed - just don't install it. A blacklist only makes sense if you want to install by a glob or regex pattern, but filter some packages out of it.

@vermaden
Copy link
Author

Is it possible to do the same with PKGBASE as described in the message I linked to in the first message?

@arrowd
Copy link
Contributor

arrowd commented Oct 18, 2024

pkgbase is no different from any other set of packages. Having read the Mastodon post, I still fail to understand the problem.
Create a text file and list all packages you want to have installed/upgraded. Then feed it to pkg install/pkg upgrade.

@vermaden
Copy link
Author

Good idea, will share that with the author of the post.

@jeffpc
Copy link

jeffpc commented Oct 19, 2024

Author of the mastodon post here...

The only reason I wish for something (not necessarily a blacklist option) to exclude packages during fresh install is simple:

I want to use pkgbase for FreeBSD jails. All the docs out there just install * from pkgbase which includes kernel, debuginfo, source, etc. This is overkill for all my jails (and I suspect the same is true for other people's jails).

Create a text file and list all packages you want to have installed/upgraded. Then feed it to pkg install/pkg upgrade.

This is the obvious way, but it has a problem - I don't know which packages are necessary for a well function jail. Sure, I know to exclude the kernel, source, whatever, but I don't really want to figure out what is needed and what isn't every time there is a new release. (That's with a user/sysadmin hat on; with a wanna be fbsd dev hat on, I could figure it out but it still feels a bit like waste of time.)

IMO, the ideal solution would be for pkgbase to include some kind of metapackage for "jail stuff" subset of the system. Then it would be as easy as pkg install jail-stuff-package. That, of course, would be something for the people working on pkgbase to do (and not for pkg(8) itself). This is my opinion, and I definitely don't have all the ins/outs/nuance of pkg(8) in my head, so it may not be workable for some reason.

Just my 2 cents.

@bapt
Copy link
Member

bapt commented Oct 21, 2024

the doc is working around a missing feature which is pkg group, half backed so far... a pkg group is kind of a metapackage, but more clever, at the moment we will have finished the pkg groups, one would be able to say pkg install FreeBSD-userland or something like that to just install the userland without the kernel.
I don't like this idea of a list of package whish will be automagically marked in order for them not be excluded from any request, this makes things very hard to debug when things goes wrong, and is usually very fragile by design, for this case, imho what we need is someone to motivate me into finishing pkg groups.

@Crest
Copy link

Crest commented Dec 3, 2024

Right now my workaround for this is to run pkg rquery which does support negated blobs to expand the query and repo to a list of %n-%v pairs for installation. To avoid spurious changes I run pkg update first and invoke the remaining commands without updating the repository metadata. It would be nice to have flag that allows prefixing globs/regexes with a plus or minus to get rid of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants