This article was co-authored by wikiHow staff writer, Jack Lloyd. Jack Lloyd is a Technology Writer and Editor for wikiHow. He has over two years of experience writing and editing technology-related articles. He is technology enthusiast and an English teacher.
The wikiHow Tech Team also followed the article's instructions and verified that they work.
This article has been viewed 6,308,316 times.
Learn more...
This wikiHow teaches you how to replace your computer's current operating system with Arch Linux, which is a rolling release distribution focused on simplicity. Luckily, the Arch installation is too hard as long as you know what your doing. You can install Arch Linux on both Windows and Mac computers.
Steps
Booting into the Installer
-
1Back up your computer to an external hard drive. You'll be erasing your current operating system, so make sure that you have a backup of anything that you want to keep before continuing.
-
2Download the Arch installation image. Arch Linux can be downloaded in ISO format, from which point you can burn it onto a blank DVD in order to run the image on your computer. To download this image:
- Make sure that you have either BitTorrent or uTorrent installed.
- Go to https://www.archlinux.org/download/ in your browser.
- Click the Torrent link below the "BitTorrent" heading.
- Open the downloaded torrent in BitTorrent or uTorrent.
- Wait for the Arch Linux torrent file to finish downloading.
Advertisement -
3Burn the image onto a blank DVD. Once your Arch Linux ISO file finishes downloading via your torrent client, you'll burn it onto a blank DVD using your computer's DVD drive. Once the burning is complete, leave the DVD in your computer.
- If your computer doesn't have a DVD drive, you'll need to buy an external DVD drive and attach it to your computer via USB cable.
-
4
-
5Press the key that allows you to change the boot order. On most newer computers, this is F12, though the exact key should be displayed on the screen during boot up. If there is no key to change boot order, press the BIOS Setup key (usually F1, F2, F10, or Del).
- Skip this step on a Mac.
-
6Select your installation drive as the primary boot drive. Set the drive (e.g., "DVD Drive" or "Disk Drive") that contains your Arch Linux DVD as the primary drive by selecting it and pressing the + key until it's at the top of the menu.
- Skip this step on a Mac.
- On some PCs, you may first have to open an "Advanced" tab or select a "Boot Options" section.
-
7Save and exit the "Boot Options" screen. You should see a key at the bottom or in the bottom-right corner of the screen that you can press to save and exit. After doing so, your computer will resume restarting.
- Skip this step on a Mac.
-
8Select Boot Arch Linux and press ↵ Enter. This will launch the Arch Linux installer, at which point you can proceed with partitioning your hard drive.
Set Up Networking
-
1Set up a Wi-Fi connection. If your computer is plugged into your router via ethernet, you can skip this step. Using ethernet is preferable to using Wi-Fi.[1]
- Arch Linux has a easy-to-use utility for wireless networks called iwctl, as recommended when starting up . More info can be found here: https://wiki.archlinux.org/title/Iwd
- Note: This isn't automatically installed onto your system, in order to do so you must download the iwd package. After that, enter systemctl enable --now iwd
- You also will have to download a DHCP Client. Download dhcpcd and enable the dhcpd daemon via systemctl enable --now dhcpcd
-
2Using iwctl
- Type iwctl and press ↵ Enter
- Type station list and find what your network interface is. It is usually wlan0
- Next, you should try finding what network name you want to connect to.
- Type station interface connect "ssid" (network name)
- If your network is password protected, you should enter your password to connect to your wifi.
- More info: https://wiki.archlinux.org/title/Network_configuration/Wireless
Creating Partitions (BIOS)
-
1Check your existing drives. You'll have at least two drives available: your computer's hard drive, and the Arch Linux installation media. To check your current drives:
- Type in fdisk -l and press ↵ Enter.
- Find the name of the largest hard drive on the results screen. The name will be something like "/dev/sda" and can be found to the right of the "Disk" heading.
-
2Bring up the partition page. Type in cfdisk [drive name], making sure to replace [drive name] with your hard drive's name, and press ↵ Enter, then select DOS and press ↵ Enter again.
- For example: if the drive is named "/dev/sda", you would type cfdisk /dev/sda into the terminal.
-
3Delete the hard drive's contents. Select a partition in the middle of the screen, select Delete at the bottom of the screen, press ↵ Enter, and repeat for any other partitions in the middle of the screen. You should ultimately be left with a line entitled Pri/Log Free Space.
-
4Create a "swap" partition. This partition will function as your system's backup memory if and when you are consuming all of your RAM. To do so:
- Select New and press ↵ Enter.
- Select Primary and press ↵ Enter.
- Type in a number of megabytes (e.g., 1024 for one gigabyte) and press ↵ Enter. As a rule of thumb, you should make the swap partition 2 or 3 times your RAM (e.g., if you have 4 gigabytes of RAM, you should make the swap partition 8192 or 12288 megabytes).
- Select End and press ↵ Enter.
-
5Create your main hard drive partition. This is the partition on which your Arch Linux operating system, files, and other information will be stored. To do this:
- Make sure that the Pri/Log Free Space partition is selected.
- Select New and press ↵ Enter.
- Select Primary and press ↵ Enter.
- Make sure that the number next to the "Size (in MB)" heading is correct.
- Press ↵ Enter.
- Select the primary partition again.
- Select Bootable and press ↵ Enter.
-
6Label the "swap" partition. This will set it as your system's RAM:
- Select the "swap" partition.
- Select Type and press ↵ Enter.
- Type in 82 and press ↵ Enter.
- With the "swap" partition still selected, select Write and press ↵ Enter.
- Type in yes and press ↵ Enter.
-
7Note the names of your partitions. In the "Name" column on the far-left side of the screen, you should see a name (e.g., "sda1") next to your "swap" partition, and a similar name (e.g., "sda2") next to the primary partition. You'll need both of these names in order to format your partitions.
-
8Exit the "cfdisk" utility. Select Quit and press ↵ Enter to do so.
-
9Format your primary partition. This will make it usable with your operating system. To do this, type in mkfs.ext4 /dev/[primary partition name] and press ↵ Enter.
- For a partition named "sda2", you'd enter mkfs.ext4 /dev/sda2 here.
-
10Mount the formatted partition. Type in mount /dev/[partition name] /mnt and press ↵ Enter. This will make the partition into a usable drive.
-
11Add a swap file to the "swap" partition. Type in mkswap /dev/[partition name] and press ↵ Enter, then type in swapon /dev/sda1 and press ↵ Enter again. After completing this step, you can proceed with installing Arch Linux.
- For a "swap" partition named "sda1", for example, you'd enter mkswap /dev/sda1 and then swapon /dev/sda1 here.
Creating Partitions (UEFI)
-
1UEFI Systems: Nowadays we've completely moved from BIOS to UEFI, this makes the installation slightly more confusing as now we have more steps. For example: we may have a EFI Partition already created (more on that later) or we may have windows installed. For this reason, if you aren't sure what you should do, search it up: for example "How do i duel boot in windows"? Its recommended to follow the arch wiki as its the most accurate source for anything arch-related
- Select gpt if you see the option
- Partitioning in some aspects are easier in UEFI: People used to bios may notice that when creating a partition, you do not need to choose a primary or extended device.
-
2Create an EFI Partition if not yet created with more than 512 MB
- Make sure to set the Partition to the EFI Type, Find Type and find "EFI System", select that.
- If you see that there already is an EFI Partition, this usually means that you have some Operating System installed. If this is the case be very careful and don't blindly enter commands while formatting.
-
3(Optional but strongly recommended) Create a swap file. Select the type as "Linux swap".
- A basic rule of thumb is the double amount of your ram. For example: if you have 8 GB of ram create a 16 GB Swap file. If you want to save space, you can set it to the amount of ram you have.
-
4Create a Root Partition. This will be the rest of our data. Select the rest of the space left. Make sure it is at least 2 GB, however its recommended to be as much as you can.
-
5Formatting our Partitions. Linux makes this very simple. Most every filesystem command starts with mkfs.
-
6Format our EFI System. We can now format our EFI system. Here we choose FAT32, but you can chose what you want. mkfs.fat -F32 /dev/sdX{EFI PARTITION}
- if you already have something on your EFI Partition DO NOT ENTER THE COMMAND. This will completely erase your current operating system's bootloader and can complicate the install process.
- Make sure you know that you are formatting the right device. If not, enter fdisk --list
-
7Make the Swap file. If you created one, simply create a swap file by entering mkswap /dev/sdX{SWAP PARTITION}
-
8After making a swap file, enter swapon /dev/sdX{SWAP PARTITION}.
-
9Format our root system. There are many file systems, like btrfs, zfs, and many more, however those are out of the scope of this guide. Here we will be using the standard filesystem ext4. enter mkfs.ext4 /dev/sdX{ROOT}
-
10We've finally formatted our partitions, all that is left is that we mount our root partition to mount via: mount /dev/sdX{Root]
Pacstrap
-
1Install the base system. Type in pacstrap /mnt base base-devel linux linux-firmware and press ↵ Enter. The system will begin installing onto your computer.
- Note: this does not include a text editor nor other tools you may expect, if you didn't install one, chroot (after generating the fstab file) into /mnt and do pacman -S nano [1]
- This process will usually take around 15-30 minutes depending on your Internet connection speed.
-
2Generate a fstab file. This file will help linux remember what to mount and where. In order to generate this, enter genfstab -U / mnt >> /mnt/etc/fstab
Configuring
-
1Open "chroot" access. Type in arch-chroot /mnt and press ↵ Enter. This will allow you to change aspects of the root directory, including the password.
-
2(Optional) Set a password. This is the password that you'll use to log into the root account. To do so:
- Type in passwd and press ↵ Enter.
- Type in a password and press ↵ Enter.
- Retype your password and press ↵ Enter.
-
3Set a language. To do so:
- Type in nano /etc/locale.gen and press ↵ Enter.
- Scroll down to select your preferred language.
- Select the letter directly in front of the "#" symbol behind your language and press Del.
- Delete the "#" symbol from any other versions of your language (e.g., all versions of "en_US").
- Press Ctrl+O (or ⌘ Command+O on a Mac), then press ↵ Enter.
- Exit by pressing Ctrl+X or ⌘ Command+X.
- Type in locale-gen and press ↵ Enter to finish setting up your language.
-
4Select a time zone. To do so:
- Type in cd usr/share/zoneinfo and press ↵ Enter.
- Type in ls and press ↵ Enter.
- Find your country or region, then type in cd usr/share/zoneinfo/country (e.g., America) and press ↵ Enter.
- Type in ls again and press ↵ Enter.
- Find your preferred time zone, then type in ln -s /usr/share/zoneinfo/country/timezone /etc/localtime and press ↵ Enter.
-
5Setting the hostname is quite easy. Open /etc/hostname with your text editor of choice, if you don't have one use nano and enter your hostname of choice, make sure your hostname is not capitalized.
- Optionally, you can use cat. For example, if you want your hostname to be panda enter echo panda > /etc/hostname here.
-
6Download the GRUB bootloader. This is the program that will install your Arch Linux for you. To do so:
- Type in pacman -S grub and press ↵ Enter.
- Type in y and press ↵ Enter.
Installing GRUB (BIOS)
-
1Install GRUB. Make sure that when you do this, you install it on your actual hard drive (e.g., "sda"), not the partition (e.g., "sda1") unless you're installing it in UEFI, in that case do not install it using these methods as this is exclusive to BIOS. To install GRUB:
- Type in grub-install /dev/drive name (e.g., grub-install /dev/sda and press ↵ Enter.
-
2Create a configuration file for GRUB. To do so, type in grub-mkconfig -o /boot/grub/grub.cfg and press ↵ Enter.
Installing GRUB (UEFI)
-
1Install GRUB. Grub is the most common bootloader as of writing and one of the simplest to install. For this reason, we will be installing GRUB.
-
2Make sure to mount your EFI Partition you created. If you haven't enter these commands: mkdir /boot/efi (to create a efi directory. Note this is case sensitive) mount /dev/sdX(EFI PARTITION) /boot/efi
- make sure you mount these. Some people mount the efi directory in places such as boot or efi, however, this could cause issues.
-
3Installing Grub. You may have installed grub at some point, if you did do not ignore this step (if not, install via pacman -S grub). You have to add a package so that grub can support efi based systems. Download the package: pacman -S efibootmgr.
- you may also need some additional packages
-
4Using the grub-install command. Now its time to actually install grub, we do this by using the grub-install command.
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ArchInstall
Reboot
-
1Reboot your computer. To do so, type in umount /mnt and press ↵ Enter, type in reboot, press ↵ Enter, remove your installation media, and wait for your system to finish rebooting.
-
2Log into your account. Type root into the "login" field and press ↵ Enter, then type your password in and press ↵ Enter. You have successfully installed and opened Arch Linux on your computer.
Community Q&A
-
QuestionWhen booting from USB, Arch does a kernel panic when I try to boot as a UEFI, but I can boot as legacy. The system boots Windows as a UEFI. I want to dual boot the system. How should I partition the disk?Community AnswerThe Legacy/UEFI problem has nothing to do with how you partitioned the disk. If it works in legacy mode, then double check your bios settings. Set Boot Mode to EFI. Disable Secure Boot. Check if your stick actually has an EFI folder. If not, try a greater update of Arch and/or of the software you use to put Arch on the stick.
-
QuestionI had to exit out of chroot in order to follow step 12. Is there a reason for this?Community AnswerThe answer is twofold. While you're chrooted into the Arch partition, you're effectively using the system. The system as you currently have it does not have the command genfstab in it, and therefore cannot use it. The path that the tutorial uses, /mnt/etc/fstab, is only valid when you are not chrooted into the system. Remember that when you chroot, you chroot into /mnt, and therefore effectively make that the root (/) directory. Thus, if you tried to use the same command, you'd pretty much be saying "put the fstab file in /mnt/mnt/etc/fstab" when there is no such directory.
-
QuestionAre there any benefits of putting swap in front versus at the end or as a swapfile?DogeManCommunity AnswerThere is none. It doesn't matter. There is no benefit. Probably the only possible benefit is that it might save the hard drive less than a millisecond, even then it's not a guarantee.
Warnings
- Ensure that you pick a root password that is both memorable and secure. If you forget it, you will not be able to properly administer your system.⧼thumbs_response⧽
- You can easily destroy your windows partition if you plan to duel boot: make sure to double check before doing anything and that you are confident in installing.⧼thumbs_response⧽
References
About This Article
1. Back up your PC to an external drive.
2. Download the installation image from archlinux.com/download.
3. Burn the image to a DVD.
4. Restart the computer.
5. Boot from the DVD.
6. Select Boot Arch Linux and press Enter.
7. Create main and swap partitions.
8. Use ″pacstrap /mnt base base-devel″ to install.