Change/ignore a package dependency

I was looking at installing vaultwarden today using pkg, but it has a dependency on mysql and I'm using mariadb on my system for other things which makes it impossible to install since it wants to remove it.

As far as I'm aware, it is completely compatible with mariadb so it shouldn't be an issue to not use mysql and I was wondering if there was a way to achieve installing it from pkg without installing mysql?

The only 2 options I can think of is to either install it from ports(but mixing pkg and ports was a terrible idea last time I tried it) or making my own package with mariadb as the dependency instead(which I have no idea how to do or how complex it would be).
 
To be clear, the issue isn't that the package doesn't install(at least I don't think that would be an issue), it's that it wants to remove mariadb because of the mysql dependency and I can't let that happen since that would be a problem for me.
 
Using a jail would be an option to fix the ports and pkg mixing, but it's far from an ideal one since it will consume more resources just to get around a default that's not good for me when mariadb and mysql are pretty much interchangeable.
 
Using a jail would be an option to fix the ports and pkg mixing, but it's far from an ideal one since it will consume more resources just to get around a default that's not good for me when mariadb and mysql are pretty much interchangeable.
Some options you can try:

  • https://wiki.freebsd.org/MariaDB#When_using_ports
  • Use jails. In reality, this consumes no more than the processes running inside each jail. I do this often: each jail has a different function, but there are times when a service running inside one jail depends on another service running in another jail. You just have to consider how you want to manage the jails from a network perspective, but the simplest way is to share the host's network stack, with its drawbacks, of course.
  • Use SQLite. SQLite should be sufficient if you are the only user of your vaultwarden instance and do not plan to use it with multiple users.
 
Some options you can try:

  • https://wiki.freebsd.org/MariaDB#When_using_ports
  • Use jails. In reality, this consumes no more than the processes running inside each jail. I do this often: each jail has a different function, but there are times when a service running inside one jail depends on another service running in another jail. You just have to consider how you want to manage the jails from a network perspective, but the simplest way is to share the host's network stack, with its drawbacks, of course.
  • Use SQLite. SQLite should be sufficient if you are the only user of your vaultwarden instance and do not plan to use it with multiple users.

Doesn't creating a jail copy all of the OS files to run it? That's what I was reading about thick jails, but I'm not too sure which type I would actually need just to avoid problems with mixing ports and packages.

About using sqlite, is there a way to do that from a package from pkg that would make it not want to install mysql?
If not, it means using a jail either way.
The issue is that all of my software are installed using pkg and installing some with ports when there are some installed with pkg has caused me a ton of issues in the past. I've also read they should not be mixed so I'm not the only one, unless that changed at some point.
 
Doesn't creating a jail copy all of the OS files to run it? That's what I was reading about thick jails, but I'm not too sure which type I would actually need just to avoid problems with mixing ports and packages.

Exactly, with thick jails, but with thin jails, much less space is wasted. Both have their pros and cons. I personally prefer thin jails.

See also:

*
View: https://www.youtube.com/watch?v=kAJ7RzfPaLA

* https://forums.freebsd.org/threads/which-type-of-jail-for-production-use-cases.94538/#post-697802

About using sqlite, is there a way to do that from a package from pkg that would make it not want to install mysql?

With make config or using poudriere-options(8) if you use poudriere. Of course, this requires you to use ports. You can use poudriere, create a jail, set up your custom repository, and install the custom port (now a package) inside the jail.
 
mariadb is a drop-in replacement for mysql so the mysql option would work for mariadb.

You can launch mariadb with the mysql command.
Yes, but if you check MariaDB port Makefile you'll see that it conflicts with MySQL, so you can't have both at the same time on one system, it's one or the other, that's why jail is recemented for this case.

Code:
CONFLICTS_INSTALL= mariadb10[0-57-9]-${PKGNAMESUFFIX:C/^[0-9]-//}-  
mysql[0-9]-${PKGNAMESUFFIX:C/^[0-9]-//}-*  
mysqlwsrep*  
percona[0-9]-${PKGNAMESUFFIX:C/^[0-9]-//}-*  
mytop[code]
 
Yes, but if you check MariaDB port Makefile you'll see that it conflicts with MySQL, so you can't have both at the same time on one system, it's one or the other, that's why jail is recemented for this case.
I know, that's exactly the problem I have, but what I was saying is that if the software supports mysql, that basically means it also supports mariadb.

Dtxdf even linked how to compile a port with mariadb using the mysql option:
 
Exactly, with thick jails, but with thin jails, much less space is wasted. Both have their pros and cons. I personally prefer thin jails.
This is what made me think I'd have to use a thick one when reading the manual:
Code:
Changes in shared components could potentially affect multiple thin jails simultaneously.

Makes it sounds like a thin jail wouldn't really prevent issues from mixing ports and pkg so it would just be the same as mixing them but with extra steps.


I take it that changing or ignoring a dependency when using pkg is not possible?
 
What I recommend is that you compile the port with the options and flavors that suit you best. You shouldn't have any problems unless you do something unusual. Also, install your custom port in a jail. This reduces the likelihood of encountering a problem you haven't considered previously, so your host won't be affected.
 
It would indeed only create problems with the jail instead of potentially everywhere so that's one benefit of it.

I'd still want to know if there's a way to mess with pkg dependencies though since just ignoring the mysql installation would simply work without anything else being necessary.
 
Dtxdf even linked how to compile a port with mariadb using the mysql option:
Ha, IDK about DEFAULT_VERSIONS+=mysql=1011m, thanks DtxdF 🙏

In this case, maybe your best option is to use poudriere jail (with changes that DtxdF advised) for building security/vaultwarden, set poudriere repo just for that, make file /usr/local/etc/pkg/repos/poudriere.conf and give it higher priority: value than what you have in /usr/local/etc/pkg/repos/FreeBSD.conf and pkg update; pkg ins vaultwarden should pick up your newly built pkg version.
In theory – TBH I didn't test this.
 
I'd have to rebuild it with every updates that way and if it's gonna make a jail to make the package, I might as well just run it in the jail instead of the main system or look into making a mariadb flavor for the package officially.

It is a potential option though, but realistically, if I can't skip the dependency easily using pkg, I'm more likely to just run it on my linux server VM instead, it uses mariadb on arch by default. It's not ideal since that server is a lot less powerful, but it's gonna be a lot less potential problems in the future.
 
The -M option will ignore every dependency as far as I can tell, which would be an issue since I only want to ignore the one because it has others it actually needs and installing all of those manually sounds like a recipe for disaster.
 
I have solid alternatives on how to deal with the problem so at this point, I'm just looking to get an answer to if it's possible to ignore a specific dependency with pkg or if there's a way to modify them without having to rebuild the package.
 
pkg install -M vaultwarden
or
pkg fetch vaultwarden
pkg add -M /var/cache/pkg/vaultwarden-1.34.3_1.pkg
I don't know if the installed vaultwarden will work.
Probably won't work, pkg security/vaultwarden needs libmysqlclient.so.21 as dependency, so only option around that is what DtxdF advised about DEFAULT_VERSIONS+=mysql=1011m, and only way to avoid mixing ports and pkgs is to use two pkg repos, with your own having higher priority:
 
Back
Top