How to install an application from archlinux.org
I am trying to download IntelliJ IDEA application from the AUR.
I can see that is on archlinux.org here. However when I type in sudo pacman -S intellij-idea-ultimate-edition
I get error target not found : intellij-idea-ultimate-edition
How do I install this package from AUR? What am I missing?
As any other AUR package (you even tagged aur, so I’ll assume you’ll know what that means), as documented on https://wiki.archlinux.org/title/Arch_User_Repository :
- Get the PGP key
- get the AUR source files by cloning the appropriate
https://aur.archlinux.org/{…}.git
; check the PGP signature - do the build using
makepkg
in the directory you just cloned. As usual on arch, you need to remember the flags that everyone always needs to use, iirc these aremakepkg -s -r -c
. And if you’re doing a new build, you’d still want togit clean -xdf
, because this is very mature, very clean and very reliable package building… - install the package you just built using
pacman -U ….pkg.tar.zst
I cannot stress enough how finicky all this is. If you run an update of your system (which you basically need to do every time you install a new package), the dependencies of your self-built package might (will!) break, and you need to do a fresh build. But you won’t hear about that from pacman; things just… break.
I have git config --global url.https://aur.archlinux.org/.insteadof aur:
set up, and build my aur-sourced packages under my ~/aur
directory, so for me,
$ cd ~/aur
$ git clone aur:intellij-idea-ultimate-edition
$ cd intellij-idea-ultimate-edition # or ${_:4}, retype the name howsomever
$ makepkg -si
was all it took. There’s AUR helpers for automatically hunting down dependencies that are themselves AUR packages and installing them with –asdeps and such, I don’t use enough AUR packages to make bothering with one worthwhile and it’s completely unnecessary here.
Use an AUR helper. Personally, I use trizen
, but you can find a list of available AUR helpers here. As usual, Arch has excellent documentation on this. The helper itself will probably need to be installed manually from source, but once you have done that, you can use it the same way (or even instead of, if you choose a pacman
wrapper like trizen
) as pacman
. For example, to install intellij-idea-ultimate-edition
using trizen
, I would do:
trizen -S intellij-idea-ultimate-edition
If you are 100% sure about the package (not always a good idea with AUR packages), you can even tell trizen
not to prompt you and answer all prompts with yes:
trizen -S --noconfirm intellij-idea-ultimate-edition
Everything else works just like pacman
. For instance, you can upgrade everything on the system (both regular and AUR packages) with
trizen -Suy
If you don’t plan to use an AUR helper, you can simply build the package from source by running(using the package you gave here as an example):
git clone https://aur.archlinux.org/packages/intellij-idea-ultimate-edition
cd intellj-idea-ultimate-edition
makepkg
pacman -U intellij-idea-ultimate-edition-2023.2.1-x86_84.pkg.tar.zst
If you do want an AUR helper, I’d highly recommend aurutils, as it integrates directly with pacman, instead of trying to just act like pacman.
After you’ve installed it, Aurutils requires you to setup a local repo, and they have instructions for this and more advanced usuage in the bundled man pages
but the basics of it are:
Add this to the bottom of /etc/pacman.conf
(the local repository root is /home/custompkgs here but you can keep it in any dir you want to)
[custom]
SigLevel = Optional TrustAll
Server = file:///home/custompkgs
Create the repo root and database:
sudo install -d /home/custompkgs -o $USER
repo -add /home/custompkgs/custom.db.tar.gz
If there are any built packages, add them to the database:
cd /home/custompkgs
repo -add -n custom.db.tar.gz *.pkg.tar*
And then sync pacman by running sudo pacman -Syu
To install packages with aurutils, just run aur sync {name of package}
and then pacman -S {name of package}