How to Change a Pacman Package's Dependencies on Arch Linux with remakepkg
Recently I ran into a dependency conflict after an update of a particular package, bitwarden-cli. Prior to version 2022.6.2-2, bitwarden-cli
depended on nodejs
. It was in version 2022.6.2-2 that the dependency was changed from nodejs
to nodejs-lts-gallium
.
Okay, so what's the big deal? The big deal is that nodejs
and nodejs-lts-gallium
cannot both be installed, as they're listed as conflicting packages of one another (see the Conflicts section of nodejs-lts-gallium). While I could have just gone ahead and removed nodejs
in favor of nodejs-lts-gallium
, I didn't really want to, as I had no issues with it and wanted the latest version of nodejs
. And yes, alternatively I could have installed the latest version via nvm or otherwise, and kept nodejs-lts-gallium
(version 16.x at the time of this writing) as the system dependency.
For whatever your personal reasons are, you may wish to remove or alter the restrictions defined for a package by a package maintainer. In my case, I was able to figure out why the dependency change occurred in the first place. It was due to this bug, a bug which affected a premium feature of Bitwarden that I didn't even have access to. With this in mind, I felt comfortable discarding the new requirement of using nodejs-lts-gallium
.
IMPORTANT NOTE
In writing this, I realized that --assume-installed nodejs-lts-gallium
solves my problem, without the need for remakepkg
. I just need to include that option during an upgrade, whenever there is a newer version of bitwarden-cli
available. This works when dealing with the absence of a package. However, remakepkg
may be needed for other scenarios. I'll proceed with how I used remakepkg
to solve my problem.
So, how does one go about "changing" a package's dependency? It's done with the help of an AUR package, remakepkg. You can also find the git repo containing the script here.