In this article, you will learn how to replace your computer's current operating system with Arch Linux, which is a Linux distribution. Arch Linux can be installed on Windows and Mac OS X computers.
Part 1 of 3: How to Run the Installer
Step 1. Create a backup copy of the data stored on your computer and copy it to an external hard drive
The current operating system will be deleted, so back up important data.
Step 2. Download the Arch installer
Arch Linux can be downloaded as an image (ISO file) that can be burned to a blank DVD and opened on a computer. To download an image:
- Install the BitTorrent or uTorrent torrent client on your computer;
- open the page https://www.archlinux.org/download/ in a browser;
- in the "BitTorrent" section click on the "Torrent" link;
- open the downloaded torrent file in a BitTorrent or uTorrent torrent client;
- wait for the Arch Linux ISO file to download to your computer.
Step 3. Burn the downloaded image to a blank DVD
Once the Arch Linux image is downloaded, burn it to a blank DVD using your computer's optical drive. When the disc is finished, leave it in the drive.
If your computer does not have a DVD drive, buy an external optical drive and connect it to your computer using a USB cable
Step 4. Restart your computer
On your Mac, open the Apple menu, click System Preferences> Boot> External Drive> Restart, and then click Restart again when prompted
Step 5. Press the key that will enter the BIOS and change the primary boot device
On most modern computers this is the F12 key, but the exact key is displayed on the screen when the computer boots up. If you cannot find a key on the screen, press F1, F2, F10, or Del.
Skip this step on a Mac
Step 6. Select the installation DVD as your primary boot device
From the menu, highlight the appropriate option, such as DVD Drive or Disk Drive, and then press the + key until it is at the top of the menu.
- Skip this step on a Mac.
- On some computers, go to the Advanced or Boot Options tab first.
Step 7. Save your changes and exit BIOS
To do this, press the corresponding key, which is displayed at the bottom of the screen or in the lower right corner of the screen. The computer will restart.
Skip this step on a Mac
Step 8. Select Boot Arch Linux (Start Arch Linux) and click ↵ Enter.
The Arch Linux installer will launch; the hard drive can now be partitioned.
Part 2 of 3: How to create partitions
Step 1. Check the connected drives
At the moment, at least two drives are connected to the computer: a hard drive and an Arch Linux installer DVD. To check the connected drives:
- type fdisk -l and press ↵ Enter;
- find the name of the disk with the largest capacity; the name is similar to “/ dev / sda” and is located to the right of “Disk”.
Step 2. Open the section information page
Type cfdisk [disk name], substitute the hard disk name for [disk name], then press ↵ Enter. Now select "DOS" and press ↵ Enter again.
For example, if the drive name is / dev / sda, enter cfdisk / dev / sda in a terminal
Step 3. Delete the contents of the hard drive
Select a section (in the middle of the screen), then select "Delete" (at the bottom of the screen), and then press ↵ Enter; repeat the above steps for any section that appears in the middle of the screen. As a result, Pri / Log Free Space should appear on the screen.
Step 4. Create a swap partition
This section will act as a random access storage device for the Arch Linux system. For this:
- select “New” and press ↵ Enter;
- select “Primary” and press ↵ Enter;
- enter the number of megabytes (for example, 1024 for one gigabyte) and press ↵ Enter; as a rule, the size of the swap partition should be 2-3 times the size of the RAM (for example, if the computer's RAM is 4 GB, the swap partition should be 8192 MB or 12288 MB);
- select “End” and press ↵ Enter.
Step 5. Create a primary hard disk partition
This section will store the Archix operating system files and other information. For this:
- select the Pri / Log Free Space section;
- select “New” and press ↵ Enter;
- select “Primary” and press ↵ Enter;
- make sure the number on the "Size (in MB)" line is correct;
- press ↵ Enter;
- select the primary partition again;
- select “Bootable” and press ↵ Enter.
Step 6. Mark the swap partition
So it will turn into an analogue of the system's RAM:
- select the swap partition;
- select “Type” and press ↵ Enter;
- type 82 and press ↵ Enter;
- if the swap partition is still highlighted, select “Write” and press ↵ Enter;
- type yes and press ↵ Enter.
Step 7. Make a note of the section names
In the Name column on the left side of the screen, look for a name for the swap partition (for example, "sda1") and for the primary partition (for example, "sda2"). You will need names to format your partitions.
Step 8. Close the cfdisk utility
Select “Quit” and press ↵ Enter.
Step 9. Format the primary partition
This way you can use it in the operating system. To do this, enter mkfs.ext4 / dev / [primary partition name] and press ↵ Enter.
For example, if the primary partition name is "sda2", enter mkfs.ext4 / dev / sda2
Step 10. Mount the formatted partition
Type mount / dev / [partition name] / mnt and press ↵ Enter. The section will become a disk that you can work with.
Step 11. Add the swap file to the swap partition
Type mkswap / dev / [partition name] and press ↵ Enter, then type swapon / dev / [partition name] and press ↵ Enter. Now you can install Arch Linux.
For example, if the name of the swap partition is "sda1", enter mkswap / dev / sda1, and then enter swapon / dev / sda1
Part 3 of 3: How to Install Arch Linux
Step 1. Connect to a wireless (Wi-Fi) network
If your computer is connected to the router with an Ethernet cable, skip this step because a wired connection is preferred over a wireless one.
- type ip link and press ↵ Enter to determine the name of the network interface of the network adapter;
- type pacman -S iw wpa_supplicant and press ↵ Enter to install the required software;
- type pacman -S dialog and press ↵ Enter to install the wireless adapter menu;
- type pacman -S wpa_actiond and press ↵ Enter to install software that will automatically connect to known networks;
- enter systemctl enable [email protected]_name.service to enable the wireless adapter auto-connect service;
- The next time you restart your computer, enter wifi-menu interface_name to open the wireless adapter menu. When you first connect to the network, subsequent connections (after restarting / turning on the computer) will occur automatically. Do not enter this command at this stage; otherwise, you will lose access to the network.
Step 2. Install the base system
Type pacstrap / mnt base base-devel and press ↵ Enter. The installation of the system to your computer starts.
Typically, this process takes about 15-30 minutes, depending on the speed of your Internet connection
Step 3. Open access to the root directory
Type arch-chroot / mnt and press ↵ Enter. Now you can change the parameters of the root directory, including the password.
Step 4. Set a password
You will use this password to log into the administrator account (root account). For this:
- type passwd and press ↵ Enter;
- enter the password and press ↵ Enter;
- re-enter the password and press ↵ Enter.
Step 5. Select the system language
- type nano /etc/locale.gen and press ↵ Enter;
- scroll down and select the language you want;
- highlight the letter immediately before the “#” symbol (behind the required language) and press Del;
- remove the "#" symbol from other versions of the language (for example, all versions of "ru_RU");
- press Ctrl + O (or ⌘ Command + O on a Mac) and then press ↵ Enter;
- exit by pressing Ctrl + X or ⌘ Command + X;
- type locale-gen and press ↵ Enter to complete the language setting.
Step 6. Select your time zone
- type cd usr / share / zoneinfo and press ↵ Enter;
- type ls and press ↵ Enter;
- find your country or region and then enter cd usr / share / zoneinfo / country (for example Russia) and press ↵ Enter;
- type ls again and press ↵ Enter;
- find the time zone you want and then type ln -s / usr / share / zoneinfo / country / time zone / etc / localtime and press ↵ Enter.
Step 7. Provide a hostname for your computer
To do this, type echo name> / etc / hostname and press ↵ Enter.
For example, to name the computer "Panda", enter echo Panda> / etc / hostname
Step 8. Download the GRUB bootloader
This is the program that will install Arch Linux. For this:
- type pacman -S grub-bios and press ↵ Enter;
- type y and press ↵ Enter;
- wait for GRUB to download.
Step 9. Install GRUB
Make sure to install GRUB to your hard drive (eg "sda") and not to a partition (eg "sda1"). To install GRUB:
Type grub-install / dev / drive name (e.g. grub-install / dev / sda) and press ↵ Enter
Step 10. Create a file "init"
It stores information about the computer hardware, that is, using this file, the system will be able to work with computer components. Type mkinitcpio -p linux and press ↵ Enter.
Step 11. Create a configuration file for GRUB
Type grub-mkconfig -o /boot/grub/grub.cfg and press ↵ Enter.
Step 12. Create a file "fstab"
Type genfstab / mnt >> / mnt / etc / fstab and press ↵ Enter. This will allow Arch Linux to identify the file systems of the partition.
Step 13. Restart your computer
Type umount / mnt and press ↵ Enter, then type reboot and press ↵ Enter. Remove the DVD and wait for the computer to restart.
Step 14. Log in to your account
Type root in the "login" line and press ↵ Enter, then type in your password and press ↵ Enter. You have now successfully installed and launched Arch Linux on your computer.