Skip to content

Instantly share code, notes, and snippets.

@geosharma
Last active April 17, 2024 20:37
Show Gist options
  • Star 33 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save geosharma/afe1ea9ebe58cb67aaaba62a0d47bc7a to your computer and use it in GitHub Desktop.
Save geosharma/afe1ea9ebe58cb67aaaba62a0d47bc7a to your computer and use it in GitHub Desktop.
Arch Linux: aurutils installation and configuration

aurutils installation and configuration

This is not a getting started guide, just notes to myself. Due to my limited knowledge there could be mistakes and better ways to do things. I have configured aurutils to the best of my knowledge after reading the manpages and forums. Please refer to aurutils(7) manpages for installation and configuration.

Reference: aurutils(7)

Install aurutils

Install the aurutils using the normal AUR package installation procedure. Until I found aurutils, I used to create a separate directory ~/aur/ for all AUR packages.

$ cd ~/aur
$ git clone https://aur.archlinux.org/aurutils.git
$ cd aurutils-git
$ makepkg -si

Creating local repository

Create a separate pacman configuration file for the custom repository in /etc/pacman.d/

$ sudo nano /etc/pacman.d/custom

Add the lines in the file /etc/pacman.d/custom:

[options]
CacheDir = /var/cache/pacman/pkg
CacheDir = /var/cache/pacman/custom
CleanMethod = KeepCurrent

[custom]
SigLevel = Optional TrustAll
Server = file:///var/cache/pacman/custom

Add the following lines for the custom repository configuration to the end of /etc/pacman.conf

Include = /etc/pacman.d/custom

Create the repository root in /var/cache/pacman

sudo install -d /var/cache/pacman/custom -o $USER

Create the database in /var/cache/pacman/custom/

repo-add /var/cache/pacman/custom/custom.db.tar

I have not tried this, if you already have built packages from AUR using makepkg -si copy/move all the *.pkg.tar.xz files to /var/cache/pacman/custom/ and

$ cd /var/cache/pacman/custom
$ repo-add -n myrepo.db.tar *.pkg.tar.xz

Then synchronize pacman:

$ sudo pacman -Syu

For the above change from repose to repo-add see discussion

Install packages

For example we want to install tor-browser-en from AUR. Use aursync to download and build AUR package and place it in the custom repository. Then use pacman -S packagename to install the package.

$ aursync tor-browser-en
$ sudo pacman -S tor-browser-en

Build and update all installed AUR packages

Update all installed AUR packages with aursync

aur sync -u
@TN-1
Copy link

TN-1 commented Sep 28, 2021

Correction for the final line, should be aur sync -u
Thankyou for putting this together, very helpful!

@artkpv
Copy link

artkpv commented Jun 20, 2022

Thanks! How to remove a package so the aur sync -u won't update the package any more?

@akippnn
Copy link

akippnn commented Jun 25, 2022

Thanks! How to remove a package so the aur sync -u won't update the package any more?

man aur at line 230 should help you with that. There's instructions on making a custom script, and also a pre-made script to remove a package.

@geosharma
Copy link
Author

Correction for the final line, should be aur sync -u Thankyou for putting this together, very helpful!

Thank you. Updated.

@tehybel
Copy link

tehybel commented Sep 7, 2022

Thanks for the gist!

I can confirm that the repo-add command works, although the package extension depends on which compression scheme is in use. On my system that is zstd:

$ repo-add -n ./custom.db.tar *.pkg.tar.zst     
==> Extracting custom.db.tar to a temporary location...
==> Extracting custom.files.tar to a temporary location...
==> Adding package 'linux519-tkg-pds-5.19.7-269-x86_64.pkg.tar.zst'
  -> Computing checksums...
  -> Creating 'desc' db entry...
  -> Creating 'files' db entry...
==> Adding package 'linux519-tkg-pds-headers-5.19.7-269-x86_64.pkg.tar.zst'
  -> Computing checksums...
  -> Creating 'desc' db entry...
  -> Creating 'files' db entry...
==> Creating updated database file './custom.db.tar'
$ 

You can use something like the following to find old packages to add:

find ~/ -type f -name '*\.pkg.tar\.*'

@conhibit
Copy link

YOUR INSTALL INSTRUCTIONS AINT WORKIN.... after unloading the .git their appears tro be no folder existing?

cd ~/aur
git clone https://aur.archlinux.org/aurutils.git
cd aurutils-git
makepkg -si

cd: no such file or directory: /home/negatron/aur
Cloning into 'aurutils'...
remote: Enumerating objects: 609, done.
remote: Counting objects: 100% (609/609), done.
remote: Compressing objects: 100% (401/401), done.
remote: Total 609 (delta 209), reused 608 (delta 208), pack-reused 0
Receiving objects: 100% (609/609), 125.35 KiB | 418.00 KiB/s, done.
Resolving deltas: 100% (209/209), done.
cd: no such file or directory: aurutils-git

@2001herne
Copy link

@conhibit Looks like a slight mismatch between the -git and stable aur packages - the git clone gets the stable package but the cd assumes the -git version. Just use cd aurutils instead of cd aurutils-git

@TerranWorks
Copy link

So I tried to use this guide and ran into a few issues. I thought I'd include them here to help others.

  1. In this step repo-add -n myrepo.db.tar *.pkg.tar.xz instead of typing myrepo.db.tar use the custom.db.tar you created in the previous step. Its obvious in hindsight but it messed me up my first time installing this
  2. If you see a message requiring vifm this means the sync process has tried to run an aur view command and failed. This is a deadly error that stops the build process so when you run sudo pacman -S my-package later, it will fail. Either install vifm or run aur sync with the --noview option to skip that step and continue on with the build
  3. To confirm that your packages have been built and are available in your repo run pacman -Slq custom and you should see a list of packages available in your custom repo
  4. Finally I've found that after building your packages you have to install them manually with sudo pacman -Sy my-package1 my-package2 once before sudo pacman -Syu will update your packages. To avoid having to list every package maually you can use the above command like so: sudo pacman -Sy $(pacman -Slq custom)

I am new to aurutils so some of these things may be obvious or I may have misunderstood something but these were all things that I got stuck on or that helped me so I wanted to write them down somewhere and I thought other might benefit

@DiedByDisgust
Copy link

DiedByDisgust commented Apr 17, 2024

I followed this guide but on the step repo-add /var/cache/pacman/custom/custom.db.tar i get ==> No changes made to package database. is this guide still accurate?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment