Pacstall brings the freedom of the AUR to Ubuntu

AUR You Ready?

© Photo by Andhika Soreng on Unsplash

© Photo by Andhika Soreng on Unsplash

Article from Issue 255/2022
Author(s):

Many users wish Ubuntu had a free and easily accessible user-driven package repository like Arch's AUR. Pacstall steps into the gap.

Ubuntu is one of the most popular Linux distros, but it is still missing some benefits that other Linux communities enjoy. For instance, the Ubuntu repositories might not have the package (or the latest version) you need, which means you'll need to hunt around GitHub for source code to compile that package yourself. The two official alternative methods for getting new versions of packages (snaps and PPAs) are also lacking in many areas (see the "Issues with Snaps and PPAs" box).

Issues with Snaps and PPAs

Snaps use mount points to load themselves, which makes it difficult to work with debugging commands such as lsblk. Those mount points also are not removed after the snap has been removed, which is very annoying. Snaps also take some time to load, which frustrates many users. PPAs are essentially mini-repositories for packages, which can help users who may want a couple up-to-date packages while still keeping the rest of the system in line with Ubuntu's repositories. Unfortunately, PPA's can easily be abandoned without much detection and can lead to dependency hell when upgrading.

When it comes to finding and installing new software from a broad and diverse user base, many Ubuntu users look longingly to Arch Linux and its popular Arch User Repository (AUR). The AUR is a large community-driven repository. The goal of AUR is to provide users with easy access to packages that aren't present in Arch's official repositories. The package format used with AUR is simple enough that a developer or maintainer from almost any software project can easily create an AUR package for their software that anyone can use for quick and simple package installation. The AUR, which currently contains around 58,000 packages, has helped Arch become the distro for users who want the greatest software availability.

Many Ubuntu users have wondered if Ubuntu could have something like the AUR. Enter Pacstall [1] – a command-line package manager that aims to bring the software availability and freshness of Arch/AUR packages to Ubuntu and Debian. Like the AUR, the Pacstall project contains an open repository of package scripts that anyone can add to, improve, and utilize.

The Pacstall project is just getting started, and it doesn't have anywhere near the number of packages available in the AUR, but the number is growing as more users become aware of the Pacstall project.

How to Install

To install Pacstall, simply run the command:

sudo bash -c "$(curl -fsSL https://git.io/JsADh ||wget -q https://git.io/JsADh -O -)"

Then, check if Pacstall has successfully installed by running this command, which will print your version number:

pacstall -V

Using Pacstall

To search for a package, run:

pacstall -S foo

To install a package with Pacstall, for instance, neofetch (located in the Pacstall user repository [2]), simply run the following command:

pacstall -I neofetch

And to install from a local pacscript:

pacstall -Il neofetch

Now if you want to remove a package, the command is simple as:

pacstall -R neofetch

which will remove neofetch and run post removal hooks (if any are available). Every so often, you will want to upgrade packages, which is done by running:

pacstall -Up

If you want to get more information on a package you've installed, run

pacstall -Qi neofetch

Making a Package

Like the AUR, Pacstall is designed to make it easy for any user to create a package. For example, suppose I want to make a package for st, the simple terminal. I start by making a file called st.pacscript and filling it with the contents of Listing 1.

Listing 1

Script Template

01 name=""
02 version=""
03 url=""
04 build_depends=""
05 depends=""
06 description=""
07 hash=""
08 maintainer=""
09
10 prepare() {
11 }
12
13 build() {
14 }
15
16 install() {
17 }

Then I fill in st for the name variable and 0.8.4 for the version. To find a tarball for st, I go to the project website [3] and scroll to the bottom to where it says Download. Copy the link to the tarball (in my case, https://dl.suckless.org/st/st-0.8.4.tar.gz), and fill that link into the url variable.

St does not specify Ubuntu dependencies, but, to save you the hassle, the one dependency needed is libx11-dev. Put that into the build_depends variable. This will be installed by Apt right before the building process. Now you need to give a hash to verify the authenticity of the tarball when you download. (This step is optional but highly encouraged.) Simply run:

wget -q https://dl.suckless.org/st/st-0.8.4.tar.gz && sha256sum st-0.8.4.tar.gz

This command will print out the checksum of the tarball. You only need the first string, with no file name included. Put that into the hash variable. Fill out description with a short and concise description of st, and fill in maintainer with your name. You can now remove any variables not used. In the prepare and build functions, add the command true, because st does not need to be built before installing.

In the install function, put:

sudo make clean install DESTDIR=$STOWDIR/st

This looks like a fairly standard make install except for the ending. The DESTDIR will tell make to build $STOWDIR/st, which is a path to /usr/src/pacstall/st. This step is needed because Pacstall will symlink that directory to the root directory later, allowing easy file management for each package. Now it's time to test the pacscript. Exit your text editor and run this command to install from a local file:

pacstall -Il st

This command will install the script you just made onto your system. For information on how to make more complicated scripts, visit Pacstall's informative guide to making a pacscript [4].

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Rolling Release Rhino Linux Available Now

    The developers of Rhino Linux have been teasing their rolling-release Ubuntu distribution for some time now, and it's finally here for everyone to download and use.

  • Rhino Linux Announces Latest "Quick Update"

    If you prefer your Linux distribution to be of the rolling type, Rhino Linux delivers a beautiful and reliable experience.

  • FOSSPicks

    This month Graham looks at Ardour, FluffyChat, PlugData, Cameractrls, hiSHtory, CadQuery Editor, and more!

  • News

    In the news: KSMBD Finally Reaches a Stable State; Nitrux 3.0.0; Linux From Scratch 12.0; Linux Kernel 6.5; UbuntuDDE 23.04; Star Labs Reveals a New Surface-Like Linux Tablet; SUSE Going Private (Again); Devuan GNU+Linux; CIQ, Oracle, and SUSE Form Alliance to Thwart Near-Closing of the RHEL Source; and Rolling Release Rhino Linux.

  • Nitrux 1.5 Ships with Kernel 5.13

    Debian-based Nitrux Linux is the first distribution to ship with kernel 5.13

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News