I'm trying to install a .deb
package however it requires several dependencies such as nodejs, nodejs-underscore, but all of those are already installed via nvm
and are available.
Is there anyway I can have apt-get
recognize packages installed via nvm so that they don't clash? I know that apt-get is system-wide whereas nvm works at local user-space so this might need some hacking.
Best Answer
The simplest approach, whenever possible is to only use either
nvm
or.deb
packages. This will probably save you a lot of headaches in the long run, so look into that first. It seems like nearly anything node-related that is provided by a.deb
package could be installed vianvm
instead.If that really isn't possible, however, you may be able to create "dummy"
.deb
packages usingequivs-control
andequivs-build
to tellapt
that you have the dependencies installed. Note that this could potentially confuse apt if you get things wrong. Also, even if you uninstallnvm
packages, apt will still think you have the substitutes you've defined in the dummy packages until you uninstall the dummy packages themselves.First, install "equivs" so we can build the dummy packages:
Create a control file that describes the dummy package:
Edit this control file:
Un-comment and change lines in the control file as desired. In particular set the "Provides:" line to list the packages that you've substituted using
nvm
. For example:Build the package:
Finally, install it:
Rinse and repeat for whatever packages you've substituted using
nvm
. If a package depends on a specific version of another package you've replaced withnvm
, you may need to use that exact version number it depends on. I'm not sure what issues might arise from do so, however, and you'll likely need to keep rebuilding your dummy packages whenever the OS packages change versions.