How to Install Arch Linux: Difference between revisions

From Chaz Wiki
Jump to navigation Jump to search
Still not done yet, but i'm getting bored
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 10: Line 10:
Use the command <code>fdisk -l</code> to list the drives. You should see something like <code>/dev/sda</code> or <code>/dev/nvme0n1</code>, that's your hard drive/ssd that you can install onto. Then enter <code>fdisk /dev/the_disk_to_be_partitioned</code> but replace the ''/dev/the_disk_to_be_partitioned'' with your disk. Now is where you deviate depending on if you have a bios or uefi system.
Use the command <code>fdisk -l</code> to list the drives. You should see something like <code>/dev/sda</code> or <code>/dev/nvme0n1</code>, that's your hard drive/ssd that you can install onto. Then enter <code>fdisk /dev/the_disk_to_be_partitioned</code> but replace the ''/dev/the_disk_to_be_partitioned'' with your disk. Now is where you deviate depending on if you have a bios or uefi system.
==UEFI format==
==UEFI format==
When you run fdisk press ''g'' to make the partition table GPT and then press ''n'' to make a new partition. Make a 1 gigabyte (by typing ''1g'') for the UEFI boot partition. Make another partition at least 4 gigs in space for a {{color|#ff00ff|swap}} partition (basically more ram) and 1 final partition that uses the rest of the disc for actual space by just pressing enter when asked for a size. Press ''t'' to change the type of a partition. Use the EFI Partition type for the 1gb partition. ''Linux {{color|#ff00ff|swap}}'' for the 4gb+ partition for {{color|#ff00ff|swap}}. ''Linux x86_64 root (/)'' for the rest of the drive. Save the changes and exit with ''w''.
When you run fdisk press ''g'' to make the partition table GPT and then press ''n'' to make a new partition. Make a 1 gigabyte (by typing ''+1G'') for the UEFI boot partition. Make another partition at least 4 gigs in space for a {{color|#ff00ff|swap}} partition (basically more ram) and 1 final partition that uses the rest of the disc for actual space by just pressing enter when asked for a size. Press ''t'' to change the type of a partition. Use the EFI Partition type for the 1gb partition. ''Linux {{color|#ff00ff|swap}}'' for the 4gb+ partition for {{color|#ff00ff|swap}}. ''Linux x86_64 root (/)'' for the rest of the drive. Save the changes and exit with ''w''.
==BIOS format==
==BIOS format==
When you run fdisk press ''m'' for an mbr partition or ''g'' for a gpt partition. It depends which one you want to use (both are fine, but gpt is easier). Press ''n'' for a new partition and press ''p'' if you are using mbr. Make a partition that's at least 4 gigabytes for {{color|#ff00ff|swap}} (basically extra ram) by typing 4g and another one that takes up the entire rest of the drive by pressing enter when asked for the rest of the drive. Press ''t'' to change the type of the type of the partitions, ''Linux {{color|#ff00ff|swap}}'' for the 4gig partition and ''Linux'' for the other partition. Save and exit by pressing ''w''
When you run fdisk press ''m'' for an mbr partition or ''g'' for a gpt partition. It depends which one you want to use (both are fine, but gpt is easier). Press ''n'' for a new partition and press ''p'' if you are using mbr. Make a partition that's at least 4 gigabytes for {{color|#ff00ff|swap}} (basically extra ram) by typing +4G and another one that takes up the entire rest of the drive by pressing enter when asked for the rest of the drive. Press ''t'' to change the type of the type of the partitions, ''Linux {{color|#ff00ff|swap}}'' for the 4gig partition and ''Linux'' for the other partition. Save and exit by pressing ''w''.


=The Format and Mounting=
=The Format and Mounting=
Line 19: Line 19:
=Actually Installing=
=Actually Installing=
The last section sucked to write and now it's time to install Arch Linux by doing <code>pacstrap -K /mnt base linux linux-firmware</code> and also adding some other stuff to that command like <code>nano</code> for a easy to use text editor, because you'll need one. Also add dhcpcd to the command so you won't need to boot back into the installer again. Why yes i have done that before, it sucks. You also might need to add microcode for your cpu (amd-ucode and inter-ucode depending on your cpu), any firmware not in the <code>linux-firmware</code> package (sof-firmware for onboard audio, linux-firmware-marvell for marvell internet packages, etc.), and iwd for wi-fi. Did i just add that to pimp up this section? Yes, but it's infomational.
The last section sucked to write and now it's time to install Arch Linux by doing <code>pacstrap -K /mnt base linux linux-firmware</code> and also adding some other stuff to that command like <code>nano</code> for a easy to use text editor, because you'll need one. Also add dhcpcd to the command so you won't need to boot back into the installer again. Why yes i have done that before, it sucks. You also might need to add microcode for your cpu (amd-ucode and inter-ucode depending on your cpu), any firmware not in the <code>linux-firmware</code> package (sof-firmware for onboard audio, linux-firmware-marvell for marvell internet packages, etc.), and iwd for wi-fi. Did i just add that to pimp up this section? Yes, but it's infomational.
=Configuring the System so it doesn't explode=
First, make a fstab (file system thing) by doing <code>genfstab -U /mnt >> /mnt/etc/fstab</code> then go into the system to do more configuring by typing <code>arch-chroot /mnt</code> (i love arch-chroot). Add the time zone by doing <code>ln -sf /usr/share/zoneinfo/Region/City /etc/localtime</code> but replace the ''Region'' and ''City'' with your Region and City, or closed city (for me it's America/Chicago, even though i live in minnesota). Type this to sync the time with the bios/uefi: <code>hwclock --systohc</code>. Then run <code>locale-gen</code> and un comment (remove the #'s) with your needed locales (like for me it's en_US.UTF-8)(you only need to uncomment the
UTF-8 ones)(also you do NEED en_US.UTF-8). Edit the <code>/etc/locale.conf</code> file with a text editor and add the line <code>LANG=en_US.UTF-8</code> i don't know why you need en_US.UTF-8, you just need it. Set the hostname (aka computer name) by editing <code>/etc/hostname</code> with a text editor and adding it in there. Then set the root password (basically the admin account's password) by doing <code>passwd</code>, then install Grub.
==The Grub Special==
You may install other boot loaders, but grub is like ext4, the default. Install grub (and efibootmgr if you have a uefi system) by doing <code>pacman -S grub (efibootmgr goes here aswell)</code> and then do <code>grub-install --target=x86_64-efi --efi-directory=esp --bootloader-id=GRUB</code> (replace ''esp'' with the efi directory) if you're running uefi and do <code>grub-install --target=i386-pc /dev/sdX</code> but replace <code>sdX</code> with the name of the drive (not partition, the hard drive/ssd location) with bios and mbr. With bios and gpt, it's more complicated because you need to enter fdisk and create another partition with a size of 1 megabyte (type ''+1M'') and type of ''BIOS boot'' anywhere on the drive. Then you can enter <code>grub-install --target=i386-pc /dev/sdX</code> (do the sdX replacement) to install grub.
==Reboot==
Type ''exit'' to exit the chroot, then do reboot to reboot
=Pimp your Arch=
When you boot, you might need to start dhcpcd, do that by entering in <code>systemctl enable dhcpcd.service && systemctl start dhcpcd.service</code> to start it-ish. You'll probably need an actual user that's not root, do <code>useradd username</code> and substitute the username with the username you want and do <code>passwd username</code> to set the password to the username that you also need to substitute in this command. That's the only other thing you need. You can do anything, but you'll probably need a gui. There's a bunch of them but there's like 4 main ones: gnome, kde, xfce, and lxqt. Look them up and install the one you like better. Install a tiling window manager if you hate yourself. Do anything you like! Just don't destroy the system.


[[Category:How to]]
[[Category:How to]]

Latest revision as of 13:52, 30 May 2025

Here's how

Before Install

Back up EVERYTHING to something, like a usb hard drive/usb ssd thing. Use balena etcher or rufus to flash the arch linux installer onto a usb drive, NOT your back up medium. In fact you shouldn't have the medium you used to back up your system plugged in at all during the install.

Before Formatting

First, check if your system is a uefi system by entering cat /sys/firmware/efi/fw_platform_size into the terminal. If it's either 32 or 64, you're using UEFI. If it doesn't exist, you're not. Enter ip link to figure out if you have internet. It it says DOWN then follow the next steps. If you're using Wi-Fi enter iwctl device list then iwctl --passphrase passphrase station name connect SSID and replace passphrase with your wifi password, name with the device from device list and SSID with your WiFi name. Check if the network works by pinging a website, like this one, with ping paxtonpenguin.com. Then enter timedatectl to set the clock. You should be ready to format the hard drive.

Using fdisk

Use the command fdisk -l to list the drives. You should see something like /dev/sda or /dev/nvme0n1, that's your hard drive/ssd that you can install onto. Then enter fdisk /dev/the_disk_to_be_partitioned but replace the /dev/the_disk_to_be_partitioned with your disk. Now is where you deviate depending on if you have a bios or uefi system.

UEFI format

When you run fdisk press g to make the partition table GPT and then press n to make a new partition. Make a 1 gigabyte (by typing +1G) for the UEFI boot partition. Make another partition at least 4 gigs in space for a swap partition (basically more ram) and 1 final partition that uses the rest of the disc for actual space by just pressing enter when asked for a size. Press t to change the type of a partition. Use the EFI Partition type for the 1gb partition. Linux swap for the 4gb+ partition for swap. Linux x86_64 root (/) for the rest of the drive. Save the changes and exit with w.

BIOS format

When you run fdisk press m for an mbr partition or g for a gpt partition. It depends which one you want to use (both are fine, but gpt is easier). Press n for a new partition and press p if you are using mbr. Make a partition that's at least 4 gigabytes for swap (basically extra ram) by typing +4G and another one that takes up the entire rest of the drive by pressing enter when asked for the rest of the drive. Press t to change the type of the type of the partitions, Linux swap for the 4gig partition and Linux for the other partition. Save and exit by pressing w.

The Format and Mounting

You could use other formats for the main drive (which if you're following this guide should be either /dev/whatever3 for uefi and /dev/whatever2 for bios, except don't actually use the word whatever in the commands), but ext4 is the default and best option. Type mkfs.ext4 /dev/root_partition and replace root_partition with that partition that took up the test of the drive (/dev/whatever3 or /dev/whatever2). mkswap /dev/swap_partition for the swap partition (i'm not making it pink in code parts). If you have a uefi partition, make the 1gb partition fat32 by doing mkfs.fat -F 32 /dev/efi_system_partition and replace efi_system_partition with /dev/whatever1 or whatever the partition is. Mount the root partition with mount /dev/root_partition /mnt and also replace the root_partition with whatever you replaced the other r_p with. Mount the uefi partition with mount --mkdir /dev/efi_system_partition /mnt/boot and replace the e_s_p thing with the uefi partition. Finally add the swap with swapon /dev/swap_partition and replace s_p with the actual partition.

Actually Installing

The last section sucked to write and now it's time to install Arch Linux by doing pacstrap -K /mnt base linux linux-firmware and also adding some other stuff to that command like nano for a easy to use text editor, because you'll need one. Also add dhcpcd to the command so you won't need to boot back into the installer again. Why yes i have done that before, it sucks. You also might need to add microcode for your cpu (amd-ucode and inter-ucode depending on your cpu), any firmware not in the linux-firmware package (sof-firmware for onboard audio, linux-firmware-marvell for marvell internet packages, etc.), and iwd for wi-fi. Did i just add that to pimp up this section? Yes, but it's infomational.

Configuring the System so it doesn't explode

First, make a fstab (file system thing) by doing genfstab -U /mnt >> /mnt/etc/fstab then go into the system to do more configuring by typing arch-chroot /mnt (i love arch-chroot). Add the time zone by doing ln -sf /usr/share/zoneinfo/Region/City /etc/localtime but replace the Region and City with your Region and City, or closed city (for me it's America/Chicago, even though i live in minnesota). Type this to sync the time with the bios/uefi: hwclock --systohc. Then run locale-gen and un comment (remove the #'s) with your needed locales (like for me it's en_US.UTF-8)(you only need to uncomment the UTF-8 ones)(also you do NEED en_US.UTF-8). Edit the /etc/locale.conf file with a text editor and add the line LANG=en_US.UTF-8 i don't know why you need en_US.UTF-8, you just need it. Set the hostname (aka computer name) by editing /etc/hostname with a text editor and adding it in there. Then set the root password (basically the admin account's password) by doing passwd, then install Grub.

The Grub Special

You may install other boot loaders, but grub is like ext4, the default. Install grub (and efibootmgr if you have a uefi system) by doing pacman -S grub (efibootmgr goes here aswell) and then do grub-install --target=x86_64-efi --efi-directory=esp --bootloader-id=GRUB (replace esp with the efi directory) if you're running uefi and do grub-install --target=i386-pc /dev/sdX but replace sdX with the name of the drive (not partition, the hard drive/ssd location) with bios and mbr. With bios and gpt, it's more complicated because you need to enter fdisk and create another partition with a size of 1 megabyte (type +1M) and type of BIOS boot anywhere on the drive. Then you can enter grub-install --target=i386-pc /dev/sdX (do the sdX replacement) to install grub.

Reboot

Type exit to exit the chroot, then do reboot to reboot

Pimp your Arch

When you boot, you might need to start dhcpcd, do that by entering in systemctl enable dhcpcd.service && systemctl start dhcpcd.service to start it-ish. You'll probably need an actual user that's not root, do useradd username and substitute the username with the username you want and do passwd username to set the password to the username that you also need to substitute in this command. That's the only other thing you need. You can do anything, but you'll probably need a gui. There's a bunch of them but there's like 4 main ones: gnome, kde, xfce, and lxqt. Look them up and install the one you like better. Install a tiling window manager if you hate yourself. Do anything you like! Just don't destroy the system.