1. Home
  2. Linux
  3. How to run the arch linux aur on ubuntu

How to run the Arch Linux AUR on Ubuntu

The AUR is one of the best things about Arch Linux. It’s a community-driven repository that allows users to upload their programs. As a result, there are tons of excellent apps to install on it.

If you’re an Ubuntu user, you might feel left out, since you don’t have access to the AUR. But did you know that with Distrobox, you can use the AUR on Ubuntu? Here’s how to get it working on your system.

How to install Distrobox on Ubuntu

You’ll need to install the Distrobox app to your Ubuntu system to use software from the AUR. There are a few ways you can install Distrobox on your Ubuntu system. The first way to install it is via the Ubuntu software repositories included with your system.

This method is an easy way to ensure that Distrobox is always up to date. Additionally,  if you install Distrobox via the Ubuntu software sources, you will not need to edit your Bash profile or anything like that.

To install Distrobox via the official Ubuntu software sources, open up a terminal window. You can open up a terminal window on the Ubuntu desktop by pressing Ctrl + Alt + T on the keyboard. Alternatively, search for “Terminal” in the app menu, and launch it that way.

With the terminal window open, use the following apt install command to install the Distrobox package.

sudo apt install distrobox* -y

Alternatively, you can install the Distrobox application on your Ubuntu system via the official installation script. Although we do not suggest it, as the apt install version works best. Still, the installation script is nice as it sets up a lot of the hard stuff for you, including Distrobox root access.

To install Distrobox via the official installer, you’ll need to first install the “curl” program, as it uses it to download itself. You can install “curl” with the command below.

sudo apt install curl

Once you’ve set up the Curl program, you can use it to download the latest version of Distrobox.

Distrobox — root access

curl https://raw.githubusercontent.com/89luca89/distrobox/main/install | sudo sh

Distrobox — no root access

curl https://raw.githubusercontent.com/89luca89/distrobox/main/install | sh -s -- -p ~/.local/bin/

When you’ve run the Distrobox installation script on Ubuntu, you’ll need to install Podman. Podman is a container tool that we’ll be using to interact with Distrobox. To install the Podman tool on Ubuntu, you’ll need to use the following apt install command below.

sudo apt install podman

With the Podman tool installed, you can run the podman command to verify that it is working.

podman

Replace the registries.conf file

The last thing you must do before you can use Distrobox on Ubuntu is to replace the “registries.conf” file. The one that comes with Ubuntu provides nowhere for users to download OCI images (OS containers).

To make things easy, I’ve uploaded a pre-configured file on Archive.org. To install it on your system, do the following.

First, open up a terminal. Then, use the sudo -s command to get a root shell.

sudo -s

Next, enable the root account with Ubuntu (it is often disabled.)

passwd

Exit the root shell using the exit command.

exit

Enter the root shell using the su command.

su

Use the CD command to access the /etc/containers/ folder.

cd /etc/containers/

Delete the existing registries.conf file using the rm command.

rm registries.conf

Finally, install the new configuration file.

wget https://ia601603.us.archive.org/11/items/registries/registries.conf

How to create an Arch Linux container on Ubuntu with Distrobox

To use the AUR on Arch Linux, you’ll first need to create an Arch Linux container with Distrobox. To do this, use the distrobox create command. This command will pull down an Arch Linux OCI image.

distrobox create --name archlinux --image archlinux:latest

Pulling down the Arch Linux OCI image shouldn’t take long. When it’s done, use the distrobox enter command below to access the new terminal.

distrobox enter archlinux

Once you enter the Arch Linux container, use the commands below to get the Trizen AUR helper set up on your Ubuntu system.

sudo pacman -Syy

sudo pacman -S git base-devel

git clone https://aur.archlinux.org/trizen.git
cd trizen/
makepkg -sri

With the Trizen AUR helper installed, you can search for programs to install with trizen -Ss program-name. When you’ve located a program you wish to install via the AUR, use the command below.

trizen -S program-name

Once the app is installed in the AUR, you can export it to Ubuntu using the following command.

distrobox-export --app program-name