Orphaned packages & optionally required packages

I have to confess I haven’t removed orphaned packages yet since installing Manjaro and thought I’ll give this a go before the big update to lsb-release 24.0. I read the pacman passage in the System Maintenance wiki and started with user $ pacman -Qdt to show me the list:

appstream-glib 0.8.2-3
cbindgen 0.26.0-1
clang15 15.0.7-2
cython 3.0.9-1
electron19 19.1.9-5
gdm 45.0.1-1
git-lfs 3.5.0-1
gptfdisk 1.0.10-1
gradience 0.4.1-3
gulp 4.0.2-3
imake 1.0.10-1
js102 102.15.0-1
ldns 1.8.3-2
libgit2 1:1.7.2-1
libindicator-gtk3 12.10.1-10
libsidplay 1.36.59-10
lld 16.0.6-1
nasm 2.16.01-1
nvm 0.39.7-1
pastebinit 1.5.1-1
pkgfile 21-2
python-async-timeout 4.0.3-1
python-build 1.1.1-1
python-distutils-extra 2.39-11
python-importlib-metadata 5.1.0-1
python-installer 0.7.0-4
python-pbr 6.0.0-1
rust 1:1.76.0-1
wasi-compiler-rt 16.0.6-2
wasi-libc++ 16.0.6-1
wasi-libc++abi 16.0.6-1
wayland-protocols 1.33-1
webkit2gtk-5.0 2.38.6-1
xorg-server-xvfb 21.1.12-0
yarn 1.22.21-1
yasm 1.3.0-6

Is there any package in there where I would run into problems when removing? Right after this I tried to run sudo pacman -Rs $(pacman -Qdtq) before aborting the command with the ‘n’ key:

checking dependencies...
:: hplip optionally requires python-reportlab: for pdf output in hp-scan
:: timeshift optionally requires xorg-xhost: For authorization on Wayland

Packages (55) 
compiler-rt15-15.0.7-1  
dnssec-anchors-20190629-3  
http-parser-2.9.4-1  
intltool-0.51.0-6  
llvm15-libs-15.0.7-1  
python-anyascii-0.3.2-2  
python-cssselect2-0.7.0-3  
python-material-color-utilities-0.1.5-3  
python-pyproject-hooks-1.0.0-5  
python-regex-2023.12.25-1  
python-reportlab-4.1.0-1  
python-svglib-1.5.1-2  
python-tinycss2-1.2.1-2  
python-webencodings-0.5.1-10  
python-yapsy-1.12.2-8  
python-zipp-3.17.0-1  
re2-1:20240301-1  
wasi-libc-1:0+352+c5264e2b-1  
xorg-xhost-1.0.9-1  
appstream-glib-0.8.2-3  
cbindgen-0.26.0-1  
clang15-15.0.7-2  
cython-3.0.9-1  
electron19-19.1.9-5  
gdm-45.0.1-1  
git-lfs-3.5.0-1  
gptfdisk-1.0.10-1  
gradience-0.4.1-3  
gulp-4.0.2-3  
imake-1.0.10-1  
js102-102.15.0-1  
ldns-1.8.3-2  
libgit2-1:1.7.2-1  
libindicator-gtk3-12.10.1-10  
libsidplay-1.36.59-10  
lld-16.0.6-1  
nasm-2.16.01-1  
nvm-0.39.7-1  
pastebinit-1.5.1-1  
pkgfile-21-2  
python-async-timeout-4.0.3-1  
python-build-1.1.1-1  
python-distutils-extra-2.39-11  
python-importlib-metadata-5.1.0-1  
python-installer-0.7.0-4  
python-pbr-6.0.0-1  
rust-1:1.76.0-1  
wasi-compiler-rt-16.0.6-2  
wasi-libc++-16.0.6-1  
wasi-libc++abi-16.0.6-1  
wayland-protocols-1.33-1  
webkit2gtk-5.0-2.38.6-1  
xorg-server-xvfb-21.1.12-0  
yarn-1.22.21-1  
yasm-1.3.0-6

Total Removed Size:  1000,68 MiB

I’m worried about the ‘optionally required’ packages for timeshift and the HP driver. Can I exclude these packages somehow from being removed?

don’t be worried - as they are optional - it means they are not required and you will break nothing.

if you need to - you can sync the packages afterwards

EDIT

Usually you can remove orphans - do not use any cascading options as this may remove packages you need.

1 Like

I think you need it for Gnome. If you remove it, you would face a black screen because of no display manager

3 Likes

Hmm, why would pacman mark this one as orphan then?

I’m a little bit confused now. On the one hand you say it’s okay to remove orphans but on the other hand it seems I risk bricking GNOME because of removing the display manager?

Is sudo pacman -Rs $(pacman -Qdtq) then not the right way to go?

You can mark gdm as explicit installed.

It is always a good idea to check the result as you did - as the package manager is just a computer program which only can deduce the action to take based on information retrieved from the system.

man pacman

If you prefer something but the command line Arch Linux provides web based man pages

https://man.archlinux.org/man/pacman.8

I recommend you to use yay or paru.

If you are using yay, yay -Yc is safe to remove dependencies if they are not used by any installed packages and are not explicit installed too
or paru --clean does the same.

1 Like

I’ve checked the man page from pacman. Are you talking about this --asexplicit Upgrade option? Would that mean I have to execute

sudo pacman -S --asexplicit gdm

Or better:

sudo pacman -D --asexplicit gdm

Both of these aren’t installed yet and I don’t want to throw in another package manager in the mix when I have a big update for the next lsb-release outstanding.

Thanks for the tip though.

I see. Thanks. I’m still a bit shocked something like this is even necessary and pacman is bricking GNOME.

Will I, by marking ‘gdm’ as ‘explicitly installed’, somehow run into problems later when GNOME gets updated to version 46.1?

I recommend to check every single package that you want to remove with this command:

pacman -Qi “Package name”

if:
(Required By : None)
(Optional For : None)

They are fine to remove.

Use a Timeshift snapshot before you removing packages.

Btw. it makes more sense to remove the Orphan Packages after the big update and not before you update.

3 Likes

When I try that for gdm right now it reports:

pacman -Qi gdm                                                                                                                                                                                      ✔ 
Name            : gdm
Version         : 45.0.1-1
Description     : Display manager and login screen
Architecture    : x86_64
URL             : https://wiki.gnome.org/Projects/GDM
Licenses        : GPL
Groups          : gnome
Provides        : None
Depends On      : gnome-session  gnome-shell  libcanberra  libxdmcp  systemd  upower  xorg-server  xorg-xhost  xorg-xrdb  libgdm
Optional Deps   : fprintd: fingerprint authentication [installed]
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 4,73 MiB
Packager        : Jan Alexander Steffens (heftig) <heftig@archlinux.org>
Build Date      : So 01 Okt 2023 14:37:29 CEST
Install Date    : Di 07 Nov 2023 04:07:44 CET
Install Reason  : Installed as a dependency for another package
Install Script  : Yes
Validated By    : Signature

It’s neither “Required” nor “Optional” for anything, yet @Zesko warns, I need it to run GNOME and the package itself says it’s the “Display manager and login screen”.

if your system is up-to-date you should have gdm version 46.

Timeshift will save your ass, so even if something goes wrong you can rollback with a Life Boot on a USB Drive and rollback your system with the Timeshift GUI and a already created snapshot.

Its easy… i did it 3 days ago again on my Laptop… just for fun :smiley:

If you unsure, just buy another external HDD and backup your files additional. So you will have less fear in future and not worrie so much of something goes wrong.

2 Likes

It isn’t. I deliberatly chose to remove orphans before the big upgrade (that’s at least what I initially thought) because I read somewhere about big downloads because of rebuilding electron.

When I checked for orphans on my system, I noticed an old version 19 and thought it might be a good idea to get rid of that before the update.

Makes total sense, the problem is when you remove your Ophans and update instant after it, without using all program’s and all possible features around them.

You will probably never know if the program’s don’t work after, because of the update or because you removed orphans.

I’m already running a Timeshift backup on an external hdd before every update and save all my personal files with Borg via Vorta GUI. I haven’t tested the waters though which means I don’t know exactly how to restore the Timeshift backup especially without a running window manager. I thought that’s a bridge I cross when needed.

But maybe I really should read up on this realizing how quickly I can run into problems with pacman.

That’s why I have decided to wait with removing the orphans after the update now. :slight_smile:

1 Like

Was gdm explicitly installed by default after installing Manjaro Gnome? Or did you accidentally mark it as a dependency?

I tried playing a new Manjaro Gnome ISO on KVM/QEMU and see that gdm is explicitly installed by default:

Install Reason  : Explicitly installed

I haven’t made any significant changes to my GNOME system since I installed it back in February '23. I’ve investigated the issue in the forum though and found a post by @deemon back in August '23: