How I would Relearn Linux #4: Package Management

Good Morning from my Robotics Lab! This is Shadow_8472 with part four of How I Would Relearn Linux, where I answer the questions I had and offer the tips I wish I knew a few years ago when I started exploring Linux. Let’s get started!

Why Package Managers are Important

Linux software is often distributed in modular units known as packages be they applications, drivers, or kernel modules. If you’ve ever assembled a modpack for a game, there’s a chance you’ve had to chase down a dependencies or address conflicts before you could use it. Now imagine doing that for a full operating system, and you get the idea of what using Linux was like. A single packaged game might require tens or hundreds of prerequisite packages by the time you settle everything. This problem was quickly automated with package managers.

How to Use a Package Manager

Specific features of a package manager will vary, but their primary goal is to install, update, and remove packages. It will have a repository list telling it where to install software from. Android is Linux… kinda. Its default package manager is the Play Store. Its job is to install, update, and remove packages per user direction while making the process as invisible as possible. Unlike Android, a package manager in Linux is typically invoked using another program called Sudo (my preferred pneumonic is “Super User DO” even though I use the su-dough pronunciation).

When installing packages, a package manager has a list of repositories to contact. It will reach out to them with each package being installed and usually ask for clarification if multiple matches are found. It then does the same thing for all the listed prerequisites until it generates a full list of the missing packages needed to make your desired package run. On user confirmation, it begins download/installation.

Updating software is similar to initial installation. New versions may add features that rely on new or different library packages. A package manager will recalculate the missing packages and notify the user if any installed packages are either missing or no longer needed (This is true for the Debian/Ubuntu family’s package manager, apt. I’m not as familiar with pacman or dnf to speak for their specific behavior – as in they might just auto-remove them and I’d be none the wiser).

Uninstalling packages is similar to updating, only an explicitly installed package is being removed along with its unneeded dependencies. This may also be a necessary step if a conflict arises which the package manager cannot automatically resolve, though additional force may be required to bypass dependency checking.

Secondary Package Managers

Going back to Android for a moment, it is possible to “sideload” apps by downloading them from outside the Play Store. It’s even possible to download other app stores, such as F-Droid, which specializes in Free and Open Source Software and the Aurora Store, which uses the Play Store’s repositories, but with an emphasis on being privacy conscious. Similarly, there exist Linux package managers aimed at less-trusted community packages or packages that take care of more of their prerequisites. In this way, multiple versions of a program my be installed simultaneously, which may lead to confusion if a broken copy isn’t cleaned up in the hopes that an update will fix it.

Caution is often advised though when considering adding multiple primary package managers. I’ve not seen or looked for a solid explanation, but I can guess it’s so you don’t break your system by installing everything twice and having things call the wrong programs using twisted system links.

Takeaway

Whatever package manager your installed distro uses, you will get more out of your experience if you take the time to learn how to search for packages (a case where you don’t need sudo). When an exact version matters, you can usually extract that information from your package manager. If you cannot find a package, www.pkgs.org is also your friend. Your package may be in the repositories for the next or previous distribution, or in a repository you have to add special.

For example: in another project of mine, I found and looked up the version of Podman I had on Debian to learn it doesn’t support the Secrets feature I had been using on Rocky Linux: I had to adjust my approach accordingly.

Final Question

What package manager(s) came with your system(s)?

I look forward to hearing from you in the comments below or on my Socials!

It’s Time I Install EndeavourOS

Good Morning from my Robotics Lab! This is Shadow_8472 with a side project for the week. Let’s get started!

OS installation side project. We’ll see how this goes.

Manjaro has a hate club, and I sympathize with it. It’s stable most of the time, but gives me a large bombshell or two per year. I’ve been meaning to try out EndeavourOS, another user-friendly take on Arch, and my hard drive filling up is as good an excuse as any.

One small task before starting: my file system hangs whenever I try to access a down or inaccessible NFS share on GoldenOakLibry, and it won’t unfreeze until making contact again or forced closed. LibreOffice Writer is a notable offender as it can lock up attempting to autosave. A deeper look into this issue and it works as intended. For what it’s worth, GoldenOak’s HDD’s spin up in loosly 45-50 seconds, so allowing for a rounded minute in the automount file seems reasonable (TimeoutIdleSec).

NFS:
Network File System

HDD:
Hard Disk Drive – specifically the kind with spinning platters

EndeavourOS Installation

I updated the EndeavourOS installer on my Ventoy USB drive and verified it with sha256sum. When I booted to it though, I found it in legacy BIOS mode, and I’m after UEFI experience. I tried my PopOS image from working with UEFI on my sister’s computer, and it too ended up in legacy BIOS. I even booted my old copy of Windows 10 – legacy BIOS. Does my hardware support UEFI or not?!

In short: yes. I dug up a setting in my motherboard firmware to allow UEFI and Legacy, disable Legacy, or disable UEFI. Curious, I disabled Legacy to force UEFI boot. Windows disapeared, EndeavourOS hung, and Manjaro surprisingly loaded just fine, though it sat so long on a black screen I thought was hanging the first time. Sure enough, it had an efi directory, confirming a UEFI boot:

$ ls /sys/firmware/
acpi dmi efi memmap

Ventoy’s Grub2 option got me into UEFI/EndeavourOS for installation. It was otherwise an unremarkable experience compared to other “easy” installers I’ve used. I researched each unfamiliar option and chose systemd-boot as my boot loader even though it only works for UEFI installations.

Moving In (Pacman)

Moving in was dead simple and super clean. Mind blown. In order of installation, my top priorities (after a lefty mouse and stylized pointer) were Firefox, LibreOffice, and NFS – the minimum needed to continue drafting this post. EndeavourOS lacks a visual package manager, so I formally introduced myself to Pacman.

Firefox came preinstalled. I mounted my Manjaro drive and copied ~/.mozila over. Boom! All my tabs, windows, extensions, bookmarks, and everything else was present and accounted for. Maybe a font was different, but I’ll research it later if I’m not adjusted by then (editing note: I’m adjusted now).

LibreOffice was a pain, if you could call it that. I needed to research the “fresh” and “still” branches (testing and stable, respectively), and opted to see what I had on Manjaro. I pulled a massive shortcut and used chroot to approximate a Manjaro shell instead of rebooting back and forth a bunch. Power rush! After a break to mentally process the power grab, I installed the “still” version and later followed it up with hunspell-en_us so spell check had a dictionary.

chroot:
CHange ROOT – starts a shell with a root directory deeper within the file system.

NFS was the last and most routine piece to access GoldenOakLibry: create mountpoints, copy and enable .mount/.automount files. Ray Lyson’s NFS/Samba guide is easily a favorite bookmark [1].

I began listing other things to bring over: ~/.ssh, Discord, FreeTube, AngryIP, Balena Etcher, and Steam are all things I use with varying frequencies. SSH and Discord involved packages from Pacman and copying my old data, like I did with Firefox. Steam offered me my first non-elective challenge when I had to research the correct Vulkan libraries (graphics drivers) to use.

Moving in (Arch User Repository)

My other listed programs will be built with the Arch User Repository, a listing of user-submitted scripts called PKGBUILD files. It is strongly recommended you inspect AUR scripts before running them, and to avoid using automated tools like yay until you’ve manually built and installed a few packages. Hold bad files accountable by flagging them, and vote for ones that build packages properly. Reputable AUR packages may be adopted by a “Trusted User” and relocated to the main repositories.

FreeTube has five different AUR listings. Git (potentially unstable), Wayland (outdated), and appimage (few votes) are all unsuitable – leaving freetube-bin and freetube for serious consideration. Freetube-bin has almost 3x more votes and 22x the popularity (how recently/widely used a package is) as well as having a longer maintenance history. On closer inspection, freetube builds from source, while freetube-bin converts a .deb package. For the purposes of learning AUR from 0, I’ll be using freetube-bin.

Freetube-bin’s AUR page has a Git clone link. Its PKGBUILD file looked simple enough. Makepkg finished, leaving me with the original .deb it downloaded and a .pkg.tar.zst file I eventually found and installed with Pacman. I copied over ~/.config/FreeTube, only to find it was from a broken install I had replaced inelegantly.

AngryIP scanner has only one version: ipscan, but it requires Java. I went through the process of installing GraalVM for Java19/aarch64, replicating a set of symbolic links pointing to Java.

$ java -version

Wrong architecture. I replaced my install with the amd64 version, and that worked. I made a note there in /usr/lib/jvm to use amd64 next time and deleted my raw downloads.

AngryIP/ipscan’s PKGBUILD file builds it from source, and as such looks more involved. The most suspect thing was a for loop I didn’t understand right away. I went to build the package and mere Java doesn’t count as java-runtime. It wants one of 124 Java packages to satisfy its one dependency. I found a version of jre-OpenJDK. Pacman wasn’t amused with my GraalVM shortcuts though, so I disabled them. Both jre-openjdk was installed shortly and ipscan compiled afterwords. Over the weekend between download and installation, AngryIP had gotten a minor revision. I’ll pass for now.

Oh, Balena Etcher. WOW! Three popular candidates showed up – two were a version out of date, and the other a very new appimage with zero maintenance history. I downloaded the the Appimage PKGBUILD anyway and instected it. It looked enough like the others I decided to go with it. Building and installation went smoothly.

Takeaway

It speaks volumes to my personal progress that I thought this might be “side project.” I was wrong, but I must remember that similar projects used to take at least one week for the base OS install and another for each major program I wanted. My impression is that EndeavourOS is for people who are/ want to be fluent in the command line, but don’t want to deal with straight Arch.

EndeavourOS is taking my skill to the next level. I’ve learned by both blitzing the boring tasks and slamming into using the AUR without cheating packages in with pamac. KDE is all purple, but I’m game for the change from the traditional blue.

GRUMBLE! EndeavourOS had a core package update as I was finishing my editing, and now it hangs while booting. I’m back on Manjaro, and updates were waiting. I moved some stuff over so my 1.8gb download could fit. I also linked ~/.mozilla to my EndeavourOS copy.

This computer is messed up right now.

Final Question

I’ve had a busy week with material going on for three potential projects. How was yours?

I look forward hearing your answers on in the comments below or on my Socials.

Work Cited

[1] R. Lyon, “On-Demand NFS and Samba Connections in Linux with Systemd Automount,” Ray Against the Machine, Oct. 7, 2020. (Edited Aug. 26, 2021). [Online]. Available: https://rayagainstthemachine.net/linux%20administration/systemd-automount/. [Accessed Feb. 13, 2023].