How can I tell if a package is part of my 'default' installation?

I was wondering where / how I can obtain a list of the default packages installed for my distribution version (details below)?

Especially of interest is what (if any) default packages are actually classed as ‘foreign’ (AUR)?
– i.e. listed by running pacman -Qm

gtkhash 1.5-3
gtkhash-nemo 1.5-3
libcroco 0.6.13-2
linux65 6.5.3-1
manjaro-hotfixes 2024.1-2
pyside2 5.15.13-2
python-jade-application-kit 3.5.7-7
python-manjaro-sdk 1:0.1.1-1
python-shiboken2 5.15.13-2
spectre-meltdown-checker 0.46+23+g0f2edb1-1
vscodium-bin 1.89.1.24130-1
vscodium-bin-marketplace 1.76.0-1
web-installer-url-handler 2.3-1

** vscodium-_ can be ignored as i did explicitly install it!

I am also curious about packages that are ‘true orphans’, noting entries returned by running pacman -Qqtd – some of which may be ‘genuine’ but with incorrect or inconsistent “Install Reason”, others I may actually be able to remove?

cmake
evolution-data-server
fakeroot
gptfdisk
ldns
lib32-libunwind
lib32-libxdamage
libcroco
libkate
libmfx
python-jade-application-kit
python-ply
python-pydantic
wayland-protocols
web-installer-url-handler
webrtc-audio-processing

The reason is that several new packages have ‘appeared’ on my system since I first installed Manjaro, that I have not manually installed, and I am trying to ascertain why. – i.e. were they added to Manjaro ‘default’ or have they crept in as a dependency for something else, and ultimately are they safe to remove?


System:
-Arch: x86_64 bits
-Kernel: 6.5.3-1-MANJARO
-Desktop: Cinnamon v: 6.0.4
-CPU: Intel© Core™ i7-7500U
-Graphics: Intel Corporation HD Graphics 620
-RAM: ~ 8Gb Total

There is two files in the root of your system containing the information

 $ ls /*.txt
/desktopfs-pkgs.txt  /rootfs-pkgs.txt

Packages appearing as you say is likely caused by the package managers dependency resolution.

If any given local package changes dependencies - a sync will contain information about the changes and will add the new dependency.

If a package is removed - the installed dependency may not be removed - thus becoming an orphan.

This can be explained, as the system cannot know if the package is used outside the known dependency tree - thus better safe than sorry - the package is left untouched.

Foreign - you’ve got packages there that have been removed from the repositories at some point, that’s why they’re now foreign. I’m not going to check them all but that’s definitely the case for linux65, manjaro-hotfixes, and spectre-meltdown-checker.

Orphans - Are safe to remove. If really want to know what used to depend on a orphan package then you can use pacsift from the pacutils package to find out (as long as what depended on it is still in /var/cache/pacman/pkg/).

E.g. python-pycparser used to depend on python-ply but the latest version doesn’t any more;

$ pacsift --cache --any --depends="python-ply" --optdepends="python-ply" 2>/dev/null
file:///var/cache/pacman/pkg/python-pycparser-2.21-5-any.pkg.tar.zst

$ pacman -Qi python-pycparser
Name            : python-pycparser
Version         : 2.22-2
Description     : C parser and AST generator written in Python
Architecture    : any
URL             : https://github.com/eliben/pycparser
Licenses        : BSD
Groups          : None
Provides        : None
Depends On      : python
Optional Deps   : None
Required By     : python-cffi
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 1751.16 KiB
Packager        : Jelle van der Waa <jelle@archlinux.org>
Build Date      : Wed 03 Apr 2024 20:14:55 BST
Install Date    : Fri 17 May 2024 15:28:40 BST
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : Signature

Thank you, I have been looking through the files you mentioned and I have a quick question – are they updated as new packages are installed / removed, or are they more like a snapshot of what packages were included when the system was first installed?

From what I have found comparing these list of packages, and with the help from running pacman -Qi <package>, most of the ‘orphan’ packages are in fact part of the original system installation – the only exception it seems being “cmake” (which I assume found it’s way on as a build dependency for something).

Similarly with the list of ‘foreign’ packages, with the noted exception of vscodium!

@MrLavender
Ahh thank you, that explains so much!

I will investigate pacutils and double check everything before I remove any packages.

I am curious about linux65 however … should I be concerned that it doesn’t appear on the list of supported kernels from the last stable update?

Are kernels automatically updated along with the rest of the system packages via the Package Manager or do I need to (should I) manage them separately?

– Thanks

All kernel versions except for LTS ones become end-of-life after a few months and you need to manage that yourself.

The simplest way to proceed is to install linux 6.6 which is LTS and you won’t have to worry about it again for years. You can do that from the Manjaro Settings Manager GUI.

After installing 6.6 reboot and make sure that 6.6 is running before you remove 6.5.

The lists is the packages and their versions at the time the ISO was created.

These package lists does not change - unless you manully change them.

Thus it is possible to use the files for various purposes.

The 2 txt files with the original iso files are nice, but in practice it makes much more sense to compare against the current list of packages of the newes iso with mapare

bash <(curl -s https://gitlab.com/cscs/mapare/-/raw/main/mapare) -IP
1 Like

This does not work for cinnamon!

Indeed, my bad. Mapare is for the 3 official flavors.