Arch linux install guide github

Arch linux install guide github

Arch Linux installation guide

So you want to install Arch Linux but got lost in the Wiki. This is a quick guide for installing a basic system. It is far from being feature-complete, as it makes some basic assumptions.

  1. You want to use the entire disk for Arch Linux without dual-booting another operating system.
  2. You use either a physical or a virtual x86 64 bit machine which is capable booting in EFI mode. Note that if you use a virtual machine then you’ll probably have to check the EFI option somewhere.
  3. You use an Intel CPU.
  4. Your desired root filesystem is XFS.
  1. Disable «Secure Boot» in the BIOS.
  2. Boot into Arch Linux live installation media. Make sure that you know which disk is used for your installation. We’ll assume it’s /dev/sda . You can use blkid to list block devices.
  3. If you’re using Wifi, launch wifi-menu . You’re network should be automatically configured if you’re using wired network.
  4. Optional — You can launch an SSH server and continue your installation remotely from another computer. In order to do that:
    1. Set a root password using passwd
    2. Start the SSH server using systemctl start sshd
    3. Figure out your IP using ip a
    4. SSH to your installation disk from another computer and continue the installation as usual.
  5. Partition your disk:
    1. Run cfdisk for partitioning
    2. Choose GPT partitioning (if you don’t get the option to choose ,please run cfdisk -z )
    3. Create a 512MiB partition. Set its type to EFI System
    4. Create a swap partition. 4GiB will probably do. Set its type to Linux Swap
    5. Create a partition for the rest of the drive. (that should create /dev/sda3)
    6. mkswap /dev/sda2
    7. swapon /dev/sda2
    8. mkfs.vfat -F32 /dev/sda1
    9. mkfs.xfs /dev/sda3
    10. mount /dev/sda3 /mnt
    11. mkdir /mnt/boot
    12. mount /dev/sda1 /mnt/boot
  6. pacstrap /mnt base intel-ucode sudo linux linux-firmware xfsprogs neovim
  7. genfstab -U /mnt >> /mnt/etc/fstab
  8. arch-chroot /mnt
  9. ln -sf /usr/share/zoneinfo/Region/City /etc/localtime (you can see all the options in wiki timezones list)
  10. Uncomment en_US.UTF-8 and other needed localizations in /etc/locale.gen
  11. locale-gen
  12. Edit /etc/locale.conf and write LANG=en_US.UTF-8
  13. Networking — Use NetworkManager
    1. pacman -S networkmanager
    2. systemctl enable NetworkManager
    3. Once you have a GUI environment set up — configure the network using the GUI
  14. echo [YOUR HOSTNAME] > /etc/hostname
  15. passwd — Set the root password
  16. useradd -m
  17. usermod -G wheel -a
  18. passwd — Set the user password
  19. EDITOR=nvim visudo — Uncomment the line containing the wheel group
  20. Install the bootloader — systemd-boot
    1. bootctl —path=/boot install
    2. Edit /etc/pacman.d/hooks/systemd-boot.hook :

      (NOT ) with the PARTUUID that you got from running blkid . Note that the UUID is case sensitive.

      Building packages from AUR isn’t possible to do as root. In order to install Yay you have to configure sudo and run these commands as a regular user.

      1. sudo pacman -S —needed base-devel git
      2. cd /tmp
      3. git clone https://aur.archlinux.org/yay-bin.git && cd yay-bin && makepkg -i && cd — && rm -rf yay-bin

      pacman -S gnome && systemctl enable —now gdm

      pacman -S sddm plasma-meta kdebase-meta kdeutils-meta kdegraphics-meta && systemctl enable —now sddm

      Источник

      BrinkerVII / ARCH_INSTALLATION_GUIDE.md

      This guide is out of date! Following this guide will leave you with a non-functioning system. You can still use this guide for inspiration, but please still do use the Official installation guide

      Arch Linux installation guide

      Hi there, this is a guide to install Arch Linux on your computer. I decided to write a guide because I find most other guides to be either too minimalistic or they have you set up some parts of the system in strange ways.

      This guide is reference material for myself, as well as for other people who would like to install Arch for the first time.

      • This guide does assume that you are somewhat of a technically savvy user.
      • Have fun! Breaking stuff is part of the process and there’s always a way to fix it. Don’t be afraid 🙂
      • Dual booting sucks. If you are installing Arch Linux alongside another operating system like Microsoft Windows, I recommend installing Arch on its own hard drive. If you are using an EFI system, you can even have multiple boot managers through your motherboard firmware.

      Thank-you notes

      Thanks to the wonderful people on the Linux Masterrace subreddit for reviewing the first version of this guide.

      Let’s get rolling!

      If you do not have a US-international keyboard, you’ll have to change your keyboard layout in order for you to stay sane. You can list the available keyboard layouts with the following command

      After that, you can set your preferred keyboard layout using loadkeys . For example with a German keyboard.

      Your system clock has to be accurate for the setup to work properly. Synchronise the clock with the following command.

      Additionally, you can verify the clock status with the timedatectl status and date commands.

      We’re assuming that the drive we’re installing on is /dev/sdx. Of course, you should check which drive you want to install to. lsblk Helps you identify disks easily.

      NOTE: If you’re installing in BIOS/MBR mode, you want to use fdisk instead of gdisk and always follow the GRUB path for the boot loader.

      Before you start partitioning

      Your partition table is not something you can just change on a whim if you change your mind or if you find out you messed up. This guide comes with a partitioning scheme which is pretty flexible.

      If you don’t trust my partition scheme or just want something else, you should read the following paragraphs before you start partitioning

      Your root partition

      Your root partition is also the root of your Linux file system tree. This guide has you install your system into this partition (/usr, /lib, /var, /etc, . ). If you follow my partitioning scheme you should make this partition large enough to fit all of the stuff you’re going to install. My root partition is 80GiB in size and 32GiB of that is currently in use. I have quite a lot of packages installed including a bunch of large IDE packages. If you are already running another GNU/Linux distribution, you should check how much space your system files are using and use that as a base line. If you’re not running a GNU/Linux distribution or are unfamiliar with the ecosystem, its probably better to go with my upper bound of 80GiB.

      The boot partition

      It is not necessary to have your boot files in a separate partition if you’re not using full disk encryption. However, having a separate boot partition allows you to add on recovery tools later on. So if you really break your system, you always have something to fall back on.

      The not necessary rule only works for non-EFI setups though, if you’re running in EFI mode you need an ESP partition. Ubuntu based distributions mount the ESP partition inside /boot at /boot/efi , but I find this to be quite messy. Not only that, it is incompatible with SystemD-boot.

      The home partition

      The home partition is another partition which is not required to be its own partition. However, having it separate allows you to mount this partition when or if you decide to boot into another distribution and still have all your documents and settings in the right place. This partition should also be plenty big if you’re going to use Steam. Steam likes to install all of your games into your home folder if you do not change the defaults.

      If you decide to skip making a separate home partition, you should make your root partition fill the rest of your disk outside of your boot and swap partitions.

      The swap partition

      Linux uses a swap file or a swap partition for when it runs out of memory for applications. Before the Linux kernel gained support for swap files, it was commonplace to create a swap partition. You can skip making a swap partition and use a swapfile instead. The benefit of this is that a swap file is more flexible than a swap partition, you can change the size of a swap file at any time.

      The size of your swap partition or swap file depends on what you want to do with your computer. If you want to be able to use the hibernate functionality, your swap partition or file should at least be the size of your system memory. When you hibernate your computer, Linux uses the swap space to store the contents of your memory. If the swap space isn’t big enough, things will go badly.

      You can always be a rebel and run without swap space, but don’t be surprised when the OOM killer comes around the corner and running applications start disappearing (the enormous stuttering will be a dead giveaway that you’re running out of memory when you don’t have any swap space).

      File system types

      This guide uses EXT4 for the root and home partitions. It’s a solid filesystem for every day use. The ESP partition has to be FAT32 because Intel decided it should be.

      You can choose to use other filesystems if you want to, but beware that you can’t change your file system without deleting all the files stored on the partition. So changing file systems may be quite the chore if you run into problems with the file system you chose. If you do not know anything about different file systems or do not want to research about the subject and want to get going, just stick with EXT4.

      Partition layout for this guide

      We’re going for the following layout:

      Steps to partition your disk:

      • Run gdisk /dev/sdx or fdisk /dev/sdx
      • Press o to create a new partition table
      • Press n to start creating a new partition
      • Enter ef00 for the partition type, this tells the firmware that this is an EFI system partition (ESP)
      • Press enter to confirm the partition start
      • Enter +512M to make the partition 512MiB large.
      • Repeat for the remaining positions. Where you entered ef00 before, enter 8300 for / , 8302 for /home and 8200 for the swap partition. HINT: You can type +100G to make a 100GiB partition

      Press w to write your changed to disk. gdisk/fdisk will ask to confirm your changes and still let you quit without writing anything if you’ve messed up entering the partition data. After gdisk has exited, run lsblk to confirm that what you did was actually correct. If need be, you can repeat setting up your partitions with gdisk.

      lsblk should report something along the lines of:

      Before you can use the partitions you set up, you have to format them.

      • mkfs.fat -F32 /dev/sdx1
      • mkfs.ext4 /dev/sdx2
      • mkfs.ext4 /dev/sdx3
      • mkswap /dev/sdx4 (optional)

      This is how we want to mount the partitions:

      You can accomplish this by running the following commands in order:

      • mount /dev/sdx2 /mnt
      • mkdir /mnt/boot
      • mount /dev/sdx1 /mnt/boot
      • mkdir /mnt/home
      • mount /dev/sdx3 /mnt/home

      You can confirm if you’ve ran the commands correctly by running the mount command without any arguments. This should yield a result similar to the following:

      Setting up the system

      Now we’re ready to actually start installing Arch!

      Bootstrapping the system

      Bootstrapping the system is fairly easy. You just have to run the following commands:

      • pacstrap /mnt base base-devel
      • genfstab -pU /mnt > /mnt/etc/fstab
      • arch-chroot /mnt

      Congratulations, you’ve now installed Arch on your hard drive and you’re technically ‘booted’ into it!

      Installing the boot loader

      I personally recommend choosing between either GRUB or SystemD-boot. GRUB is fairly commonly used and you’re probably going to find a lot of help online. SystemD-boot comes included with SystemD, Arch uses SystemD as its init system.

      First you have to install GRUB. pacman -S grub os-prober dosfstools

      Once GRUB is installed, configuration is quite straightforward. Just run these commands:

      • grub-install —recheck /dev/sdx
      • grub-mkconfig -o /boot/grub/grub.cfg

      SystemD-boot comest installed with Arch. You just have to run bootctl install to install it into your EFI partition.

      Side-note: if you get a warning or error about not being able to set EFI variables, you’ll have to install the efivar and efibootmgr packages. This will allow bootctl to tell your motherboard firmware where its boot image is located

      Creating a new boot entry

      The easiest way of getting the boot entry file correct in the terminal is through vim. Vim does not come with Arch, so you’re going to have to install it. Run pacman -S vim

      The boot entry file is going to live at /boot/loader/entries/arch.conf , so run vim /boot/loader/entries/arch.conf to start editing the file at that location.

      Now we’re getting into the vim magic.

      • Make sure you’re in normal mode by slapping ESC like a maniac.
      • Then type :r !blkid to run the blkid command and get its output.
      • We want to copy the UUID for our root partition, which should be at /dev/sdx2 . Type /sdx2 to jump to the line which has the UUID for our root partition.
      • Exit to normal mode by pressing enter. Now type vi» to select the UUID for the partition. Yes that is correct, you actually have to type the » as if you were just editing regularly.
      • Now press y to copy the UUID.
      • Move your cursor to the top of the file and press p to paste the UUID onto the first line.
      • Now enter insert mode at the end of the line by typing A (capitalisation matters!)
      • Add some newlines after it by pressing enter, we want the UUID to be separated from the rest of the blkid command output.
      • Exit to normal mode by pressing ESC and move your cursor over the blkid command output.
      • Type vapd to get rid of it all.
      • Now enter insert mode by pressing i and edit the file to look like the example below. Typing :wq will write your changes and exit vim.

      Setting the default boot entry

      For this part you can still use vim if you want, but nano tends to be perceived to be more user friendly. So in most of the upcoming commands you can substitute vim for nano if you want to.

      Open an editor to edit /boot/loader/loader.conf . Run vim /boot/loader/loader.conf The file should look like the snippet below before you save it.

      Install and enable NetworkManager

      Other setup guides tend to use the networking provided by SystemD, however, I don’t like that. So I’m going to show you how I do it.

      Run the following commands:

      • pacman -S networkmanager
      • systemctl enable NetworkManager

      Congratulations, NetworkManager is now installed and enabled. You should not have to mess with networking from this point on unless you’re trying to set up over wireless. In that case you should look over the documentation about nmtui (The NetworkManager Text User Interface).

      You’re now done setting up your Arch base system. Run exit to exit the chroot environment and then poweroff to shut down your computer. Now is the time to remove your installation media.

      Configure basic system settings

      When you boot up your computer now, you should be greeted by the boot loader you’ve installed and you should be able to get to a log in screen! Log in with the username root . You don’t need a password

      Set the hostname

      This is the point where you come up with a name for your computer. Set the hostname by running this command:

      Intermission

      Are you tired of entering your sudo password all the time? There’s a fix for that!. Instead of adding your user to the sudo group in the useradd command, you can add your use to the wheel group instead and you won’t have to provide your password when you use the sudo command. Be aware that this strips down on your physical security, if you take your computer to public places you shouldn’t add your user to the wheel group.

      You do have to enable the wheel group. You do this by uncommenting the line in /etc/sudoers where the wheel group is defined. Edit /etc/sudoers through visudo with the following command (Never edit /etc/sudoers directly, it’ll get you in trouble!).

      You can change nano to which ever editor you prefer

      Add your user

      Add your user by running the following command.

      After that is done, you’ll want to set a password for you user account. You do this by running the following.

      Setting your locale

      GNU/Linux supports multiple languages and locales. You need your locale to be set up correctly for the system to function correctly (in the desired language).

      Start of by editing etc/locale.gen ( vim /etc/locale.gen ). Uncomment the languages you want your system to be able to support. Remember the exact name of the locale you want to be your main locale, you’re going to need that in a bit.

      Now you’ve configured the supported locales, its time to generate them. Run locale-gen to generate your locales. You’ll also want to set a system wide locale.

      Where en_GB.UTF8 is the locale you want, remember from earlier?

      By running the tzselect command, you are dropped into a basic utility which lets you choose your timezone. Select your desired timezone and remember its exact name. You’ll want to make this change permanent by running timedatectl set-timezone ‘Europe/Amsterdam’ , where Europe/Amsterdam is the timezone you selected.

      Set up hardware clock

      Setting up the hardware clock and network clock synchronisation is extremely straightforward. Just run these commands.

      • hwclock —systohc —utc
      • timedatectl set-ntp true

      If you haven’t set up a swap partition earlier, it might be helpful to set up a swap file instead. Swap is used instead of RAM when RAM is (getting) full. It more or less prevents your system from completely crashing when your memory fills up. If you don’t think you’ll need this, you can skip this step.

      Commands for setting up a swapfile:

      • fallocate -l 2G /swapfile
      • chmod 600 /swapfile
      • mkswap /swapfile
      • vim /etc/fstab
        • Add a new file system entry
        • /swapfile none swap defaults 0 0
      • vim /etc/sysctl.d/99-sysctl.conf
        • Add or change this line
        • vm.swappiness=10

      Edit pacman settings

      Edit /etc/pacman.conf ( vim /etc/pacman.conf ). Enable colour by uncommenting Color under Misc options . You’ll also want to uncomment the multilib section for 32-bit library support. You’ll need 32 bit libraries for things like games which are still stuck in 2010.

      You’re almost done with this section. Run pacman -Sy to sync the pacman repositories and run reboot to reboot the system.

      Side-note: When you’re installing software later on in the process and pacman cannot find packages X, Y and Z, you repositories probably have updated while you were installing software. You can fix this by resynchronising your pacman databases with pacman -Sy .

      Setting up your desktop

      From here on, you’ll be logging in as a regular user. Log in with the username and password you set earlier. For most of the setup you want to run commands as root. Use sudo -s to get a persistent root shell using sudo.

      From here on out, commands will either have a dollar sign or a hash in front of it. Commands prefixed with a hash have to be run as root, commands prefixed with a dollar sign have to be run as a regular user.

      To start installing Xorg, you’ll have to get the base packages for Xorg.

      # pacman -S xorg-server xorg-xinit xterm xf86-video-vesa mesa xorg-xrandr

      • xorg-server : The Xorg server package
      • xorg-xinit : Allows you to actually run xorg
      • xterm : The default X terminal
      • xf86-video-vesa : Default video driver
      • mesa : OpenGL support
      • xorg-xrandr : Useful utility for advanced X tasks

      Side-note: don’t try to be clever like I was when installing Arch and think you can leave out xterm because you’re going to use $OTHER_TERMINAL_APP anyways. Xorg won’t function properly without xterm installed!

      Installing graphics drivers

      You’re going to need a graphics driver specific to your graphics card. Listed below are major GPU vendors and their associated driver packages.

      If you’re installing Arch in VirtualBox, this is the time and place where you should install the VirtualBox Guest Additions. The VirtualBox Guest Additions contain the video drivers. You will NOT get a working graphical environment without these drivers! You can install the guest additions from the Arch repositories

      • AMD
        • xf86-video-amdgpu
        • xf86-video-ati (older cards only)
      • Intel
        • xf86-video-intel
      • nVidia
        • xf86-video-nouveau
        • nvidia (properietary)

      Not sure which card(s) you have?

      You can run the following command to run all of the cards installed in your system. If you have multiple graphics card installed, for example if you have a laptop with two GPUs, you’ll want to install the driver for every card.

      Decision time for nVidia users

      There are two sets of drivers, the open-source drivers and the proprietary drivers. You should install either one of the drivers, but not both. The proprietary drivers generally perform better, but there’s also this Stallman guy who says they’re evil.

      Install the packages with pacman and you’re on your way. AMD drivers as an example.

      Installing a desktop environment

      Listed below are most of the popular desktop environments and their associated packages. Pick the one you like and install it!

      Side-note: For the GTK-based desktops (XFCE, GNOME, Cinnamon, MATE and LXDE), you’ll want to install gvfs alongside the desktop to get wastebasket and mounting support for regular users. Install gvfs-mtp as well if you’re planning to connect your Android phone.

      XFCE as an example

      Installing and setting up a Display Manager

      You don’t need a display manager, but most normal people want a nice shiny clicky thing when their computer boots up. Typing startx on every boot gets old quickly for most people. Desktop environments should be paired with an appropriate display manager. Below is a list of pairings. LightDM generally works well with every desktop environment, except for KDE.

      Here’s an example for installing LightDM. LightDM is also the special one in the bunch because you have to install the so called greeter seperately.

      To enable your display manager you just run. Substitute lightdm with the display manager you’ve installed.

      Side-note: I personally prefer GDM over LightDM in combination with XFCE. LightDM does pretty badly out of the box with multi-monitor setups when you have to connect your computer to a bunch of random monitors. GDM still does a mediocre job, but it works better.

      Install alsa-utils . This package provides basic management tools for ALSA (Advanced Linux Sound Architecture)

      To start off, you should unmute your system before you start meddling with audio. By default, audio is muted.

      Pulseaudio is the sound server supported by most applications and it tends to work pretty well. If it is not already installed, install it now.

      pavucontrol is one of the better pulseaudio volume mixers, it is way better than most audio widgets and settings panels included with most desktop environments.

      Now just reboot , and you should be greeted by a login screen!

      The finishing touch

      Now you have a GUI, you should open a terminal and lock password access on the root account. The command for this is sudo passwd -l root .

      All the parts of the guide beyond this point are mostly ‘fluff’ to make your system nicer.

      Making your installation a tad comfier 🙂

      With some desktop environments you might notice that there are no folders named like Documents, Desktop, Music, etc. If you make them yourself you might also notice that your file manager does not recognise them as folders that contain music or videos or whatever. You can fix this by installing the xdg-user-dirs package and running $ xdg-user-dirs-update . You might want to log out and back in again if your software does not immediately respond to the change.

      Arch Linux by default does not include some of the nicer and more useful commandline tools. You’re going to have to install them yourself. Here’s some I like to have. (List might not be complete)

      • wget Download web content
      • curl Download web content to stdout

      Installing an AUR helper

      The AUR is a pretty awesome perk of running Arch, it contains a lot of user provided software in all flavours. However, it kind of sucks without an AUR helper. I prefer to use trizen , after pacaur was deprecated. So this is the AUR helper I’ll show you how to install. I’ve heard good things about yay as well. You can always install that alongside trizen to find out what you like.

      For starters, you’re going to need git to download AUR packages, so start off by installing git.

      You should have a folder to store your loose AUR packages, go make one! I prefer to store mine in my downloads folder. After that you’ll want to clone the trizen git repository.

      After that you’ll want to build and install the package.

      When you’ve got trizen installed, installing other AUR packages becomes quite simple.

      ZSH is an awesome shell, its even more awesome with packages like oh-my-zsh installed. This section will show you how to get ZSH with a set of fancy themes.

      First off, start by installing zsh

      Then install oh-my-zsh!

      Oh my zsh automatically switches your shell, but its better to just re-open the terminal. You can switch themes by editing

      Installing a firewall

      Its good staying secure. Installing a firewall ensures that no other machines are allowed to connect to random software on your machine they’re not supposed to connect to. I prefer firewalld , its meant for corporate environments, I like its flexibility and strict default policies. Installation is easy.

      The firewalld package also contains a nifty system tray applet firewall-applet . You can add it to your desktop startup if you want to be notified of firewall changes or have a quick shortcut to your firewall settings.

      Making KDE/Qt apps fit in with GTK desktops

      By default, KDE applications look extremely out of place on a gnome desktop. The fix for this is not the prettiest one, but it works. This fix is in the stock Arch repositories and doesn’t break half your desktop, which is nice.

      Start of by installing qt5ct

      This application does not magically work by itself. You’re going to have to edit the file

      /.profile and make sure the following export is present.

      After you’ve edited your .profile file, you have to log out and back in again for it to work. You should now be able to launch qt5ct and change the appearance of KDE and Qt applications. Set the styling to gtk2 to have everything blend in with your GTK desktop. Since this fix is quite duck tape -ey, you’ll have to re-open Qt apps after every change to see the effects.

      Menulibre is an application for editing your menu entries. This is useful if you want to add environment variables to application launchers and such. It is installed through the AUR.

      Playing games is a boatload of fun. Steam is proprietary (and popular!), it is trusted by a lot of users and it makes installing and managing games easy. However it needs some help to get going. You should start off by installing Steam.

      You’ll notice that the command installs steam-native-runtime as well. By default Steam runs on an Ubuntu runtime. It ‘works’ on Arch, but it runs and looks like garbage. After you’ve installed steam, you’ll either want to edit the Steam launcher to use the native runtime, or create a new launcher. The launcher should run /usr/bin/steam-native %U .

      Источник

      Читайте также:  Активатор windows 10 энтерпрайз
Оцените статью