Trying out Alpine Linux
Intro
So for the last few months I’ve been using NixOS as the main driver for my work laptop and while the declarative system configuration is really fascinating, I never had the time to get into the documentation and learn the nix language. This would cause problems when trying to install software that was not part of the official repositories, such as manually compiling an application or in some cases, using other package managers. As I didn’t see the time to learn nix properly coming up anytime soon I decided to switch it over to a new distribution. Void Linux has been driving my personal laptop for a year now, but I felt like trying something different. After seeing an update to Alpine Linux and being surprised to learn that it supported both GHC and Rust, I decided to give it a try. The thing is Alpine uses muslibc instead of glibc this means that many packages (proprietary ones mostly) are unavailable. Now I had tried Void Linux musl a year ago but it did not support haskell at the time (It does now), seeing it being supported by Alpine cemented my choice.
Alpine Linux itself is a linux distribution that uses it’s own package manager (apk) and is linked to both libressl and musl. This, along with a small number of core packages and the use of busybox instead of the gnu userland, makes a full base install of Alpine fit under 130MB. It also uses OpenRC as it’s init system instead of the Systemd behemoth. I tend to prefer the simpler, script based approach to init systems, as it makes it easier for me to understand exactly what’s going on with my system (This is a feature of Void Linux as well, though it uses Runit instead).
Install
The install process is pretty simple, once you’ve burned the iso on a disk or copied it to a usb, you boot into the live image and type down setup-alpine. The install script takes you through all the steps required to have a working base install, this is all done in the tui, there is no graphical installer. The nicest thing about it I believe is that it’s actually just a wrapper around a bunch of other install scripts. So if you have to do some partitioning before going through with the last step (Install to disk), you can simply exit the script, do what you gotta do and then boot the setup-disk script. It will detect your current setup and try to make it work automatically. While it doesnt always succeed in this, it works fairly well. I did run into an issue using nvme drives, I had to manually add the nvme drivers to mkfsinit.conf.
Other problems I ran into while installing where:
- Problems with setting up a raid0 array. Gave up on it after deciding to use my first drive for the os and my second drive for my home.
- The installer was not able to setup wifi on it’s own. I got around it quickly by just plugging in my ethernet cable and configuring wifi manually after the install.
setup-diskdoesnt seem able to automatically partition your drive if it’s gpt, you need to use mbr. Though it will be able to install the files to the disk if you partition them manually.
Conclusion
After using it for a couple of weeks, I’ve been pleasantly satisfied with it’s power, simplicity and it’s available packages. I’ve set up a qemu-kvm virtualized Windows guest, I’ve setup all my usual command line software (neovim, mutt, newsbeuter, tmux) and I tried a few test projects in haskell, which worked great. I’ve had to manually tell the package manager to install a few packages to get stack and cabal working correctly, but it wasn’t too hard. The only thing I don’t see myself doing much is playing games, as I cant use the proprietary nvidia drivers. Perhaps if I bought an external dedicated graphic card (Can that even be done?) I could passthrough the kvm windows guest directly to the second graphics card and get near-native speed on windows, but that would probably deserve it’s own post.