How to list AUR installed packages?

Hi all,
I know that after an upgrade I have to rebuild all AUR installed packages.

My question is how can I list all packages that were installed from AUR?

pacman -Qm

-m, --foreign
Restrict or filter output to packages that were not found in the sync database(s). Typically these are packages that were downloaded manually and installed with --upgrade.

3 Likes

I did find this:
https://bbs.archlinux.org/viewtopic.php?id=272335
which may be worth a read.

1 Like

Thanks

What worked for me to list (alphabetically) AUR installed packages

First installed the utilities

pamac install expac pacutils

Then I used successufully exepac

[mirto@mostro ~]$ pacman -Qem | expac --timefmt="%F %T" "[%l] $(printf '\033[1;34m')%n$(printf '\033[0m') (%v)" - | sort -k3
[2025-02-15 19:20:21] bdinfo-git (r31.041c760-1)
[2024-06-05 12:52:58] gimp-extras (2.0.4-1)
[2024-10-09 09:24:53] lib32-libva-vdpau-driver (0.7.4-8)
[2024-07-17 09:56:10] libva-vdpau-driver (0.7.4-7)
[2025-02-16 18:39:55] makemkv (1.17.9-1)
[2024-05-13 13:17:26] manjaro-settings-manager-kcm (0.5.7-21)
[2024-07-17 09:56:15] reiserfsprogs (3.6.27-5)
[2024-05-13 13:14:16] spectre-meltdown-checker (0.46+23+g0f2edb1-1)
[mirto@mostro ~]$ 

and pacinfo

[mirto@mostro ~]$ pacman -Qqm | pacinfo | awk -F ": +" '/^Name:/{pkg=$2} /^Version:/{ver=$2} /^Install Date:/{print $2 " | \033[33m" pkg " \033[34m" ver "\033[0m"}' | sort -b -t"|" -k2
2025-02-15 19:20:21 | bdinfo-git r31.041c760-1
2024-06-05 12:52:58 | gimp-extras 2.0.4-1
2024-12-04 08:54:24 | ksanecore5 24.08.3-1
2024-10-09 09:24:53 | lib32-libva-vdpau-driver 0.7.4-8
2024-12-04 08:54:25 | libksane5 24.08.3-1
2024-07-17 09:56:10 | libva-vdpau-driver 0.7.4-7
2025-02-16 18:39:55 | makemkv 1.17.9-1
2024-05-13 13:17:26 | manjaro-settings-manager-kcm 0.5.7-21
2024-06-05 13:02:42 | opencollada 1:1.6.68-3
2024-07-17 09:56:15 | reiserfsprogs 3.6.27-5
2024-05-13 13:14:16 | spectre-meltdown-checker 0.46+23+g0f2edb1-1
2024-12-04 08:56:29 | v86d 0.1.10-13
2024-08-29 20:01:11 | xsane 0.999-7
[mirto@mostro ~]$ 
1 Like

Thanks very much for posting the procedure you used! This is really helpful for other readers and is much appreciated!

Cheers! :smiley_cat:

1 Like

You can also use:

pamac list -m

One advantage is that it tells you if a foreign package is specifically from the AUR. Blank ones are either no longer in the AUR, or were installed via another method such as git-clone & makepkg -srci (which is the case with maus, the helper I’ve been using for several years to update my system):

pamac list -m
amdgpu_top              0.10.3-1                      AUR  18.2 MB
fclones-gui             0.2.0-2                       AUR  3.9 MB
lyrics-in-terminal      1.7.0-1                       AUR  155.3 kB
maus                    1.2-1                              70.5 kB
ocs-url                 3.1.0-7                       AUR  133.5 kB
python-desktop-notifier 6.0.0-2                       AUR  286.1 kB
qarma-git               r93.334236f-1                 AUR  244.2 kB
qbittorrent-enhanced    5.0.3.10-1                    AUR  13.4 MB
qimgv-qt6-kde-git       v1.0.3.alpha.r134.gc913500-1  AUR  2.3 MB
solunar2-git            2.0c.r14.f30d862-1            AUR  198.4 kB
sunwait-git             r34.151d834-1                 AUR  39.2 kB
txt2html                2.5201-2                      AUR  213.3 kB
vdhcoapp-bin            2.0.20-2                      AUR  52.6 MB
videomerge              2.0.0-3                       AUR  534.2 kB
wayclip                 0.4.2-1                       AUR  38.6 kB
2 Likes

Nice format - it’s also a nice idea to have a scheduled job to export pkglist.txt to a backup.

pacman -Qem | expac --timefmt="%F %T" "[%l] $(printf '\033[1;34m')%n$(printf '\033[0m') (%v)" - | sort -k3 > /mnt/T3/BackInTime/backintime/SteelLegend/ben/1/aur.txt

This prompted me to separate my pkglist into separate ‘system’ and ‘aur’ lists and put them right in the folder in Dolphin Places marked ‘backup’.

2 Likes

Pssst.

While it has been somehwat neglected since the move to 6.0 …
(dont use it for its main purpose on/for Plasma6 systems)
… transfuse does have this functionality and it could be called remotely;

$ bash <(curl -s https://gitlab.com/cscs/transfuse/-/raw/master/transfuse.sh) -p

 Package lists created for 'native' and 'alien' packages and prefixed with 'NAME_20250219_1911'

$ cat NAME_20250219_1911_alien.txt 
aseprite
beautysh
bindtointerface
browsh
geoclue_fake-git
gimp-devel
goodvibes
jamesdsp
jitsi-meet-desktop
klassy
labwc-tweaks-git
[...]
$ cat NAME_20250219_1911_native.txt 
7zip
acpi
acpid
adobe-source-han-sans-cn-fonts
adobe-source-han-sans-jp-fonts
adobe-source-han-sans-kr-fonts
adobe-source-sans-fonts
alsa-firmware
alsa-utils
amd-ucode
arch-audit
ark
[...]

I was gonna say this may be useful on random other machines … but youd have to look up the command just as much as you would need to look up some expac string. :sweat_smile: :person_shrugging:

3 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.