brhfl.com

Your Brand New Linux Install (A letter to my future self)

Dear Future Self,

If you’re reading this, hopefully it’s because you’re about to embark, once again, on the journey known as ‘installing Linux anew’. You’re predictable, you’re not particularly adventurous, so you’re almost certainly opting for Ubuntu out of some delusion that its consumer-friendly nature will make the install quick and seamless. But you only want the machine for writing/coding on, so you’re going to ruin your chances of a simple install by opting for Minimal. You’ve done it several times before, so it couldn’t be that bad, right? No, it won’t be, but I can tell you… I wish I had a me to guide me through it last time or the time before.

The actual install is simple enough. You may want to research the bundles of packages offered up during install time, I still haven’t figured those out. Also, it’s probably worth reviewing the encryption options, and the current state of the various filesystem choices, though you’re just going to choose whatever unstable thing has the most toys to play with anyway. Just let it do its thing, prepare a martini, relax.

So that’s out of the way, it’s time to boot… to a blank screen. Ubuntu does this… thing… where it messes with the contents of the video memory, juggles things around until finally allowing the kernel to do its thing and return operations to normal. Presumably, this works well when booting straight into X11, and supposedly it makes for a more seamless boot. However, future self, you’re stubbornly going to avoid X11 for as long as possible, which means this blank screen is a pretty large seam.

The boot parameter we need to get rid of is $vt_handoff. You can temporarily edit your boot settings by pressing e on the bootloader (GRUB)’s selection, and deleting that word. This will get old quick, and Googling will result in a whole host of bad ideas, namely those which involve writing directly to GRUB’s generated configuration files, or setting nomodeset. Don’t do either of those things. Fortunately, this kubuntuforums post offers what seems like a clean, stable answer. vi /etc/default/grub, add the line GRUB_GFXPAYLOAD_LINUX=text, :wq, and then run sudo update-grub. You should get a login screen now. You might briefly see some warnings about btrfs (you chose the unstable but fun filesystem, remember?) but supposedly they’re nothing to worry about.

Alright, you’re in! Your screen is probably very, very bright, see whether or not those controls work. If they don’t, you’re going to need to edit /etc/default/grub again, some ACPI related line or lines specific to your machine. Of course, while you’re making temporary boot parameter edits from GRUB, you’ve probably run into an esetterm error by now. setterm is the first word in the boot configuration, and you got impatient and mashed e too many times. Don’t do that. Also note that any time the boot process is being screwy, you can remove the quiet splash parameters for a verbose boot.

You’ve probably gotten a few errors trying to invoke vim on a system that only has vi, and may have come across a few other missing packages as well. The internet would be handy right about now. Run ifconfig to figure out what your ethernet device is called, and then sudo vi /etc/network/interfaces. If you’ve opted to ignore me, you’ve probably followed some Googled advice that tells you to set auto eth0 (or whatever your ethernet device is), and now you’re stuck with a 5-minute boot time whenever you’re not plugged in. What you want is allow-hotplug, something like…

allow-hotplug eth0
iface eth0 inet dhcp

reboot, or sudo /etc/init.d networking stop && sudo /etc/init.d/networking start, and hopefully when the dust settles, you can ping brhfl.com. Go ahead and have a field day sudo apt installing vim, zsh, elinks, and while you’re at it you may as well get wicd-console and wicd-curses, and ignore your impulses to manually configure wifi via wpa_supplicant.

YOU KEEP TYPING THINGS IN ALL CAPS because you can’t remember how to remap caps lock to ctrl. Google tells you a lot about xmodmap, but you’re still resisting X11. Frankly, you may as well get that out of the way because you are going to install X11 as well, but you’ll also want to refamiliarize yourself with dumpkeys, showkey, and ultimately loadkeys. You’ll verify which keymaps you’re using via dumpkeys, verify the keycode for caps lock with showkey, and ultimately make a mapping file something like…

keymaps 0-127
keycode 58 = Control

…which you will then load via loadkeys in your profile. Since nothing is ever really that simple, this will fail because loadkeys needs root permission. You have to edit /etc/sudoers (or, more elegantly, /etc/sudoers.d/loadkeys) to add a directive like brhfl x220 = (root) NOPASSWD: /bin/loadkeys. You’re smart enough to know that you really should be using visudo to edit these files, but you don’t feel like Googling how to fix Ubuntu’s default editor choice of nano. sudo update-alternatives --config editor. There.

One last thing, this machine is not really for web browsing, but you need to be able to see what you’re working on. Maybe by the time you read this, Chromium’s Ozone framebuffer implementation will be readily available, or maybe you’ll be smart enough to get netsurf working in the framebuffer (hint: you definitely need to add yourself to the groups that the mouse and framebuffer devices belong to). Maybe Wayland will be a viable option. Things are already looking up since the last time I did this, but we’re not there yet. I doubt we will be by the time you read this, so you’re probably just going to have to bite the bullet and install X11. I’ll probably have written up a few thoughts on minimalist windowing setups by then, but there’s a good chance you’ll settle on i3 or bspwm for a window manager, with a buggy Chrome install and a stable uzbl install, as well as vim-athena for some reason.

Hope this helps —
— the ghost of /home/bhefele past