3

I have an rpm package prebuilt by a third party and have to install it into my Guix server machine. So how can I install an rpm package into a Guix machine?

Thanks.

cmal
  • 133
  • 3

2 Answers2

3

Short answer: You can't. There is no documented way to convert your rpm packages to one managed by Guix, and no "API" that could deal with those packages.

Also, there is no way to install without conversion of RPM packages inside GuixSD or NIX.

Your best beat here is to extract rpm contents inside a RPM based distribution, and repack it outside the package tree. You will have to deal with dependencies and other hell related to this conversion. Good luck.

GAD3R
  • 63,407
  • 31
  • 131
  • 192
  • If that is true, I would say that this is a fatal cons of `guix` or `nix`. I would assume that some devops may need rpm/deb packages sooner or later, and the dependencies of those packages would possibly hard to find. – cmal Jun 08 '17 at 09:28
  • I know how you feel but Guix and Nix have a peculiar way to manage packages an its dependencies, making multiple versions of the same software possible to coexist. Its hard to do that, and at the same time deal with the classic package management workflow, where newer packages are just a replacement for the current version, and libs when needer are overridden as well. –  Jun 08 '17 at 10:44
  • I love this, and I hope soon there will be method to use rpm and deb packages without troubles. After all, I am learning and using it for realistic jobs rather than just a toy. – cmal Jun 09 '17 at 02:32
  • Well. That is a good thing. Not everyone has the opportunity to use such distribution at work and learn with it. People at corporations tend to use classic packaging distributions, and if you are using `Guix` instead of Debian or Red Hat is a hell of a learning curve you will face :) –  Jun 09 '17 at 10:35
  • No I am using it myself and wish one day I can use it in my production env. _haha_ – cmal Jun 10 '17 at 11:01
  • Isn't there a `buildFHSUserEnv` that can be used to create an environment that RPM expects? – CMCDragonkai Aug 31 '18 at 04:31
0

I haven't tried installing a foreign distribution RPM package on Guix System, and would advise against it on your main system (it may lead to breakage), but if it's just for testing purpose, it's entirely possible:

# Generate a test RPM package.
# mkdir /var/lib/rpm
# chown root:users /var/run/rpm
# chmod g+rw /var/run/rpm

# Install it with RPM.
$ guix shell rpm
[env]$ rpm_package=$(guix pack -f rpm -R -S /usr/bin/hello=bin/hello hello hello)
[env]$ sudo -E rpm -i --prefix=/opt $rpm_package

# Validate its installation.
[env]$ rpm -q hello
hello-2.12.1-0.x86_64
[env]$ file /opt/usr/bin/hello
/opt/usr/bin/hello: symbolic link to ../../gnu/store/hccgf4lpfy2dwwmglmhsyr83yywzxhbr-profile/bin/hello
[env]$ /opt/usr/bin/hello
Hello, world!

See https://guix.gnu.org/en/manual/devel/en/html_node/Invoking-guix-pack.html#Invoking-guix-pack for more information about the guix pack command which was used to generate the hello test RPM package.

user30747
  • 260
  • 2
  • 6