Let's All Use Package Managers

I'm a member of a lot of the ham-radio-related technology mailing lists and groups.  From the huge number of emails I get on a daily basis, I see what is a typical ham radio pattern -- the old-timers are doing things the way they did it back in the day.  While my usual reaction is something along the lines of "Ok...whatever, dude.", there is a line.  As an IT person (I build large data centers for a living), the one that drives me batty is seeing users compile software from source.

I would never name any names, of course, but it's obvious that these users did some coding stuff before they retired.  In 2003, compiling your code was the way to do things.  You would hear about some code you wanted to run, find the website, download the .tar.gz file, unzip it, then compile it.    You also hoped that the author of the code developed a Makefile so you could just "make" the software (that is, run "make install").  This was the way we installed code on servers and workstations for decades.

Today, though, we have tools called package managers.  These tools, such as APT or YUM, have repositories full of all sorts of software to install, so you don't have to go hunting for what you need.  A more important feature, though, is that these managers handle the dependencies.  You no longer have to hope that the Makefile exists and that you already have the required libraries for a new package.  The package manager will do its best to install your software -- no matter what the situation is.  This makes installing software as easy as "apt install <PACKAGE>" or "yum install <PACKAGE>".  If the new software doesn't have some weird requirements, you should be ready to go pretty quickly.

Let's use Direwolf as an example.  This is a piece of software that I run on a Raspberry Pi 3B+ to serve as a software TNC for my Winlink gateway and my APRS beacons.  I'm running Raspbian on my Pi, which is an operating system based on Debian.  This is the typical OS that you put on your Raspberry Pi, so there's nothing special here.  Raspbian uses the Advanced Package Tool, also known as APT.

To install Direwolf on your Pi, you would do this.

sudo apt install direwolf

Some stuff will happen, and it will eventually ask you if you want to download and install Direwolf along with all the other software packages it needs.  You hit "y", and off it goes!  Much easier than compiling from source.

Where package managers really shine, though, is with updates.  If the Direwolf package or one of the packages it uses (like libasound2, which lets it interfaces with the sound card) has a newer version, all you do is update it.

sudo apt update
sudo apt install direwolf

The first line there says to update the list of packages available from the repository.  The second line says to install Direwolf again, but this time from the new list of packages we just updated.  If anything needs to be updated, it will be, and, like magic, you're running the new version.

If you're compiling from source, you would need to recompile each and every piece that needs updating by hand.  For example, if libasound2 needed to be update, you would potentially have to compile that package, the recompile Direwolf again to use the new version of the library.  A very complicated solution to what is now a simple problem.

As of today, Direwolf 1.5 is the latest version, but, if you use APT to install it, you get version 1.3.  What's up with that?  Well, Raspbian classifies packages in different repositories based on the state of the software.  That is, the most-stable versions are in the "stable" repository, and those that are in various states of testing are in others.  In our case, Direwolf 1.5 is actually in the "experimental" repository, so, to install it, you need to tell APT to use that repo.

sudo echo deb http://deb.debian.org/debian experimental main >> /etc/apt/sources.list 

We're adding the line "deb http:..." to the end of the file /etc/apt/sources.list.  All this does is tell the manager to add this repo to the list of software you want to use.  To actually install the experimental software, you do the same thing you did before but, this time, you have to tell it which repository to use.

sudo apt -t experimental install direwolf

Assuming you have everything in order, you're now running Direwolf 1.5.

By the way, don't let the name "experimental" scare you.  It's just a process status and doesn't necessarily reflect the quality of the software.  Dirwolf 1.5 is a stable piece of software that I've been running on my Pi Winlink gateway for several months now; it just needs some more testing before the Raspbian group moves it into the main repository.

Let's wrap this up.  Package managers are great tools that keep all your software and their dependencies up-to-date.  If you can use them, use them.  Your life (and mine) will be much better for it.

I'm sure that, in a couple decades, some ham will write this same article about my using package managers instead of $futuretechnology.  LOL

Comments

  1. Play Online Casino Games For Real Money | Amienshoppie
    If you are looking for the most attractive online casino games of the online gambling era then you'll love Amienshoppie's Game Maker. The 온라인 카지노 후기 platform

    ReplyDelete
  2. Lucky 15 Casino - Mapyro
    The Lucky 15 고양 출장마사지 Casino is a small, 3.5-star hotel, within walking distance 충주 출장마사지 of the train 안양 출장안마 station and The Mill Casino. 영주 출장샵 777 포항 출장마사지 Casino Drive West, Queens NY.

    ReplyDelete

Post a Comment