What You Will Need
- Open Disk Utility -> press the keys
Command + space
and type "Disk Utility" into spotlight search. - Press
Enter
orReturn
on your keyboard depending on your keyboard. - Click on the disk "Macintosh HD".
- Once you have clicked on Macintosh HD at the top of the window, click Parition.
- Select the Amount of space you want to give Linux, give the Parition a Label, then press apply.
NOTE: If you would like to see a more detailed guide, see Apple's guide to partitioning your disk.
- Download a Wi-Fi enabled ISO here.
- Once the ISO has installed open Terminal.
- You can do this my pressing
Command + space
and typing "Terminal" then pressingEnter
on your keyboard.
- In your newly opened Terminal window run the command:
diskutil list
- Your USB device will appear as something like
/dev/disk2 (external, physical)
. Verify that this is the device you want to erase by checking its name and size and then use its identifier for the commands below instead of/dev/diskX
.
- A USB device is normally auto-mounted in macOS, and you have to unmount (not eject) it before block-writing to it with dd. In Terminal, do:
diskutil unmountDisk /dev/diskX
- Now copy the ISO image file to the device. The dd command is similar to its Linux counterpart, but notice the 'r' before 'disk' for raw mode which makes the transfer much faster:
dd if=path/to/archlinux-version-x86_64.iso of=/dev/rdiskX bs=1m
- Restart your Mac, then press and hold Command (⌘)-R immediately after you see the Apple logo. Your Mac starts up from macOS Recovery.
- When you're asked to select a user you know the password for, select the user, click Next, then enter their administrator password.
- When you see the macOS utilities window, choose
Utilities > Startup Security Utility
from the menu bar. - When you're asked to authenticate, click Enter macOS Password, then choose an administrator account and enter its password.
- Select No Security for Secure Boot, and Allow Boot Media
NOTE: For a more detailed guide follow Apple's guide to startup security.
- Plug the Bootable USB you created earlier in step 2
- Boot while holding the Option key (⌥), this will put you in macOS Startup Manager.
- Select the orange EFI option with arrow keys and press return/enter on it.
Connecting to Wifi with Network Manager
Connecting through CLI
- List nearby Wi-Fi networks by running:
nmcli device wifi list
- Connecting to your Wi-Fi by running the following command:
NOTE: Replace WifiName with your Wi-Fi network's name, and WifiPassword with the corresponding password.
nmcli device wifi connect WifiName password WifiPassword
Connecting through TUI
- First, run the command:
nmtui
- This will bring you into a Text-Based User Interface, (that's what TUI stands for if you're wondering)
-
Use your arrow keys to navigate to
Activate a Connection
, once it is highlighted red, press 'enter' or 'return' on your keyboard. -
You wil be greeted to a screen listing local Wi-Fi devices, from here navigate to your Wi-Fi's label, and press 'enter' on your keyboard.
-
Once you have clicked 'enter' on your Wi-Fi label, you will be greeted to a password prompt, from here, enter your Wi-Fi's password and navigate to the
<OK>
label. -
From here, you can navigate to
<Back>
and then<Quit>
, you should now be connected to Wi-Fi.
- Once you are connected, test your connection by pinging a domain, for example:
ping archlinux.org
- If it is successful, press
ctrl + c
on your keyboard, and move on to the next step.
For more help see the documentation.
Updating your System Clock
- Run the command:
timedatectl set-ntp true
to test these changes run timedatectl status
, make sure the minutes correspond to an accurate clock.
- To view your disk partitions run:
lsblk
NOTE: The Arch Wiki mentions the EFI system partition, there will be one at /dev/nvme0n1p1
-
Find the name of the partition that is roughly ~7 GiB's less than the partition your created on your disk at the start of this guide. For example:
nvme0n1p3 8:3 0 82.9G 0 part
-
Once you have found your partition run the following command:
gdisk /dev/yourPartition
NOTE: Replace yourPartition
in the command above with the partition you created for Linux.
- You will see the prompt
Command (? for help):
type 'N' then press 'enter' or 'return' on your keyboard. - To the next following prompts simply press enter, do not type anything
- When you are given the prompt
Do you want to proceed? (Y/N):
type 'Y' and then press 'enter' or 'return' on your keyoard.
- Clear your terminal (type "clear" and press enter) and run the command
lsblk
- Find the name of the partition that is roughly ~7 GiB's less than the partition your created on your disk at the start of this guide. For example:
nvme0n1p3 259:3 0 83.8G 0 part
- Run the following command to format it:
mkfs.ext4 /dev/yourPartition
NOTE: Replace yourPartition
in the command above with the partition you created for Linux.
- Respond 'Y' to the following prompts.
- The Arch Wiki mentions the EFI system partition, there will be one at
/dev/nvme0n1p1
- To format this partition run:
mkfs.fat -F 32 /dev/nvme0n1p1
For more info see the documentation.
- Mounting your main partition to the
/mnt
directory:
mount /dev/yourPartition /mnt
NOTE: Replace yourPartition
in the command above with the partition you created for Linux.
- Making your
/mnt/boot/efi
directory:
mkdir -p /mnt/boot/efi
- Mounting your EFI partition to
/mnt/boot/efi
mount /dev/nvme0n1p1 /mnt/boot/efi
For more info see the documentation
- Use the pacstrap script to install the base package, Linux kernel and firmware for common hardware:
- Note: Remove the grub efibootmgr packages from this if you intend to use systemd-boot as your bootloader.
pacstrap /mnt base linux-t2 linux-t2-headers linux-t2-docs apple-bcm-wifi-firmware dkms linux-firmware iwd grub efibootmgr vim intel-ucode networkmanager
Generate an fstab file (use -U or -L to define by UUID or labels, respectively):
genfstab -U /mnt >> /mnt/etc/fstab
Make sure the informating is correct by running cat /mnt/etc/fstab
Entering the Root (Chroot)
- If you wish to exit chroot, you can press
cntrl + d
on your keyboard, or typeexit
arch-chroot /mnt
Making a Swap File
- While in chroot, (command to enter:
arch-chroot /mnt
) run the following commands: - The command below will create a 2 GiB swap file, to edit the size, change the value
count
which is equal to 2 in the example.
dd if=/dev/zero of=/swapfile bs=1G count=2 status=progress
You must be in Chroot when making your swapfile.
- Setting the swapfile's permissions
chmod 600 /swapfile
- After creating the swapfile, format it to swap:
mkswap -U clear /swapfile
- Activating the swapfile:
swapon /swapfile
- Finally, edit your fstab file to account for your swapfile
- The command below will enter your into a text editor called vim
vim /etc/fstab
- Once you are editing the fstab file, go to the bottom line with the arrow keys, press I and type:
/swapfile none swap defaults 0 0
- To exit vim press "escape" on your keyboard, followed by typing
:wq
followed by pressing "enter", this wil save the file and exit.
Example
# Static information about the filesystems.
# See fstab(5) for details.
# <file system> <dir> <type> <options> <dumb> <pass>
# /dev/example
UUID=example / ext4 rw,relatime 0 1
# /dev/eaxmple LABEL=EFI
UUID=example /boot/efi vfat rw,relatime,fmask=example,dmask=example,codepage=example,iocharset=isoExample,shortname=example,utf8,errors=remount-ro 0 2
/swapfile none swap defaults 0 0
- Replace Region and City with your location corresponding to the titles.
- To see time zones you can run
cat /usr/share/zoneinfo | grep yourCountriesName
ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
- Run
hwclock
to generate/etc/adjtime
:
hwclock --systohc
Note: This command assumes the hardware clock is set to UTC. See System time#Time standard for details.
- Edit
/etc/locale.gen
and uncommenten_US.UTF-8 UTF-8
, and other needed locales. You can edit by running: - To uncomment, delete the
#
before the line of text.
vim /etc/locale.gen
- Once you have uncommented, press "escape" on your keyboard, then type
:wq
, followed by pressing enter.
Once you have saved the file, you can generate the locales by running:
locale-gen
- You will also need to make a
locale.conf
, to do this running:
echo LANG=en_US.UTF-8 >> /etc/locale.conf
-
If you use a US keyboard, you can skip this step.
-
If you need to set the console keyboard layout from the US default, make the changes persistent vconsole.conf(5) by following the nest steps:
echo KEYMAP=your-keymap >> /etc/vconsole.conf
Create the hostname file:
- Your host name will be the name of your computer, ex.
user@hostname
echo yourHostName >> /etc/hostname
-
Creating your hosts file:
-
To enter a text editor to edit the file run:
vim /etc/hosts
- Once you are editing the text file, you will enter the following:
127.0.0.1 localhost
::1 localhost
127.0.1.1 yourHostName.localdomain yourHostName
- To exit vim press 'escape' on your keyboard, followed by typing
:wq
followed by pressing 'enter', this wil save the file and exit.
NOTE: Replace yourHostName with the host name you created in the step above.
Example
# Static table lookup for hostnames.
# See hosts(5) for more details.
127.0.0.1 localhost
::1 localhost
127.0.1.1 Macbook-Air.localdomain Macbook-Air
- You can set the root password by running the following command:
passwd
- You will be greated with a prompt to enter your password, and then verify it, pick a secure password for your root.
Adding a User
-
To add a user you must run:
-
Replace yourUserName with any name of your choice, you will use this name to log in later.
useradd -mG wheel yourUserName
- Adding a password to your user:
passwd yourUserName
- You will be greated with a prompt to enter your password, and then verify it
Setting up Sudo
- First you must install sudo by running:
pacman -S sudo
- Once sudo is installed, you must add your user to the sudoers file, you can do this by editing it.
EDITOR=vim visudo
- Once you have entered vim, find the uncommented line
root = ALL=(ALL) ALL
3 lines below this line will be a commented line# %wheel ALL=(ALL:ALL) ALL
, you will need to uncomment this.
What this should look like
##
## User privilege specification
##
## Uncomment to allow members of group wheel to execute any command
%wheel ALL=(ALL:ALL) ALL
- To exit vim press "escape" on your keyboard, followed by typing
:wq
followed by pressing "enter", this wil save the file and exit.
- To test if sudo works, switch to your user:
su userName
- Once you have switched to your user, you can test a sudo command by running:
sudo echo test
-
You will be greeted with a password prompt, enter your password and press 'enter' on your keyboard.
-
If
test
is outputted in your terminal followed by entering your password, sudo works, and you can move on to the next step.
Enabling Services and Daemons with systemd
- To enable NetworkManager
systemctl enable NetworkManager
- If you installed any other services, you can enable them with
systemctl enable serviceName
Setting up GRUB
GRUB(GRand Unified Bootloader) is a boot loader, this bootloader provides an inferface to load into operating systems or applications.
- You will need to edit
/etc/default/grub
, you can edit the text file by running:
vim /etc/default/grub
- Near the top, find the line:
GRUB_CMDLINE_LINUX=""
, from here you will need to add the following text to the quotes. Add:
intel_iommu=on iommu=pt pcie_ports=compat
Example
# GRUB boot loader configuration
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX="intel_iommu=on iommu=pt pcie_ports=compat"
- To exit vim press 'escape' on your keyboard, followed by typing
:wq
followed by pressing 'enter', this wil save the file and exit.
- Installing GRUB for x86_64-efi:
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB --no-nvram --removable
- Making your Config:
grub-mkconfig -o /boot/grub/grub.cfg
- Configuring
nvram
andefivars
- We are making our nvram/efivars automatically remount as readonly, as writing to them causes a panic.
echo efivarfs /sys/firmware/efi/efivars efivarfs ro,remount,nofail 0 0 >> /etc/fstab
- If this doesn't work, you can instead add the
efi=noruntime
kernel parameter as described when installing your bootloader, however, do NOT use both kernel parameters at the same time.
- Once you have followed all the intrusctions above you will need to exit root, you can do this by pressing
cntrl + d
on your keyboard, or using the command:
exit
- Once you have exited root, unmount all your partitions by running:
umount -a
- Once you have unmounted your partitions, you can reboot and remove your USB drive from your machine, you can reboot by running:
reboot
- You will be greeted with the GRUB UI, navigate to Arch Linux with your arrow keys, and press 'enter' once it is highlighted.
-
You will be greeted with
Hostname login:
, enter the username that you picked earlier, follow that by pressing 'enter' or 'return' on your keyboard. -
You will then be greeted with
password
, enter your password, follow that by pressing 'enter' or 'return' on your keyboard
Congrats, you're now in Arch Linux. 🎉