Adventures in DevOps: Installing Linux 101

paulgdan
Philosophie is Thinking

--

As web developers we are spoiled with platforms such as Heroku that make deploying our applications relatively easy. Once in a while you might be tasked with maintaining a system that is hosted on a VPS or even an actual physical server and need to get your hands dirty.

In this series of posts I aim to make life easier by giving you a helping hand but let’s start with the real basics and go from there.

I have been asked on occasion what is the best way to really learn Linux and what distribution should I use?

For servers you might look to the well known Ubuntu, Red Hat or CentOS(Red Hat clone). All of these are relatively easy to install, and a lot of VPS’s have a simple one click install and you are ready to go within a couple of minutes.

What if you want to earn some serious Linux nerd chops?

I recommend my favorite distribution, Slackware. It has been around since 1993 and is basically maintained by one man, Patrick Volkerding, along with a few volunteers. The last stable release was 2013, but the packages are kept up to date and can be updated once you have your system installed.

Why do I like it? Its simplicity and flexibility. I’ve used it on everything from embedded systems to commercial video severs. It is great for really learning how Linux works. Not to mention how about having a release with a version number of 13.37?

What is the difference between all the different Linux distributions anyhow? Not a whole lot really. The main differences are the package managers and how the startup scripts are handled. They all use the Linux kernel, the heart of the operating system.

I feel Slackware’s startup scripts are much easier to understand than those on other distributions. Additionally they try to use generic packages whereas other distribution’s packages are often patched or modified.

So let’s start earning those DevOps badges like a boss and install Slackware in the easiest way possible by using a virtual machine.

  1. Download and install Virtualbox.
  2. Download the Slackware DVD iso image from here.
  3. Start VirtualBox.
  4. Create new virtual machine by clicking “New” in the upper left (don’t worry about the version it doesn’t really matter in this case):

5. Click “Continue” until you reach this screen:

Here increase the disk size to at least 10 GB if you want a full installation. Then you can safely continue through the rest of the prompts and accept the defaults until the dialog closes.

6. Click the green “Start” arrow.

7. Browse to where you downloaded the Slackware iso image by clicking the folder icon then click “Start”.

8. Next you’ll come to the screen below, just hit enter, and you’ll see the kernel messages fly by:

9. You’ll come to a prompt to select a keyboard map just hit enter.

10. Next you’ll be presented with a login: type “root” and then hit enter.

11. Now in order to install you need to partition your virtual disk the easiest method is by typing “cfdisk”.

12. For the sake of simplicity let’s just use the whole disk. Hit enter while new is selected. (Don’t worry this isn't destructive to your physical machine).

13. Next highlight “Write” and hit enter then type out “yes” to write the partition table so we are able to format the virtual drive.

14. Now highlight “Quit” and you will be returned to the command line.

15. Now we are ready to start the installer. Type “setup”.

16. Use the arrow keys and navigate to to “TARGET” and hit enter.

17. Now you will see the partition we create in the earlier steps. Select “/dev/sda1" and hit enter.

18. Now we are going to format our disk. Make sure “Format” is selected and hit enter.

19. “ext4" is selected by default which is the standard Linux file system these days. Hit enter to format, it should only take a few seconds.

20. You now have formatted the disk. “/etc” is where Linux stores its configuration files. This file tells the system to mount the partition on root(“/”) when it boots.

21. There’s a number ways to do our install. Highlight the first and hit enter.

22. Let’s use the default again here. Hit enter.

23. Now the fun begins! Here is where we can select our package groups. Be safe here and just leave everything as default and hit enter.

24. I’d recommend a “full” install. If you really want to be a champ use “newbie”, but as it says it will take forever.

You will see every package that is installed, although they will fly by rather quickly.

25. Highlight “Skip” on this screen and hit enter.

26. Here you’ll want to select “simple”.

This will write a boot loader to a special section of the disk that the BIOS looks for when the machine is powered on. The boot loader’s job is to load the kernel and pass any special parameters along to the kernel.

27. Here just go with “standard”, unless you want to be brave.

28. We don’t need anything here.

29. Unless you are using a language other than English use “No”

30. Use “MBR” here to write to the Master Boot Record on the virtual disk. Again don’t worry this is non-destructive.

31. Again go with the default here.

32. Use “No” here. This might help if you are using an actual dedicated machine.

33. “Yes” here so we can have a network.

34. Enter whatever you want here.

35. Enter whatever you like here. It doesn’t have to be a real domain, I’d just put “test” or “home”.

36. Unless you know what you are doing use “DHCP” here. If you want the DHCP to get an address from your local network makes sure to change the virtual machine’s network settings to use “Bridged” mode.

37. It’s safe to just hit enter here.

38. Here’s our final network settings.

39. These are the startup services that we can run by default. We can always start these later.

40. Unless you want some strange fonts by default just say “No” here.

41. Set this to your liking. If you were dual-booting with a Windows machine you’d want to select “NO”. Since this is a VM there’s no issue.

42. Here you can set your local timezone.

43. If you want a window manager select one of these. KDE has the most features and also consumes the most resources. The other’s in the list are pretty bare-bones.

44. Set your root password here.

45. Yay! we are about done! Only 45 steps so far!

46. Select exit and then type “reboot” and hit enter.

47. You’ll be greeted by your boot loader, hit enter to bypass the timeout.

48. Type “root” for your “login:” and then the password you chose earlier.

49. If you want to see your window manger type “startx”

50. If you used KDE you’d see this:

Pro-tip: Hit Control-Alt-Delete to kill a unresponsive Xserver (works on most versions of Linux)

That’s it! In my next post I’ll show you how to add users and groups in a distro agnostic manner that’s applicable to any version of Linux.

--

--

Philosophie is Thinking
Philosophie is Thinking

Published in Philosophie is Thinking

Thoughts from the ridiculously talented inventors and makers at Philosophie, a digital product consultancy in Los Angeles and New York. Learn more at: http://philosophie.is