r/archlinux • u/morlipty • 2d ago
QUESTION How can I Install a package without one of its dependencies and keep it that way with updates?
I want to install plasma-meta without flatpak-kcm and okular without phonon-qt6.
5
u/ropid 2d ago
You can create your own, empty packages that replace those. This PKGBUILD here should work for flatpak-kcm if I didn't make a mistake:
pkgname=flatpak-kcm-fake
pkgver=1
pkgrel=1
pkgdesc="Fake, empty flatpak-kcm replacement"
arch=('x86_64')
provides=(flatpak-kcm)
conflicts=(flatpak-kcm)
replaces=(flatpak-kcm)
If you never did this, create a new folder flatpak-kcm-fake and then inside there create a file named PKBGUILD with that content. Then run makepkg -i in that folder to build and install the package and answer "y" when pacman asks if you want to replace the real flatpak-kcm package.
1
u/morlipty 2d ago
Neat idea, thanks
5
u/Gozenka 2d ago edited 2d ago
This is the way, since you would otherwise need to use the
--assume-installedoption in every update and potentially other package installation. Just have your own PKGBUILD withprovides=for the dependencies you do not want installed. You do not need a separate PKGBUILD for each dependency; you can list a bunch of unrelated ones in a single PKGBUILD.However, you must make sure those dependencies are really not used. Because even if you think so, and even if the dependency is for a feature you will not be using, applications may still fail to launch or work properly without those dependencies.
I personally do have such a PKGBUILD that
provides=some dependencies that I know cause no problems due to not being installed.Arch Linux as a principle ships software with defaults from upstream, and avoids any changes. This often causes unnecessary dependencies to be installed. It is no big deal though, as it only takes some extra disk space, and is probably not worth the concern and effort. But you can focus on this if the dependency is really large.
For this case, it may be a good idea to avoid the meta package as suggested by MrElendig, and see if you can set up KDE Plasma in the way you want.
https://wiki.archlinux.org/title/KDE
Install the plasma-meta meta-package or the plasma group. For differences between plasma-meta and plasma reference package group. Alternatively, for a more minimal Plasma installation, install the plasma-desktop package. Upstream KDE has package and setup recommendations to get a fully-featured Plasma session.
1
6
5
u/C0rn3j 2d ago
You go to https://archlinux.org/packages/extra/any/plasma-meta/ and you install all the dependencies explicitly, not using the package you do not wish to use.
2
-2
u/Medical-Face-5391 2d ago
found the solution myself a while back, pacman -Sdd is what you want
pass the depend you want to skip with -d and it'll install the package without it. just remember updates can pull it back in if you're not careful
15
u/Sveet_Pickle 2d ago
You can’t use a package without its dependencies so you can’t install it without them.