alien

From LinuxReviews
Jump to navigationJump to search

alien is a command-line tool for converting Linux software packages between Debian .deb, Red Hat .rpm, Software .tgz and even Solaris .pkg file formats. The resulting converted packages it produces may or may not install and they may or may not work depending on the original package which has been converted. Converted packages who do install will, in most cases, only do so after going through some hoops.

Features And Usability

Using alien to convert a package from one format to another is as simple as:

alien --to-rpm naver-whale-stable_amd64.deb

(-r can be used as an alias for --to-rpm[1])

Alien can be used as a regular user but it will warn that "Ownerships of files in the generated packages will probably be wrong.". This is correct, it has to be executed as root to get the right permissions in the resulting package.

Alien will not convert scripts that are included in a .deb or .rpm package unless the --scripts switch[1] is provided.

Practical Use-Cases

Converting the naver-whale-stable_amd64.deb package for the NAVER whale web browser as shown in the example above on Fedora 31 results in a .rpm package which, when one attempts to install it on Fedora with

rpm -vih naver-whale-stable-2.6.90.16-2.x86_64.rpm

produces the following fine error message:

error: Failed dependencies: libnelo2-multi.so()(64bit) is needed by naver-whale-stable-2.6.90.16-2.x86_64

There is, of course, no Fedora package which provides libnelo2-multi.so and there does not need to be. A close-up inspection of the .rpm package with less naver-whale-stable-2.6.90.16-2.x86_64.rpm reveals that resulting .rpm package actually includes /opt/naver/whale/libnelo2-multi.so yet it lists it as a requirement (Nelo2 is a part of the Naver Business Platform SDK, there are no separate packages with it available). That hurdle can be solved by using the rpm --nodeps parameter[2].

Trying to install the package with --nodeps to ignore the not-actually required dependency presents yet another odd error:

file /usr/bin from install of naver-whale-stable-2.6.90.16-2.x86_64 conflicts with file from package filesystem-3.12-2.fc31.x86_64

That error means is that the rpm package is asking to create the folder /usr/bin, which will exists on every single Linux distribution out there, and rpm does not want it to do that since another package has already created that folder. Errors like that can be ignored by adding --replacefiles to the rpm command[2]. You should absolutely not blindly do that. However, this command does make the package install in this particular example:

rpm -ivh --nodeps --replacefiles naver-whale-stable-2.6.90.16-2.x86_64.rpm

Snubbelrisk.jpg
Warning: You should absolutely not use --replacefiles as an rpm argument unless you are absolutely sure it won't actually replace any files.

The resulting package does, in this particular case, install just fine and it does actually work as expected. However, that may not be the case with other packages you may want to convert.

Verdict And Conclusion

alien can be a useful tool and it can produce working packages which, using some not at all safe installation parameters, can be installed and used. It is not a tool for everyone. Using it and the resulting converted packages it not at all strait forward. If can be useful if you are a wizard with some Linux experience and understanding. Just be aware that installing some random .rpm or .deb file you found on a obscure website with parameters like --replacefiles is not a good idea and you should not do that unless you have checked what, if any, files would be replaced. A package trying to create /usr/bin when /usr/bin exists is a non-issue, a package replacing /usr/bin/bash with something malicious could lead to disaster.

Don't use alien unless you know what you are doing.

Links

Footnotes

  1. 1.0 1.1 man.linuxreviews.org: alien.1 manual
  2. 2.0 2.1 man.linuxreviews.org: rpm.8 manual


Add your comment
LinuxReviews welcomes all comments. If you do not want to be anonymous, register or log in. It is free.