Personal Meta Packages
I use Arch Linux meta packages to manage the dependencies on my system. You can see all of my PKGBUILD files here. They are broken out into individual meta package groups based on the type of system I'm installing for.
For example PKGBUILD-desktop
contains all the dependencies for my basic desktop environment.
This includes my window manager (sway), notification daemons, dependencies for my
i3blocks scripts, fonts, and basic
applications that I want on all of my Linux desktops.
This means I can run pacman -Qtt
anytime to see what packages I've installed on my system that are
truly optional:
$ pacman -Qtt alacritty 0.4.3-1 alexdavid-desktop-meta 1.1.12-1 alexdavid-development-meta 1.0.3-1 alexdavid-shared-meta 1.1.7-1 blender 17:2.83-1 imagemagick 7.0.10.19-1 libreoffice-still 6.3.6-1 musescore 3.4.2-1
I can confidently remove any of these packages without having to worry that something will break. This is because I know that if I installed any of them to meet a dependency of a script I wrote, or to fill a missing binary that I use often I would have added it to the appropriate meta package.
I am also able to add comments to the PKGBUILD files to document why I added the package to being with.
If I decide a dependency is no longer needed on all systems, I simply remove it from the meta package.
Next time I install it, the dependency drops into the unrequired list. For example, after trying it out
Alacritty for the past few weeks, I decided to switch to it
on all of my systems. I add alacritty
and remove termite
from my PKGBUILD-desktop
:
$ makepkg -si -p PKGBUILD-desktop ==> Making package: alexdavid-desktop-meta 1.1.13-1 (Sun 21 Jun 2020 09:48:50 PM PDT) ==> Checking runtime dependencies... ==> Checking buildtime dependencies... ==> Retrieving sources... ==> Extracting sources... ==> Removing existing $pkgdir/ directory... ==> Entering fakeroot environment... ==> Starting package()... ==> Tidying install... -> Removing libtool files... -> Purging unwanted files... -> Removing static library files... -> Stripping unneeded symbols from binaries and libraries... -> Compressing man and info pages... ==> Checking for packaging issues... ==> Creating package "alexdavid-desktop-meta"... -> Generating .PKGINFO file... -> Generating .BUILDINFO file... -> Generating .MTREE file... -> Compressing package... ==> Leaving fakeroot environment. ==> Finished making: alexdavid-desktop-meta 1.1.13-1 (Sun 21 Jun 2020 09:48:50 PM PDT) ==> Installing package alexdavid-desktop-meta with pacman -U... loading packages... resolving dependencies... looking for conflicting packages... Packages (1) alexdavid-desktop-meta-1.1.13-1 :: Proceed with installation? [Y/n] y (1/1) checking keys in keyring [####################################################] 100% (1/1) checking package integrity [####################################################] 100% (1/1) loading package files [####################################################] 100% (1/1) checking for file conflicts [####################################################] 100% (1/1) checking available disk space [####################################################] 100% :: Processing package changes... (1/1) upgrading alexdavid-desktop-meta [####################################################] 100% $ pacman -Qtt alexdavid-desktop-meta 1.1.12-1 alexdavid-development-meta 1.0.3-1 alexdavid-shared-meta 1.1.7-1 blender 17:2.83-1 imagemagick 7.0.10.19-1 libreoffice-still 6.3.6-1 musescore 3.4.2-1 termite 15-1
And I am then free to remove it from my systems at my leisure:
$ sudo pacman -Rsn termite checking dependencies... Packages (2) vte-common-0.60.3-1 termite-15-1 Total Removed Size: 1.42 MiB :: Do you want to remove these packages? [Y/n] y :: Processing package changes... (1/2) removing termite [####################################################] 100% (2/2) removing vte-common [####################################################] 100% :: Running post-transaction hooks... (1/2) Arming ConditionNeedsUpdate... (2/2) Updating the desktop file MIME type cache...
Meta packages also have the advantage of quickly setting up a new system exactly how I like it. All I need to do on a new Arch install is clone my dotfiles, and install the appropriate meta packages and I feel right at home.