Other languages Deutsch ; English |
Synopsis:alien is a program that converts between Red Hat rpm, Debian deb, Stampede slp, Slackware tgz, and Solaris pkg fileformats. If you want to use a package from another linux distribution than the one you have installed on your system, you can use alien to convert it to your preferred package format and install it. It also supports LSB packages. |
This page will cover how to troubleshoot conversions that not ends successful.
Considerations
I will work from ~/tmp
folder, in this place I store the .rpm and .deb files used in the examples.
You can work from another folder.
fakeroot
command before alien allows to use alien without root permissions.
rpm to deb
This was not working out of the box since Mageia 8 times mga#28607, but now in Mageia 9 and beyond with the updated packages we can at least provide a procedure that allows to perform the operation.
This conversion can fail like this
Package build failed. Here's the log: dh binary dh_update_autotools_config dh_autoreconf create-stamp debian/debhelper-build-stamp dh_testroot dh_prep debian/rules override_dh_auto_install make[1]: Entering directory '/home/katnatek/tmp/mc-4.8.29' mkdir -p debian/mc # Copy the packages's files. find . -maxdepth 1 -mindepth 1 -not -name debian -print0 | \ sed -e s#'./'##g | \ xargs -0 -r -i cp -a ./{} debian/mc/{} make[1]: Leaving directory '/home/katnatek/tmp/mc-4.8.29' dh_installdocs dh_installchangelogs dh_installman dh_installman: error: mv debian/mc/usr/share/man/es/man1/mc.1.xz.dh-new debian/mc/usr/share/man/es/man1/mc.1.xz: No such file or directory dh_installman: error: Aborting due to earlier error make: *** [debian/rules:7: binary] Error 25
Solution:
Directory mc-4.8.29 prepared.
Edit the file mc-4.8.29/debian/rules
Add this after the line 26: override_dh_installman:
,and save the change.
cd mc-4.8.29
fakeroot dh binary
At the end of the process, you will see something like this:
dpkg-gencontrol: warning: Depends field of package mc: substitution variable ${shlibs:Depends} used, but is not defined dpkg-gencontrol: warning: package mc: substitution variable ${perl:Depends} unused, but is defined dh_md5sums dh_builddeb dpkg-deb: building package 'mc' in '../mc_4.8.29-2_amd64.deb'. |
deb to rpm
This procedure usually works out of the box like with this deb from debian:
fakeroot alien --to-rpm bash_5.2.15-2+b7_amd64.deb
But some deb files can fail.
Warning: Skipping conversion of scripts in package schildichat-desktop-alpha: postinst postrm Warning: Use the --scripts parameter to include the scripts. Package build failed. Here's the log of the command (cd schildichat-desktop-alpha-1.11.97~sc.0.test.0; rpmbuild --buildroot='/home/katnatek/tmp/schildichat-desktop-alpha-1.11.97~sc.0.test.0' -bb --target x86_64 'schildichat-desktop-alpha-1.11.97~sc.0.test.0-2.spec'): error: line 5: Empty tag: Summary: Building target platforms: x86_64 Building for target x86_64
Solution:
Warning: Skipping conversion of scripts in package schildichat-desktop-alpha: postinst postrm Warning: Use the --scripts parameter to include the scripts. Directory schildichat-desktop-alpha-1.11.97~sc.0.test.0 prepared.
cd schildichat-desktop-alpha-1.11.97~sc.0.test.0
Edit the spec file, put some information after the Summary: string, save the change.
rpmbuild -bb schildichat-desktop-alpha-1.11.97~sc.0.test.0-2.spec --define "_topdir $(pwd)"
This will produce lot of errors like:
File not found: /home/user/tmp/schildichat-desktop-alpha-1.11.97~sc.0.test.0/BUILDROOT/schildichat-desktop-alpha-1.11.97~sc.0.test.0-2.x86_64/opt/SchildiChatAlpha/v8_context_snapshot.bin |
mkdir -p BUILDROOT/schildichat-desktop-alpha-1.11.97~sc.0.test.0-2.x86_64
Move the folder(s) that not belong to rpm build (BUILD,BUILDROOT,SRPMS) to BUILDROOT/schildichat-desktop-alpha-1.11.97~sc.0.test.0-2.x86_64
In this case, opt
and usr
.
Return if needed to ~/tmp/schildichat-desktop-alpha-1.11.97~sc.0.test.0
Run again
rpmbuild -bb schildichat-desktop-alpha-1.11.97~sc.0.test.0-2.spec --define "_topdir $(pwd)"
Note: The deb to rpm case as you see is the complex to fix by hand as we have to learn and adapt the steps for each conversion. The key is the folder BUILDROOT and the string between the first next "/" and the second "/". |