# Install

## Disk

Boot Arch linux.

Check your disks.

```
fdisk -l
```

Create a partition.

```
fdisk /dev/sda
```

Hit `o` (letter o) to create a new DOS disklabel.

Hit `n` to create a new partition.

Hit `p` for primary partition.

You accept the defaults then.

Hit `w` to write your changes.

Create a filesystem.

```
mkfs.ext4 /dev/sda1
```

## Configure pacman

Check if you have internet.

```
ping google.com
```

If not, run:

```
dhcpcd
```

Sync pacman.

```
pacman -Syy
```

Install reflector.

```
pacman -S reflector
```

Backup your mirror list.

```
cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
```

Set mirrors form your country.

```
reflector -c "US" -f 12 -l 10 -n 12 --save /etc/pacman.d/mirrorlist
```

## Install

Mount the disk.

```
mount /dev/sda1 /mnt
```

Run `pacstrap`.

```
pacstrap /mnt base linux linux-firmware vim nano
```

Setup `fstab`.

```
genfstab /mnt >> /mnt/etc/fstab
```

Chroot.

```
arch-chroot /mnt
```

List available timezones.

```
timedatectl list-timezones
```

Set your timezone.

```
timedatectl set-timezone America/Sao_Paulo
```

Setup locale.

```
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
export LANG=en_US.UTF-8
```

Setup your hostname.

```
echo myarch > /etc/hostname
```

Create /etc/hosts file.

```
nano /etc/hosts
```

With the following content.

```
127.0.0.1	localhost
::1		localhost
127.0.1.1	myarch
```

Setup root password.

```
passwrd
```

Install grub.

```
pacman -S grub
grub-install /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
```

[Configure networking following the steps here](https://www.devops.buzz/public/arch-linux/network#connect-to-internet-on-boot).

Reboot.

```
exit
reboot
```

## References

<https://itsfoss.com/install-arch-linux/>

<https://www.howtoforge.com/tutorial/arch-linux-installation-with-xfce-desktop/>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.devops.buzz/public/arch-linux/install.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
