Weekend with Arch Linux 3: Packaged Delivery

Jason Charney
16 min readJun 24, 2019

--

Update (7/30/19): Thanks to Landers1979 on the Arch Linux ARM forum for noticing that there were a few incorrect packages listed.

Yesterday, I picked up where I left off a couple of months ago with installing Arch Linux ARM for a Raspberry Pi 3B Rev 1.2, but finished after we installed sudo. Today, I want to get a bunch of other stuff installed.

Keep in mind, in this post not everything will be configured. Our focus today is installation. These are two different things. Future articles will focus on configuration components (namely vim, tmux, zsh, powerline, i3/i3-gaps/i3blocks, and whatever else I can’t think of right now.)

Would You Like Some Rice on the Side?

Initially, I wanted today’s article to be subtitled “How to Be an /r/unixporn Star” because I want to rice the heck out of Arch Linux.

The “rice” in “ricing” originally started out as a pejorative term in the automotive racing community as an acronym R.I.C.E. or Race Inspired Cosmetic Enhancement. What was initially supposed to be an insult against car racers who modified their vehicles for visual aesthetic purposes eventually became a popular trend not just with car enthusiasts but with computer art enthusiasts as well. In particular one subculture in particular seems to exude this interest in ricing desktops. Demoscene.

Demoscene is all about making small demonstrations of computer code (where have I seen that before?) that come out aesthetically or technologically enriching. While there is an electronic music genre by the same name that namely focus on making music with arcade like sounds, akin to say chiptunes but with an aesthetic, anything I speak of in terms of demoscene in this blog will be more along the lines of the art or technology or code.

One of Arch Linux’s biggest features is the ability to customize the console as well as Graphical User Interfaces (GUIs) known as Desktop Environments. Most of the popular Linux distributions (or “distros”) just focus on one particular GUI, and often it is the one that is designed for users who are most use to using Microsoft Windows or Apple OSX. If you are a Raspbian user, you know this mean PIXEL, which is a striped down version of LXDE which depends on GTK which doesn’t have scalable features, so if you’ve used PIXEL or LXDE or even GNOME (older Raspberry Pi and Linux users know why) and used this interface on a small screen (7" official screen or the 3.5" hats) you know that the icons take a big chunk of real estate and the control panels don’t exactly have any scroll bars on them to reach that “OK” button at the bottom.

It’s this reason I want to go with i3 (with i3-gaps and i3blocks) because the GUI should not be the focus.

And yet, later we are going to need to install GTK to use Chromium in that rare case we want to connect to the Internet at your local coffee shop because the gateway will still require you to get permission using a browser that supports JavaScript. (Kind of a major buzzkill, unless somebody can make a browser thinner, lighter, and with less of a CPU & Memory footprint.)

For now, let’s assume you are doing stuff at home or on a network were you don’t need to go through a firewall first and start with installing the packages we need.

A Quick Note: Update First!

Installing Linux is a humbling yet helpful experience. For one thing, you get to learn a lot about computers and about how much free and open-source software is out there. Another thing, you get to learn how to troubleshoot, problem-solve, and tinker with existing software have and try new things.

If at any time something in this list does not install or update, it may be because the software repositories (or “repos” for short) need to be updated.

In pacman, the command to do that and to install the upgrades, is

pacman -Syu

Remember, you can always look at the pacman Rosetta page if you need guidance. Personally, I’d probably write my own script converting apt command into pacman commands, but I think I’ll do that later.

Any scripts that I do write will likely be in my Plushes Github repo later. I have some older stuff in my hacktop Github repo, but I think I might move that to Plushes in the future.

The Essentials

Enough talk. At this point, I assume you followed the instructions from the previous articles I linked at the top of this article and are at the point where we can start doing stuff with pacman.

Not every package will be listed, and any dependencies these packages rely on you should accept to install. You don’t need to install each package one at a time, in fact, I encourage you to install as many as you want.

Every list here will be prepended with the pacman -S command. So for these next sections, when I suggest installing clang, python, and perl for example, your command prompt (for which you should be logged in as root for this part or sudo pacman -S and can do the configuration as pi later) you can ether do

# pacman -S clang python perl

or sudo as

$ sudo pacman -S clang python perl

With that said, let’s get started.

Essential Tools and Languages

These packages are to make sure that we can do all sorts of stuff with the various languages. Note that I do not have any commands set up for Haskell or R yet.

binutils git clang complier-rt llvm python python-setuptools python-pip ruby lua perl tcl tk ctags glibc make automake autoconf cmake jsoncpp libuv m4 rhash shared-mime-info bison flex

A couple of tools you should probably install

htop tig scrot screenfetch bc bash-completion jq oniguruma pv bind-tools

Note: bind-tools adds some DNS tools like dig and nslookup. You can learn more about them here, here, and here. Some ISPs don’t support thrid-party DNS. You can run something like nslookup -type=txt debug.opendns.com. 208.67.222.222 to check, but you’re probably better off leaving DNSSEC off for the moment.

Sound

Note: This section was added 7/31/19. So if my story seems a little ahead of itself, its because the events took place sometime after the install of most of the software in this article.

An overlooked but important part of system set up is sound. We take it for granted, but it is an important feature.

Later on in this blog, I hope to explain how to get Software Defined Radio (SDR) features working with GQRX, but while trying to get ALSA working, i3 (which we will install later in this article) crashed out of X11 and back into the console. The reason it happened was because a program called aplay threw an error in urxvt because there was no way to output sound.

Another software you may see is PulseAudio which acts as middleware between ALSA and any program that uses audio.

You may see some stuff about Open Sound Software (OSS), but OSS has been deprecated in favor of ALSA. We won’t go into anything involving OSS unless we need to.

If you are using a Raspberry Pi 3, you will also need to make some modifications to /boot/config.txt.

For instance, there is no sound device set up by default, so with a text editor, open /boot/config.txt and add a line withdtparam=audio=on. This enables the use of sound device. If you are sending sound out through HDMI, you may want to add hdmi_drive=2 to force audio over HDMI. If you still chose to use the 3.5mm audio jack and are having distortion problems, adding audio_pwm_mode=2 might help.

You should also install the following software.

libpulse sox alsa-lib alsa-utils

You may want to install other software and some other software may be installed with these packages, but I’ll expand upon that another time in another article about SDR.

Go

Go (golang, actually) actually doesn’t have a port for ARMv7h. It has one for ARMv6l which might have been OK if we were installing Go on a Raspberry Pi 2. It turns out that Google created another version of Go intended for Android 9 Pie Go Edition, but for some reason has appeared in the ALARM repository. This version is called go-pie. It’s intended for cheaper smartphones and supposedly is smaller than regular Go…which is ironic consider go-pie for ALARM will still be about 491 MB when installed.

go-pie

Node

Node is used for a lot of stuff, but I’ve mostly been using it to check my JavaScript code as of late rather than going all out and running a server. I mean, I could, but let’s just get the basic part installed.

nodejs npm node-gyp c-ares semver

Haskell

Whoops! Looks like this section isn’t quite ready! Apparently ALARM’s nss package got an update today, but none of the Haskell packages did. I put in a request. For now, just skip this section.

Haskell is a functional programming language that I am new with, but which has interested me since I started tinkering with functional programming in JavaScript. While on a regular Arch Linux build, the haddock package would be installed with the Glasgow Haskell Compiler (ghc), it doesn’t appear to be available. However, the Haskell Tool Stack (stack) is and has plenty of dependency packages with it.

Another problem is that ghc depends on ghc-libs which depends on an older version of llvm called llvm50. llvm is currently around version 8.0 where llvm50 would imply is llvm version 5.0.

For simplicity, I’m just going to install the following packages to get the rest of them.

ghc cabal-install happy alex stack

Avahi/Bonjour/Zeroconf

We should also probably install avahi so we can use Bonjour/zeroconf to pull up our device with SSH elsewhere on the local network using pi@sombra or pi@sombra.local. This requires one other dependency, at least from how I installed it initially. Again, we’ll work on the configuring part later.

avahi libdaemon

XWindows

XWindows is the GUI that Unix used, but a lot of its components are still used today especially in Linux. This will likely be one of the first items will will configure along with i3. There are several files that start with xorg-fonts-* that MUST be installed for XWindows to work.

You may noticed that if you install xorg-mkfontscale you will get a message saying that xorg-mkfontdir will be removed because xorg-mkfontscale conflicts with xorg-mkfontdir. This is fine. It just means we’re replacing the default font directory with one that supports scalable fonts. There might be some fonts that are still missing, but we’ll worry about those later.

The package xf86-video-fbdev should provide us with a frame buffer device (fbdev) which is a must have.

xorg-server xorg-server-xvfb xf86-video-fbdev xorg-xinit xorg-xrdb libxmu libxt xorg-xauth xorg-xmodmap xorg-apps xorg-font-util xorg-fonts-100dpi xorg-fonts-75dpi xorg-fonts-alias xorg-fonts-misc xorg-fonts-type1 xorg-fonts-cyrillic libxcursor xorg-bdftopcf xorg-fonts-encodings xorg-luit xorg-mkfontscale xorg-x11perf xorg-xcursorgen xorg-xkill xorg-xpr xorg-xwd xorg-xwud xorg-xbacklight xcb-util libxcb xcb-util-wm xcb-util-cursor xcb-util-image xcb-util-keysyms xcb-util-renderutil xcb-util-xrm xorgproto

i3/i3-gaps/i3blocks and rxvt-unicode

As I have previously stated, I want to use i3 as my desktop with gaps and blocks. This is where we need to use nano to create a file in the home directory called ~/.xinitrc. This file will tell XWindows that when startx is executed i3. However, before we do that, we also need to tell XWindows to run any scripts that may be in the /etc/X11/xinit/xinitrc.d directory.

Another program that will be installed is called dmenu. When we run this using a modifier key (the Windows key by default but for my hacktop is the Alt key, but we will call $mod throughout this blog) plus the D button (so $mod+D), a menu will appear at the top of the screen to select a program to run. This will be important to know when shutting down the computer in i3. Of course to exit i3 cleanly (which will close XWindows) you can use $mod+Shift+E to exit. A prompt will ask if you want to leave.

Another component is the rxvt-unicode terminal or as sometimes called urxvt. There is a ton of stuff that needs to be configured with this later but the reason a lot of people use it is its support for Unicode characters and 256 color support. (Clearly it supports more colors than that, as ranger users might know. By the way, we’ll install ranger because it should work in rxvt-unicode.) This will be our default terminal instead of xterm.

First, pacman stuff. Install these.

i3-gaps i3blocks i3lock i3status perl-anyevent-i3 perl-json-xs dmenu rxvt-unicode gpm ranger highlight

Next nano ~/.xinitrc. (Note if you do this as root, you will need to do it again as pi, but be sure to chown pi:pi /home/pi/.xinitrc after you cp /root/.xinitrc /home/pi/.xinitrc to change the ownership after making a copy of the file.) The file should look like this. (Note: You should not change ~/.xinitrc’s permissions for it to work. Something else will take care of that.)

#!/bin/bash
# File: ~/.initrc
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/*; do
[ -x "$f" ] && . "$f"
done
fi
exec i3

With that done, the basic XWindows and i3 setup is ready. Just run startx later.

Vim

Vim has a ton of packages we can install. In Raspbian, in order for vim to recognize the other languages available, we had to install a special version of vim called vim-nox. As much as I like having Vundle do all my Vim plugin package management, its so much better when an Linux distro can do it for me. A task that any Debian-Based and RedHat-based distro simply does not do, but Arch Linux does.

Hopefully I’m not wrong on this as later we’ll be installing tmux, zsh, and Powerline.

We’ll config our ~/.vimrc file later. For now, have pacman get these packages.

vim vim-runtime vim-fugitive vim-ctrlp vim-gitgutter vim-molokai vim-nerdtree vim-surround vim-syntastic

Tmux

Suppose you are in SSH and your connection is broken between the host computer and your computer. The host computer is still up, so you reconnect to it. However, there is just one problem: You can’t reconnect to all the processes you had before. tmux is a program that fixes this issue as when you start up, you run tmux which creates an environment where if you do lose your connection, you can reconnect simply by reattaching the session you had open.

In addition, tmux offers things like a tabbed environment and window splitting. To get this, use pacman to install it and the following dependencies.

tmux ncurses libevent libutempter

Zsh

Z-Shell or zsh has enhancements that bash does not have. I would not recommend setting up zsh for root, but for pi you should. Because this could get messy, I will need to write another article with references to how to set up zsh.

Meanwhile, pacman this.

zsh zsh-autosuggestions zsh-completions zsh-hsitory-substring-search zsh-lovers zsh-syntax-highlighting zshdb

Powerline

Powerline is a popular Vim plugin that has become a popular Tmux, Zsh, and i3 plugin. More so with the Zsh Powerlevel 9K theme (which we will install in this step rather than in the previous section.) If you are interested in other Zsh themes, see what’s happening at Oh My Zsh. Personally, I won’t be doing anything here involving that as I am content with Powerlevel 9K.

Powerline does have its own patched fonts package, but that still won’t stop me from at least trying to see if I can get Nerd Fonts installed later on down the road.

So here’s what you need to tell pacman to go get.

powerline powerline-common powerline-fonts powerline-vim zsh-theme-powerlevel9k python-powerline

Note: Because some people didn’t get the memo to stop using Python 2, you are going to need to add let g:powerline_pycmd = 'py3' to your ~/.vimrc file or (/etc/vimrc file if you want it to be system-wide), otherwise when you open vim, you’ll get some error message saying “An error occured wheile importing powerline module. This could be caused by invalid sys.path setting…” More than likely this happens when some software installs Python 2 (when you already have Python 3 and (almost) everyone as of 2019 has finally stopped using Python 2).

Fonts

Because we will need to install chromium, we will need to install all the fonts. Rather than having to be forced to choose one in the next section.

noto-fonts ttf-bitstream-vera ttf-caladea ttf-carlito ttf-croscore ttf-dejavu ttf-droid ttf-font-awesome ttf-freefont ttf-liberation ttf-ubuntu-font-family

Optional noto-font packages include the following, but I’m not going to install them just yet.

noto-fonts-cjk noto-fonts-emoji noto-fonts-extra

Chromium

I wish I didn’t need to install this, but we have to. chromium is needed so that we can access networks that don’t require a password but are firewalled.

Before we do that, it needs the libbluray library, more than likely for some video codecs, this also has dependencies

libbluray fontconfig freetype2 libxml2

Finally we run this command.

chromium

That single command will make a call to install a ton of stuff, like over half a gigabyte worth and it had to ask where to get fonts from a couple of repositories. There are so many of them, I don’t feel like writing them all down. Just accept them.

WeeChat or IRSSI (IRC Client)

In this world where Discord and Slack are the most widely used chat apps, Internet Relay Chat (IRC) is still the way to communicate to other Linux geeks in real time.

Most of the Linux community still won’t migrate to Discord or Slack because they are closed source (that is their source code is only available to the developers who work on them). The Linux community is dedicated to open source (where the source code is freely available to everyone).

While you could use a forum like StackOverflow or the Arch Linux Forums, if you want to talk to someone online, then IRC is the way to go.

The two major IRC apps are IRSSI and WeeChat. I recommend WeeChat because it has the better interface and there is a quick start guide to help you set it up and get started.

You can get IRSSI using the following command.

$ sudo pacman -S irssi

Or you can get WeeChat using the following command.

$ sudo pacman -S weechat

Directories

At this point we should set up our directories using mkdir.

Here a good time to create those directories that a lot of Linux distros create in the home directory these days. You’ll want to be pi for this. Let’s use a for-in loop and make a group of directories all a the same time. I’ve also added a couple of directories like bin (which if you put a script in there it will run for the specific user, in this case pi), Sandbox (a place to try out stuff), and Projects to store the Git repositories that you are working in. I’ve also create a Software directory inside Downloads with a softlink on in the home directory. This directory should be where you download software from other sites from source. There’s a method of how I do this which will be seen later.

$ for d in bin Documents Downloads Desktop Music Pictures Projects Public Templates Videos; do mkdir $d; done
$ mkdir -p ~/Downloads/Software
$ ln -s ~/Downloads/Software

Toys

All work and no play make Jack a dull boy…whoa, where did that come from.

But seriously, a lot of the screenshots you see on /r/unixporn include some visual apps. I guess you could call them toys, but even a toy can be used as a tool. Here’s some stuff you’ll definitely want to play with.

cmatrix cowsay ponysay fortune-mod figlet doge lolcat nyancat asciiquarium

One of the items above, lolcat, is a worthy excuse to install ruby, which is what we installed at the beginning of this article. lolcat looks way better in 256 colors or more.

There are a couple of toys that need to be installed as scripts. One is pipes.sh created by Pipeseroni because “the internet is a series of tubes.” Pipseroni has a few other scripts, but for now, let’s stick with what we want to install. If you want you can also install pipesX.sh and weave.sh. (Note: You can’t make install the weave.sh program.)

$ mkdir -p ~/Software/github.com/pipeseroni
$ cd ~/Software/github.com/pipeseroni
$ git clone https://github.com/pipeseroni/pipes.sh
$ cd pipes.sh
$ sudo make install

With go installed (via go-pie) we could try to install terminal-parrot because PARTY PARROT DON’T STOP!

Ain’t no party like a party parrot party because a party parrot party don’t stop!

Aaaand…it doesn’t seem to want to work right now. If it had, the instructions would simply be as follows.

$ mkdir -p ~/Software/github.com/jmhobbs
$ cd ~/Software/github.com/jmhobbs
$ go get -u github.com/jmhobbs/terminal-parrot
$ terminal-parrot

Unfortunately, due to some issue with go-pie, there seems to be this one error that keeps showing up that prevents the install from happening.

loadinternal: cannot find runtime/cgo

Prepending the above go command with CGO_ENABLED=0 had no effect. But don’t despair, the party still goes on using this curl command!

$ curl parrot.live

A quick note, if you stop terminal-parrot or curl parrot.live and hit ^C (CTRL+C) to end the program, you may want to run tput sgr0 to reset the terminal colors in Bash. I haven’t tried this in Zsh yet, but I hope it has the same effect.

Then there is ddate, this Discordian Calendar, which was tragically removed from the util-linux package in 2011.

$ mkdir -p ~/Software/github.com/bo0ts
$ cd ~/Software/github.com/bo0ts
$ git clone https://github.com/bo0ts/ddate
$ cd ddate
$ mkdir build
$ cd build
$ cmake ..
$ make
$ sudo make install

Finally, boxes which should be just as much part of any Linux distro as lolcat or figlet. The world needs better MOTDs! And I’m gonna bring it to you!

$ mkdir -p ~/Software/github.com/ascii-boxes
$ cd ~/Software/github.com/ascii-boxes
$ git clone https://github.com/ascii-boxes/boxes
$ cd boxes
$ make

For some reason the guy who makes boxes, didn’t bother to add instructions to his Makefile, such that we could simply sudo make install to move all the files we built to where they belong. As such, we have to do the following commands. (Reminder: If you build anything it should be put in some sort of /usr/local directory by the Makefile, NOT in the /usr directories. To be clear, what we are doing is not normal!)

$ sudo cp doc/boxes.1 /usr/local/share/man/man1/boxes.1
$ sudo cp boxes-config /usr/local/share/boxes
$ sudo cp src/boxes /usr/local/bin

In the future, I’d like to get mopidy set up to do some Spotify, if not on Sombra (the hacktop we’ve been messing with) then D-Va (the Pi I’m using for Retro-Pie). It probably won’t be in Part 4, but definitely in the future.

We covered a lot of ground today. The next plan is to take up configuration in Part 4.

And now for some crass self-promotion!

I’d like to thank you for sticking around thus far. It has taken me all day to write this article and I would really like to write more of them for free. Unfortunately, capitalism is still a thing, and money doesn’t grow on trees.

Help support me and this blog by tossing in a few buck into my Ko-Fi cup.

It’s not much but it will allow me churn out more posts like this, especially since there aren’t a whole lot of Arch Linux ARM Install posts on the web. Who, knows, that money might actually go toward Medium to pay for whatever thing they are badgering me to buy from them.

--

--