GithubHelp home page GithubHelp logo

arch-installation-guide's Introduction

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.

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 either BIOS or EFI mode.
  3. You use an Intel CPU.
  4. Your desired root filesystem is BTRFS.

The steps

  1. 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.
  2. If you're using Wifi, launch wifi-menu. You're network should be automatically configured if you're using wired network.
  3. 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.
  4. Partition your disk:
    1. BIOS - Just mkfs.btrfs /dev/sda the entire disk and then mount /dev/sda /mnt
    2. EFI - Use cfdisk for partitioning:
      1. Choose GPT partitioning
      2. Create a 512MiB partition. Set its type to EFI System
      3. Create a partition for the rest of the drive.
      4. mkfs.vfat -F32 /dev/sda1
      5. mkfs.btrfs /dev/sda2
      6. mount /dev/sda2 /mnt
      7. mkdir /mnt/boot
      8. mount /dev/sda1 /mnt/boot
  5. pacstrap /mnt base intel-ucode sudo btrfs-progs
  6. genfstab -U /mnt >> /mnt/etc/fstab
  7. arch-chroot /mnt
  8. ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
  9. Uncomment en_US.UTF-8and other needed localizations in /etc/locale.gen
  10. locale-gen
  11. Edit /etc/locale.conf and write LANG=en_US.UTF-8
  12. Networking
    1. Laptop - 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
    2. PC/VM - Use systemd-networkd
      1. systemctl enable systemd-{network,resolve}d
      2. Use ip link to determine the name of your network interface
      3. Edit /etc/systemd/network/dhcp.network:
      [Match]
      Name=en*
      
      [Network]
      DHCP=ipv4
      Domains=extra.domains.that.you.need.example.com
      
      [DHCP]
      UseDomains=yes
      
      1. rm /etc/resolv.conf ; ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
  13. echo hostname > /etc/hostname
  14. passwd - Set the root password
  15. useradd -m your_username
  16. usermod -G wheel -a your_username
  17. visudo - Comment out the line containing the wheel group
  18. Install the bootloader
    1. BIOS - GRUB
      1. pacman -S grub
      2. grub-install --target=i386-pc /dev/sda
      3. grub-mkconfig -o /boot/grub/grub.cfg
    2. EFI - systemd-boot
      1. bootctl --path=/boot install
      2. Edit /etc/pacman.d/hooks/systemd-boot.hook:
        [Trigger]
        Type = Package
        Operation = Upgrade
        Target = systemd
        
        [Action]
        Description = Updating systemd-boot...
        When = PostTransaction
        Exec = /usr/bin/bootctl update
        
      3. Edit /boot/loader/loader.conf:
        default  arch
        timeout  4
        
      4. Figure out your root UUID By running blkid
      5. Create /boot/loader/entries/arch.conf
        title          Arch Linux
        linux          /vmlinuz-linux
        initrd         /intel-ucode.img
        initrd         /initramfs-linux.img
        options        root=PARTUUID=THE-UUID-YOU-FOUND-OUT rw
        
  19. Leave chroot - exit
  20. If this is a server installation you might want to enable SSH before rebooting. See the instructions at the bottom.
  21. Reboot - systemctl reboot

Extras

GNOME

pacman -S gnome && systemctl enable --now gdm

Setting up an SSH server

pacman -S openssh && systemctl enable --now sshd.socket

Yay

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

arch-installation-guide's People

Contributors

drrlvn avatar r-darwish avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.