This is intended as a general guide to install whatever distro you'd like on pretty much any machine capable of running GNU/Linux. This is not a guide to get GNU/Linux running on your toaster or refrigerator, this is only for Laptops, Desktops, and in rare cases, tablets.
Before the Install:
Before we can even consider installing a GNU/Linux distro, we need to get an idea what sort of hardware we're working with. Usually this can be found on whatever box your computer came in, if you need extra information, there are ways that I'll highlight later on this post.
The Hardware We need to Identify:
We need to know exactly what model and manufacturer is being used for what purpose so we can make sure the right drivers are being used on our install.
- Parallel vs Serial ATA drives
- Wifi chipset (intel, broadcom, etc.)
- CPU (manufacturer, model, and architecture)
- GPU (manufacturer and model)
- Screen Resolution
- Solid State Drive vs Mechanical Hard Drive
- (U)EFI vs Legacy BIOS/CSM boot modes
Finding your Distro:
Now we need to determine what you want to install on your PC (or Mac, which is still a PC). The best place to start looking is Distro Watch, keep in mind that anything with "BSD" in the name is not a GNU/Linux distro, but a version of BSD which is very different, though some of the install steps should be similar.
There are a few things to consider in choosing your distro: release cycle, package manager, default Desktop Environment, install type, and init system.
This refers to how frequently and in what fashion the distro is released and/or updated. Most distros use a "Versioned" release (e.g. Ubuntu 15.04), where an updated version is released every set period of time. This sometimes requires new install media for updates to take place, though many seem to be able to upgrade from the package manager.
The other option is called a "rolling-release," this means that as soon as a package has been cleared to work on the distro you're using, you can upgrade to it. These distros have a bad reputation for being unstable, which is not necessarily true, you just need to be a bit more careful when you update as having the newest, shiniest knives makes it easy to accidentally cut yourself.
This is how you install new software on a GNU/Linux system. The package manager keeps track of what packages and what package versions there are available. Most also offer dependency resolution so you don't have to hunt down all the binary files and system libraries required for your desired program to run. They tend to behave a bit differently from each other, but not by enough to really warrant a write-up in this document.
This is the part most people will obsess over. It's what defines how you interact with your system and installed programs, the four most popular ones are: KDE, GNOME, XFCE, and LXDE. There are quite a few more, but these are the most common. This can always be changed after install, but some distros come with a preinstalled, pre-configured DE.
KDE is generally considered one of the most configurable DEs, though it's a bit of a resource hog for all the possible effects and graphical tweaks. It's best to run this if you have 2GB of RAM or more to cache all the images and effects.
GNOME was started as a fully Free alternative to KDE, it feels a bit more constrictive in terms of customization, and the most recent versions require you to use an init system called SystemD, but it's possible to work around that if you don't want to use it.
XFCE is one of the smallest DEs available, every component can be used separately from the others without any issue. There are plenty of interesting customizations available out of the box, and it looks pretty good (in my opinion) without any configuration.
LXDE is even lighter on resources than XFCE, if only by around 20MB. The window manager, called OpenBox, is highly configurable though. LXDE is not one of the most visually appealing DEs until you do some customization.
This is how your system starts everything and anything. It handles the starting of your distro and any services you rely on during use. Systemd is a very controversial init system at the moment. Some distros allow you to still pick an alternative such as SysVInit and OpenRC.
Alright, now that we've decided what distro and what flavour (if applicable) we want to install, we need to get a few things ready to ensure everything works properly.
Getting the Install Media:
Very first thing we need to do is find and download the install media. This is going to be in the form of a .iso file, which traditionally is a disc image to be burned to a CD or DVD, but it's not recommended anymore simply due to throughput limitations on those storage devices.
For example, if we had decided we like Zorin, we'd want to go to Zorin's website. If you're wanting to use another distro, you'd simply visit their site and navigate to the download page. Now, here's where the CPU architecture is important, most people will be using either x86 (also called i386), which is a 32-bit architecture or a 64-bit architecture called either AMD64, x86_64, or x64. Despite the name AMD64, if you have an intel CPU that's 64-bit, this is the architecture you want. If you're using a raspberry pi or similar tiny PC, you'll need to grab the ARM version of the install media, keep in mind that this architecture is not supported by everyone. There are also some older or less frequently used architectures such as RISC, PPC32, PPC64, SPARC, Alpha, and IA-64, odds are you'll know ahead of time if you're using one of these architectures, if that's the case, just be aware that support is focused primarily on AMD64 and x86 platforms as of current.
Now that we've found the file to download, we'll want to make sure we know where the file has been saved to. Once we have the download file, if an MD5 sum file was offered, we'll want to grab that too or make note of the MD5 sum so we can verify the download isn't corrupted, this can usually be skipped, but if you've got a spotty internet connection, I'd recommend ensuring you've checked it.
For Windows users, Microsoft has a utility available for download here to check the MD5 sum.
Burning the Install Files:
Now that we have our install files downloaded, we need to ensure we can boot into the live environment. The recommended method and utilities for this task are either the Universal USB Installer or Rufus to burn the disc image to a flash drive. Burning to a CD or DVD is possible in many cases, but the experience is usually better with a USB drive. Once the image burning utility has been downloaded, we simply need to point it to the downloaded .iso and the intended storage media to have it burned to. With Rufus, you can even tell it to format the install media to be bootable through either Legacy BIOS or (U)EFI. Most new machines are using (U)EFI, so you may need to toy with it a bit, but in general, if you don't get a black screen with white text that comes on screen for a few seconds before you get the boot splash, it's using (U)EFI.
Making Space for GNU/Linux:
Now that we have our install media ready to go, we just need to make sure there's space for the new OS to live in. It's up to you if you'd like to use the entire hard drive or solid state drive, if that's the method you want to use, feel free to skip this step.
In Windows, you'd need to shrink your Windows partition by between 25GiB and 200+GiB, depending on how much space you have available and how much space you want to have allocated to your new GNU/Linux OS. The process is pretty simple, you'll need to open the control panel, find the disk manager, and simply create a new partition of empty space with however much storage space you think you'll want or need. Once that's done, we can move on to the next step.
On OSX, the process is a bit different, my only experience in the matter has been with using the internet recovery tool, but that's simply not practical for a system in which you want to dual-boot. With that said, OSX Daily has a well-written article on the process to help ensure your data remains safe.
Booting From the Install Media:
Now that we've set aside the space needed for your new OS and set up our installation media, we need to actually boot into the BIOS/(U)EFI and tell the system that the OS we want to boot is located on external media.
For users on a Mac, this process couldn't possibly be simpler, I'd recommend muting the PC before rebooting unless you don't mind the chime, but once it's off, hold down the Option key and power it back on. After a few seconds, it should give you a list of devices to boot from, you'll just select the USB drive using either your mouse or the arrow keys on your keyboard.
For people with Windows computers, the process varies wildly, usually mashing the F8-F12 or ESC keys will get you to a boot menu, once you're in your BIOS/EFI settings, you'll have to change the boot order to prioritize the install media at the very least. With (U)EFI systems, you'll want to disable Secureboot (really not protecting you from much, but if you'd like to keep it, many distros have X.509 certs that allow you to keep Secureboot enabled, if your distro doesn't come with one, you can craft one yourself too. Fedora has some documentation describing the utility of such a certificate) and Fastboot. Once that's done, you can boot from your install media and get the installation started!
For those with a discrete nVidia GPU in their sytems, it's almost certainly required to add an option to your boot arguments. This is because nVidia does not have any Open-Source drivers for their graphics cards, and a very dedicated team of talented people work very hard at reverse-engineering the proprietary drivers nVidia uses. However, this leads to a problem that can keep your install media from booting properly or keep your graphical environment from loading. To fix this, when you reach the GRUB menu (which gives you a list of boot options), hit the 'e' key to edit the boot options. To fix this problem, we need to find the line that starts with "linux" and add the word "nomodeset" to the list of arguments, separated by spaces. Then you save and exit by pressing a key combination like Alt-X, Alt-C or F10. From that point, you should be able to boot properly.
EDIT: There are some systems that make it almost impossible to get to the (U)EFI settings from a cold boot on Windows platforms so a workaround is available on the Acer Support site.
credit to /u/paulmccarkey for bringing this to my attention.
Now that we've been able to boot into our live environment to set up the installation, or even just test-drive a distro, we'll need to cover the actual steps taken in installing the system.
Partitioning is the act of separating space on either a single hard drive or multiple hard drive for the sake of organization, similar to using multiple suitcases for travel so you don't have your clothes mixed in with your friends, sisters, and parents clothing.
There's actually a few different tools available for this task, and depending on the distro you've chosen to use, the tools available will vary somewhat.
For (U)EFI booting, you'll need to use GPT partitioning, for Legacy BIOS booting, you'll need to use MBR partitioning. With a graphical installer, this isn't as important to pay attention to, but if you're partitioning manually you've got to keep an eye on the partition table type
GParted: This is the single most popular partitioning tool, and it's actually available for use as a standalone in the System Rescue CD and GParted live discs. This has a great graphical interface to give you an idea of what disc space is being allocated to what, and allows for labelling and even formatting from within the same utility. This is pretty much always run in a graphical installation program. This utility supports both MBR and GPT partitioning.
Parted: This is the same utility as GParted, just without the graphical interface. It's invoked with parted /dev/sdx where /dev/sdx is the storage device you're partitioning, and once it's running your prompt changes to (parted). If you need to know how to do anything, running help will give you a run-down on everything you'll need to know to set up your partition table. This utility supports both GPT and MBR partitioning.
cgdisk: This is a command-line partitioning tool for GPT partition tables, it uses a very intuitave curses based interface. you invoke it using cgdisk /dev/sdx
cfdisk: This is just like cgdisk, just with MBR partitions instead of GPT partitioning.
Now that we've set up our partitions, we need to format them with a filesystem as well. Keeping with the analogy from earlier, this is basically how you've set up your suitcase to carry items, wether or not there's a method in place to track changes in the location of your socks and such as they move around in your suitcase.
Graphical installers will typically give you a few filesystems to choose from, but we'll cover the basics here anyway to make sure you can pick the best filesystem for your uses.
vfat/FAT-32: This is a universally useable filesystem that was introduced with MS DOS 7.1 or Windows 95. It allows for longer filenames than previous versions of FAT, and larger file sizes. If you're using (U)EFI, you'll need to have your boot partition formatted with this filesystem so the boot files are accessible. This filesystem is only recommended for universal compatibility between operating systems.
ext3: This is the third version of the extended file system, it allows for journaling which means it keeps track of changes not yet written to the filesystem. In cases of power outages or system crashes, you're more likely to preservie your data without corruption or data loss.
ext4: This is the fourth version of the extended file system, and the most common filesystem used by people installing GNU/Linux. Almost any installer will default to this, if you're not sure what filesystem is best for you, or you don't care about the filesystem used, select this one. It's also journaled, so it's more fault tolerant than some. If you plan on using Steam, or any other gaming platforms, you'll want to use this filesystem at least for your home partition or else many games will not run.
btrfs: This is a newer filesystem, it has support for snapshots and multiple other interesting features, making it very robust for data protection and backups.
xfs: This is a high performance filesystem optimized for parallel I/O, and has many features most users may not need or use. Most notably it uses B+ trees to improve performance and is journaled to reduce likelyhood of data loss. If you plan on setting up a server, or some sort of cluster, this may be a good filesystem for you.
jfs: This filesystem uses B+ trees to accelerate indexing and locating files, it's also journaled, so your data should be safe in case of drive, system, or power failure.
zfs: A somewhat specialized filesystem, zfs is focused on data integrity, so it's best put to use on drives holding your backup data or other important information that cannot be corrupted.
Once the partitions and filesystems have been set up, we need to actually mount them somewhere so they can be accessed. Again, graphical installers will handle this for you, at least for the most part (they'll automatically create the root '/', home "/home", boot "/boot", and swap points. If you have anything extra to add in, on a graphical installer, you just need to select the partition and give it a mount point or directory that the storage space gets assigned to. For example: if you want to have a separate partition for your photo editing work, you can set up a new mountpoint of "/home/$USER/photoshop". Of course substitute $USER for your intended username.
For those wanting to use a manual install, creating mountpoints couldn't be simpler.
First, run: "lsblk -f" so you can see all the partition names and filesystems listed.
Second, run: "mkdir -p /path/to/whatever/mountpoint" to create the mountpoint desired.
Lastly, run: "mount /dev/sdxy /path/to/whatever/mountpoint" to actually mount the partition.
Download and Install of Base System:
So now that the filesystem and partitions are set up, we just need to get everything downloaded and installed. Even still at this point, the graphical installer will take care of everything for you, just keep hitting next.
For people using manual installs, you need to use a utility like pacstrap (for Arch), or wget/elinks/links (Gentoo, Funtoo, etc.) to download the basic system files and place them in the correct location. Please note that if you choose to use one of those systems that this guide is not intended to replace the install guide on the Arch wiki, or the Handbook on the Gentoo wiki, only to guide people in the right direction to get a F/LOSS OS up and running.
Setting System Configurations:
This is the same on almost all distros, though the graphical installer tends to take care of it before even setting up your partitions. With manual installs, this is handled after setting up the base system and chrooting into the base system. (chroot /path/to/root /bin/bash) You set up the timezone, keyboard layout and other system settings there.
The final step is setting up the bootloader, which again, on a graphical install, should be handled for you with only a simple prompt to install a program called GRUB. GRUB stands for "the GRand Unified Bootloader," it starts up before anything else, reads your boot partition for the boot files and uses that information to start up your new OS.
If you'd like, you can use something else like Gummiboot, LiLo, ELiLo, or Syslinux, though you'd have to read the documentation on how to properly set up the bootloader if you intend to use one of these.
Once you reboot, you'll be presented with a menu which allows you to select which OS you want to boot into, simply select your GNU/Linux install and you'll get the experience of a native install, which gives you full access to the software repositories and customization options.
Post Install Configuration:
Now that we have an installed system to work on, we need to set up a few things that you'll want for your system. For example, if you enjoy gaming, need an office suite, or other programs we'd run a few commands to get them installed. We're using the command line because it's universal across systems.
Ubuntu based systems: sudo apt-get update sudo apt-get upgrade sudo apt-get install steam libreoffice <whatever else you want to install> apt-cache search <program> (Will search for the name of a program so you can install it.) Arch based systems: sudo pacman -Syyu steam libreoffice firefox <whatever else to install> RHEL based systems: sudo yum distro-sync sudo yum install steam libreoffice firefox <whatever else> OpenSuSe based systems: sudo zypper dup sudo zypper install steam libreoffice firefox <whatever else> Gentoo: sudo emerge --sync sudo emerge -a libreoffice layman firefox <whatever else> (steam is not in the gentoo repos, you need to use an overlay) Sabayon: sudo equo u sudo equo up sudo equo i libreoffice steam firefox
Wait, Something's not working!
Most commonly, wifi causes trouble on fresh installs. Generally this can be fixed by simply downloading the drivers needed for that wifi chipset. For intel wifi cards, you most likely need the driver called "iwlwifi" for broadcom cards you'll need either the "B43", "BRCM80211" or "wl" drivers, depending on chipset. Now, this guide can't possibly cover all possible outcomes from here into the future, but I can help you find the information you need to ask the right questions.
Running the command: "lspci -vnn" will tell you all of your devices, you'll just need to locate the one talking about wifi or network adaptors, this will tell you the manufacturer, model, and even the exact chipset ID. That information will give you enough info to either find the right driver through a search engine, or ask a forum for help.
There's multiple other steps that can be taken to customize your new OS, but that falls well outside the scope of this article's intent. Most of what'll be useful can be found with your distro's package manager or in the settings of your current Desktop Environment.