This article explains how to replace your computer's current operating system with Arch Linux, an advanced version of Linux. You can do this on both Windows and Mac.
Steps
Part 1 of 3: Start the Installer
Step 1. Back up the data on your computer to an external hard drive
You will erase the current operating system, so make sure you have a copy of everything you need before continuing.
Step 2. Download the Arch installation image
You can find it in ISO format and copy it to a blank DVD, in order to install it on your computer. To download it:
- Make sure you have BitTorrent or uTorrent installed;
- Go to the page https://www.archlinux.org/download/ on a browser;
- Click the link Torrent under the heading "BitTorrent";
- Open the torrent you downloaded with BitTorrent or uTorrent;
- Wait for the download to complete.
Step 3. Burn the image to a blank DVD
After the Arch Linux ISO download is finished through the torrent client, you need to write the image to a blank DVD using your computer's burner. Once the disk is created, leave it inside the system.
If your computer doesn't have a DVD burner, you need to buy an external DVD drive and connect it to your computer via USB
Step 4. Restart your computer
Click Start
then Power
and finally Restart in the menu.
-
On a Mac instead, you have to click the Apple menu
then System Preferences …, Start, Outdoor unit, finally click Restart … in the Apple menu e Restart again when asked.
Step 5. Press the button that allows you to change the boot order
On newer computers, this is F12, although the exact button should appear on the screen during startup. If you don't see any keys to change the boot order, press that to configure the BIOS (usually F1, F2, F10, or Del).
Skip this step if you are using a Mac
Step 6. Set the hard drive as the primary boot drive
Choose the drive (for example "DVD Drive" or "Disc Drive") that contains the Arch Linux DVD and configure it as the primary drive by selecting it and pressing the + key until it reaches the top line of the menu.
- Skip this step if you are using a Mac;
- On some PCs, you will need to select the "Advanced" tab or the "Startup Options" section.
Step 7. Save and Exit the "Boot Options" screen
You should see a button indicated at the bottom or bottom right corner of the screen, which you can press to save your changes and exit. After this operation, the computer will resume the start-up procedure.
Skip this step if you are using a Mac
Step 8. Select Boot Arch Linux and press Enter.
This will start the operating system installer and you can continue by creating a partition on your hard drive.
Part 2 of 3: Creating Partitions
Step 1. Check the existing drives
You must have at least two available: your computer hard drive and the Arch Linux installation disc. To check the status of the drives:
- Type fdisk -l and press Enter;
- Find the name of the largest hard drive on the results screen. The name will look like "/ dev / sda" and you can find it to the right of the "Disk" header.
Step 2. Open the Partitions page
Write cfdisk [drive name], making sure to replace [unit name] with the name of your hard drive, then press Enter, select DOS and press Enter again.
For example, if the disk is named "/ dev / sda", you should write cfdisk / dev / sda in the terminal
Step 3. Delete the contents of the hard drive
Select one of the partitions in the center of the screen, go to Cancel in the middle, hit Enter and repeat for all other partitions. At the end there should be only one line left: Pri / Log Free Space.
Step 4. Create a "swap" partition
This will act as RAM for Arch Linux. To do it:
- Go up New and press Enter;
- Go up Primary and press Enter;
- Type a number in megabytes (e.g. 1024 for a gigabyte) and press Enter. As a general rule, you should create a swap partition that is two to three times the size of your system's RAM (for example, if you have 4GB of RAM, the partition should be 8192 or 12288MB).
- Go up End and press Enter.
Step 5. Create the primary partition of the hard drive
It will be the one where you will install the Arch Linux operating system, where you will save the files and other information. To do it:
- Make sure you have selected the partition Pri / Log Free Space;
- Go up New and press Enter;
- Go up Primary and press Enter;
- Make sure the number next to the "Size (in MB)" header is correct;
- Press Enter;
- Select the primary partition again;
- Select Bootable and press Enter.
Step 6. Label the "swap" partition
This will configure it as system RAM:
- Select the "swap" partition;
- Go up Type and press Enter;
- Type 82 and press Enter;
- Without deselecting the "swap" partition, go up Write and press Enter;
- Type yes and press Enter.
Step 7. Write down the partition names
In the "Name" column on the left side of the screen, you should see a name (eg "sda1") next to the "swap" partition and a similar one (eg "sda2") next to the primary one. You will need both of these names to format the partitions.
Step 8. Close the "cfdisk" utility
To do this, go up Quit and press Enter.
Step 9. Format the primary partition
This way the operating system can use it. To do this, type mkfs.ext4 / dev / [primary partition name] and press Enter.
If the partition has the name "sda2", type mkfs.ext4 / dev / sda2
Step 10. Mount the formatted partition
Type mount / dev / [partition name] / mnt and press Enter. This operation makes the partition a usable drive.
Step 11. Add a swap file to the "swap" partition
Type mkswap / dev / [partition name] and press Enter, then type swapon / dev / sda1 and press Enter again. After completing this step, you can move on to installing Arch Linux.
For example, if your "swap" partition has the name "sda1", type mkswap / dev / sda1 then swapon / dev / sda1
Part 3 of 3: Install Arch Linux
Step 1. Set up the Wi-Fi connection
If your computer is connected to the router via ethernet, you can skip this step. Using ethernet is a better choice than Wi-Fi.
- Type ip link and press Enter to determine the interface name of your network adapter;
- Type pacman -S iw wpa_supplicant and press Enter to install the necessary software;
- Type pacman -S dialog and press Enter to install the Wi-Fi menu;
- Type pacman -S wpa_actiond and press Enter to install the software that allows you to automatically connect to known networks;
- Type systemctl enable netctl-auto @ interface name.service to enable the auto connect service for your wireless network adapter;
- At the next start, type wifi-menu interface name to access your adapter's wireless menu. Once you have connected to a network for the first time, in the future this will be automatic on every boot. Do not enter this command now or you will lose access to your network.
Step 2. Install the base system
Type pacstrap / mnt base base-devel and press Enter. This will start the installation of the system.
This usually takes about 15-30 minutes depending on the speed of your internet connection
Step 3. Open the open "chroot"
Type arch-chroot / mnt and press Enter. This allows you to change the root directory configuration, including the password.
Step 4. Choose a password
You will use it to log into your root account. To do it:
- Type passwd and press Enter;
- Type in a password and press Enter;
- Repeat the same password and press Enter.
Step 5. Choose your language
To do it:
- Type nano /etc/locale.gen and press Enter;
- Scroll down until you find your preferred language;
- Select the letter directly in front of the "#" symbol next to your language and press Delete;
- Remove the "#" symbol for all other versions of your language (for example all versions of "it_IT");
- Press Ctrl + O (or ⌘ Command + O on a Mac), then press Enter;
- Exit by pressing Ctrl + X or ⌘ Command + X;
- Type locale-gen and press Enter to complete the language setup.
Step 6. Choose a time zone
To do it:
- Write cd usr / share / zoneinfo and press Enter;
- Type ls and press Enter;
- Find your country or region, then type cd usr / share / zoneinfo / nation (for example Italy) and press Enter;
- Type ls again and press Enter;
- Find your time zone, then type ln -s / usr / share / zoneinfo / country / time zone / etc / localtime and press Enter.
Step 7. Assign a host name to your computer
Type echo name> / etc / hostname and press Enter.
For example, if you want to name your computer "Panda", type echo Panda> / etc / hostname
Step 8. Download the GRUB bootloader
This is the program that will install Arch Linux. To do it:
- Type pacman -S grub-bios and press Enter;
- Type y and press Enter;
- Wait for the GRUB download to finish.
Step 9. Install GRUB
When you do this, make sure you install it on the real hard drive (eg "sda") and not the partition (eg "sda1"). To do it:
Type grub-install / dev / drive name (e.g. grub-install / dev / sda and press Enter
Step 10. Create an "init" file
Inside this file information about your computer's hardware is saved, so that Linux can use it. To create it, type mkinitcpio -p linux and press Enter.
Step 11. Create a configuration file for GRUB
To do this, type grub-mkconfig -o /boot/grub/grub.cfg and press Enter.
Step 12. Create an "fstab" file
Type genfstab / mnt >> / mnt / etc / fstab and press Enter. This way Arch Linux will be able to identify the file systems of your partitions.
Step 13. Restart your computer
To do this, type umount / mnt and press Enter, then type reboot, press Enter, eject the installation disk and wait for the boot procedure to finish.
Step 14. Log into your account
Type root in the "login" field and press Enter, then type your password and press Enter. Congratulations, you have successfully installed and opened Arch Linux on your computer!