36

I want to install sqldeveloper from Oracle on Arch Linux. The only Linux download option is RPM. I am not interested in using arch repositories to install sqldeveloper. I can only use what the vendor provides.

3
  • 10
    The package in the AUR is "what the vendor" provides: that is how packaging on Arch works. If you are going to use Arch, you should familiarize yourself with how pacman, makepkg and PKGBUILDs work.
    – jasonwryan
    Commented Feb 14, 2014 at 19:03
  • 1
    "The package in the AUR is "what the vendor" provides" Lol... no. People want to use software that isn't in the AUR, believe it or not. I can't install Java 1.6.65, 64bit from Oracle/Sun ...? Right, because Arch is a rolling release, and doesn't keep previous versions for starters.
    – Zombies
    Commented Aug 27, 2014 at 16:01
  • An extensive explanation is given at: nemrod.se/guides/install-rpm-packages-on-arch-linux Commented Dec 18, 2019 at 18:23

5 Answers 5

27

Jasonwryan (as per usual) was right on the mark with his initial comment.

Arch's packages are supposed to be as close to "vanilla" as possible. Now, while you could use rpmextract or alien, there isn't really a good reason to do so. What you should do is create a PKGBUILD that uses the RPM as the source file and then installs everything that's needed where it should be in the package() function. If you are unsure of how to do this, take a look at some packages on the ArchLinux User Repository; there are plenty that do similar things.

Now, since bsdtar (the default extractor used on source files by makepkg) supports extracting RPMs without issue, there is no reason to use rpmextract—it adds a makedependency without adding any real functionality.


Some related reading from the wiki:

5
  • 1
    It looks like the latest rpmextract on Arch Linux is just a wrapper around bsdtar.
    – sherrellbc
    Commented Oct 4, 2017 at 11:46
  • 35
    The question title states: install RPM file on Arch linux, and all i've found was just the usual arch elitist answers "check the manual"/"check those resources". This answer basically tells the user where to search his own answer instead of giving simple easy-to-follow instructions. While this is canon on arch fora, it is against common practice on SO. I guess the user could've asked the question on the arch forum if he wanted this kind of answer. SO etiquette requires verbatim citing of parts of linked resources that apply to the particular answer.
    – brett
    Commented Apr 17, 2018 at 6:17
  • 4
    @brett as a years long arch user, I agree Commented Aug 16, 2019 at 13:19
  • 5
    This answer needs a link to example PKGBUILDs that take RPMs, extract them and then put the files where they need to go. The link to the AUR is not helpful in this case. It would be helpful if it were more specific. Commented Sep 4, 2019 at 0:07
  • 5
    Exactly. If you are not willing to provide a detailed answer to the question being asked or at least willing to provide links to specific instruction, please refrain from posting an answer. Links to AUR are useless---anyone using Arch would know what AUR is and where to find it. This answer is actually polluting search results and wastes everyone's time ---it shows up as answering the question, while it does not provide any specific useful information .
    – stefano
    Commented May 9, 2020 at 15:30
14

I was genuinely surprised at the lack of examples! Arch bundles a few make/configure examples in /usr/share/pacman, but that's it. The templates link in HalosGhost's answer is now a redirect to a page that only covers the variables within a PKGBUILD. So I find myself motivated to help others out here:

PKGBUILD:

# Metadata; be sure to set this to reasonable values to not confuse your
# package manager or cause name conflicts with the repositories.
pkgname="rpm-package-name"
pkgver="0.0.1"
pkgrel="1"
pkgdesc="Short description of rpm package"
arch=("x86_64")

# The RPM file you want to install; place in the same directory as this file.
source=("filename.rpm")

# Assuming you're not going to push this to AUR or whatever, you can just skip
# the integrity check here. Otherwise, replace SKIP with the output of
# "sha -a 256 filename.rpm".
sha256sums=("SKIP")

package() {
  # Copy all directories from $srcdir into $pkgdir. $srcdir will already have
  # been populated with the contents of package.rpm, but it also contains a
  # symlink to it, which we don't want to copy; anything in $pkgdir after this
  # command will be installed to your root directory.
  find $srcdir/ -mindepth 1 -maxdepth 1 -type d | xargs cp -r -t "$pkgdir"
}

Be sure to edit the variables in the template as needed for your package. You will at least need to replace rpm-package-name and filename.rpm for it to work.

After you create this PKGBUILD file with your desired rpm placed beside it, run makepkg from the same directory. If all goes well, you should be able to verify that the generated package file has what you expect in it by inspecting the generated file with tar tf <package_name>.pkg.*. Do a sudo pacman -U <package_name>.pkg.* and voila! Enjoy your rpm software that is now installed.

Of course if you run into any errors, I'm sure folks on the Arch forums would be willing to point you to some manuals to read...

2
  • Doesn't work for me :( Commented Nov 26, 2021 at 10:53
  • @DragosRachieru after you run a makepkg, does any new directories appear? Does it bail with any error?
    – Hi-Angel
    Commented Mar 18, 2023 at 22:11
7

The Arch-specific tool is rpmextract. https://www.archlinux.org/packages/extra/any/rpmextract/

2

There's a tool called alien that can (attempt) to build a deb from the rpm. Sometimes it works; other times it makes a mess... it's an imperfect process at best. alien can be used to simply unpack the rpm into a deb format directory (i.e. do everything but build the deb) where you can manually install (copy) everything.

The other option is to install the rpm tools under arch and force installation of the rpm. This will get it installed, but not being a native rpm distro, it will have no knowledge of the deb packages on the system. Meeting the dependencies will, thus, be up to you. Also, any rc scripts it installs will have to be converted to systemd.

4
  • I see. I think some RPM files just have packaged binaries. For sqldeveloper, all I had to do was install rpmextract. It created a directory structure of /opt/sqldeveloer/...[prebuilt and ready to run.. ...But you're saying that for rpms which requires building, this is no easy task?
    – Zombies
    Commented Feb 14, 2014 at 19:00
  • I'm saying alien can convert an rpm to a deb package -- or at least try as rpms can have complex install/remove scripts. alien can be told to do everything but build the deb, where you can look at what the rpm tries to do and maybe clean it up before building the deb. If rpmextract did the trick, then don't worry about alien.
    – Ricky
    Commented Feb 14, 2014 at 20:39
  • 4
    Maybe I'm missing something, but creating a deb file doesn't seem useful because Arch Linux does not use a deb based package manager.
    – Wieland
    Commented Feb 16, 2014 at 7:51
  • tgz then (which will be close to what pacman uses, but not the same) A deb can easily be extracted using cpio. (and tgz, directly with tar.) RPM is a bastardized cpio archive -- it has a bunch of junk before the gzip'd cpio stream.
    – Ricky
    Commented Feb 17, 2014 at 3:27
-3

I'm not sure if these would work for everyone, but its the fastest way if you don't care what it may or may not do

I did these to get skype working on arch, basically open the .rpm file, then see if you can find a file named "." If you do then copy the files within the "." file to your root directory (AKA "/")

I do not recommend these unless you know exactly what you're doing

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .