Difference between revisions of "User:A2WXH3i"

From ArchWiki
Jump to navigation Jump to search
(Blanked the page)
Tag: Blanking
 
(48 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Warning| This is a collection of '''unofficial''' Arch Linux installation guides written by myself.
 
  
This guide assumes basic knowledge of how to use GNU/Linux, the folder structure of a GNU/Linux system and how to use {{ic|VIM}} or {{ic|nano}} to edit text files.
 
 
Text in ''italics'' means you should replace the text with something appropriate to your install.}}
 
 
= Unofficial Arch Linux Installation Guide =
 
 
== Prerequisites (Pre-boot) ==
 
 
{{Note| Regardless of the installation you will be attempting these steps need to be followed.}}
 
 
Download [https://www.archlinux.org/download/ Arch Linux].
 
 
=== Verify ISO ===
 
 
{{Note| These next steps require either a system with GnuPG installed or an Arch Linux derivative e.g. Manjaro Linux.}}
 
 
Download the PGP signature and verify the ISO.
 
 
$ gpg --keyserver pgp.mit.edu --keyserver-options auto-key-retrieve --verify archlinux-''version''-x86_64.iso.sig
 
 
The following command can be used if using an Arch Linux derivative:
 
 
$ pacman-key -v archlinux-''version''-x86_64.iso.sig
 
 
=== Copy media to a USB ===
 
 
You can use the tool {{ic|dd}} to copy the ISO to the USB via the command line, alternatively you could use [https://www.balena.io/etcher/ Etcher] if you like a GUI.
 
 
Below is an example of how you can use {{ic|dd}} to copy the ISO to a USB.
 
 
# sudo dd if=archlinux-''version''-x86_64.iso of=/dev/sd''X'' status=progress
 
 
Once the ISO is copied to the USB boot to it.
 
 
== Prerequisites (Live USB) ==
 
 
{{Note| Use Shift+PageUp and Shift+PageDown to scroll in the TTY.}}
 
 
=== Keyboard Layout ===
 
 
If you need a keyboard layout that isn't US English use the command below to list possible keymaps.
 
 
# ls /usr/share/kbd/keymaps/**/*.map.gz
 
 
Set the keymap.
 
 
# loadkeys ''uk''
 
 
=== Verifying boot mode ===
 
 
# ls /sys/firmware/efi/efivars
 
 
{{Warning| If nothing is listed here, you are '''NOT''' in EFI mode.}}
 
 
=== Connecting to the internet ===
 
 
If using Wi-Fi use the command below.
 
 
# wifi-menu
 
 
If you are on a wired connection you should connect to the network automatically, if you don't use the command below.
 
 
# dhcpcd
 
 
Verifying internet connection.
 
 
# ping archlinux.org
 
 
=== Changing Mirrors ===
 
 
On another device visit the link below and generate mirror links for your country.
 
 
https://www.archlinux.org/mirrorlist/
 
 
Once you have generated mirrors edit the file shown below.
 
 
/etc/pacman.d/mirrorlist
 
 
Sync the newly added mirrors.
 
 
# pacman -Syyy
 
 
=== Syncing the clock ===
 
 
Use the command below which will use systemd's  '''N'''etwork '''T'''ime '''P'''rotocol service to sync the clock with a server.
 
 
# timedatectl set-ntp true
 
 
Verify the clock synced.
 
 
# timedatectl status
 
 
= Standard UEFI Install =
 
 
== Partition the disk ==
 
 
{{Warning| The first thing to do is to list the disks in your system, you could have an NVME drive in your PC which could effect this guide. This guide will be using /dev/sd''X''. If you are using NVME it should be /dev/nvme0n1. Please make sure you are targeting the correct drive as loss of data will occur.}}
 
 
Use the command below to list the disks in your system.
 
 
# fdisk -l
 
 
Target the disk you will be using for installation.
 
 
# fdisk /dev/sd''X''
 
 
=== EFI Partition ===
 
 
Use {{ic|g}} to create a GUID partition table as opposed to a Master boot record.
 
 
g
 
 
Use {{ic|n}} to create a new partition.
 
 
n
 
 
Skip the partition number.
 
 
ENTER
 
 
Skip the first sector resizing.
 
 
ENTER
 
 
Next make the size of the partition 512MB big, this will be used for UEFI.
 
 
+512M
 
 
Use {{ic|t}} to change the type of the partition.
 
 
t
 
 
This will select the partition number, you could just press enter.
 
 
1
 
 
This will set the partition to EFI.
 
 
1
 
 
=== Root Partition ===
 
 
Now create the root partition where Arch Linux will be installed.
 
 
n
 
 
Keep this partition as number 2.
 
 
ENTER
 
 
Skip the first sector resizing.
 
 
ENTER
 
 
Skip second sector resizing so the rest of the disk is used.
 
 
ENTER
 
 
Finally write all these changes to the disk.
 
 
w
 
 
{{Note| You should check the partition layout with {{ic|p}} before writing the changes.}}
 
 
=== Example Layout ===
 
 
Your drive should look like something below.
 
 
{| class="wikitable"
 
! Mount point !! Partition !! Type !! Size
 
|-
 
| /mnt/boot ||/dev/sd''X''1 || EFI (FAT32) || 512M
 
|-
 
| /mnt ||/dev/sd''X''2 || Linux FS (ext4) || 120G
 
|}
 
 
== Format partitions ==
 
 
Format the EFI partition.
 
 
# mkfs.fat -F32 /dev/sd''X''1
 
 
Format root partition.
 
 
# mkfs.ext4 /dev/sd''X''2
 
 
== Mount partitions ==
 
 
Next mount the partitions so you can install Arch Linux.
 
 
# mount /dev/sd''X''2 /mnt
 
 
Make a directory before mounting the boot partition otherwise it will fail.
 
 
# mkdir /mtn/boot
 
 
Now mount the boot partition.
 
 
# mount /dev/sd''X''1 /mnt/boot
 
 
== Install the base system ==
 
 
Next install the base system along with base-devel and the linux-headers package.
 
 
{{Note| You can add more packages here if you would like.}}
 
 
# pacstrap -i /mnt base base-devel linux-headers
 
 
== Generate fstab file ==
 
 
Generate a fstab file so Arch Linux knows how to boot properly.
 
 
# genfstab -U -p /mnt >> /mnt/etc/fstab
 
 
== Chroot into the system ==
 
 
This will transfer you from the live USB to your new Arch Linux install.
 
 
# arch-chroot /mnt
 
 
== Install packages ==
 
 
{{Note| Microcode packages should be installed for your CPU.
 
The Intel package is {{ic|intel-ucode}}
 
The AMD package is {{ic|amd-ucode}}}}
 
 
# pacman -S grub efibootmgr dosfstools os-prober mtools vim bash-completion
 
 
== Configuring GRUB ==
 
 
=== Mount EFI partition ===
 
 
Create the folder below as the partition won't mount.
 
 
# mkdir /boot/EFI
 
 
Now mount the partition.
 
 
# mount /dev/sd''X''1 /boot/EFI
 
 
=== Install GRUB ===
 
 
{{Warning| The {{ic|--efi-directory}} flag is crucial as GRUB will fail to install.}}
 
 
{{Note| The {{ic|--bootloader-id}} flag can also be changed to your liking.}}
 
 
# grub-install --target=x86_64-efi --efi-directory=/boot/EFI --bootloader-id=''Arch_Linux'' --recheck
 
 
=== English locale file ===
 
 
Copy english locale file for grub.
 
 
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo
 
 
=== Generating GRUB config file ===
 
 
You need to generate a config file for GRUB so the system boots.
 
 
{{Note| The microcode packages installed earlier will be included in this config.}}
 
 
# grub-mkconfig -o /boot/grub/grub.cfg
 
 
== Standard UEFI Finished ==
 
 
{{Tip| It is recommend you follow the post-installation guide for a more complete system.}}
 
 
= Post-Installation =
 
 
== Creating a swap file ==
 
 
{{Tip| It is better to create a swap file rather than a swap partition because they are easier to manage.}}
 
 
This will create a file which is 4GB in size that is located in the root of your install:
 
 
# fallocate -l 4G /swapfile
 
 
Next set it so only root can manipulate the file:
 
 
# chmod 600 /swapfile
 
 
This makes the file a swap file:
 
 
# mkswap /swapfile
 
 
Finally configure fstab so the swap file is loaded on system boot:
 
 
{{hc|/etc/fstab|
 
/swapfile none swap defaults 0 0
 
}}
 
 
== Set the locale ==
 
 
Edit {{ic|/etc/locale.gen}} and uncomment {{ic|en_US.UTF-8 UTF-8}} and any other needed locales e.g. {{ic|''en_GB.UTF-8 UTF-8''}}
 
 
Generate the locales with:
 
 
# locale-gen
 
 
Next edit {{ic|/etc/locale.conf}} with the locale you will use on your system:
 
 
{{hc|1=/etc/locale.conf|2=
 
LANG=''en_GB.UTF-8''
 
}}
 
 
Next do the same for {{ic|/etc/vconsole.conf}} so you get the preferred keyboard layout in the TTY.
 
 
{{hc|1=/etc/vconsole.conf|2=
 
KEYMAP=''uk''
 
}}
 
 
== Set the time zone ==
 
 
Use the command below which will use systemd's  '''N'''etwork '''T'''ime '''P'''rotocol service to sync the clock with a server:
 
 
# timedatectl set-ntp true
 
 
Verify the clock synced.
 
 
# timedatectl status
 
 
Make a link with your timezone so the clock can adjust accordingly.
 
 
# ln -sf /usr/share/zoneinfo/''Europe''/''London'' /etc/localtime
 
 
Lastly set the hardware clock from the system clock.
 
 
# hwclock --systohc
 
 
== Set the hostname ==
 
 
Create {{ic|/etc/hostname}} and add a desired hostname:
 
 
{{hc|1=/etc/hostname|2=
 
''hostname''
 
}}
 
 
== User management ==
 
 
Set the root password:
 
 
# passwd root
 
 
This will create a user and it will also create a directory for them in /home:
 
 
# useradd -m ''user''
 
 
Set the password for the new user:
 
 
# passwd ''user''
 
 
== Adding user(s) to the sudo file ==
 
 
This step will show you how to add your newly created user to the {{ic|/etc/sudoers}} file.
 
 
{{warning| You should only use {{ic|visudo}} on this file as it saves edits to a temporary file and helps prevent syntax errors before it is saved.}}
 
 
=== Single user ===
 
 
Open the {{ic|/etc/sudoers}} file.
 
 
# visudo /etc/sudoers
 
 
Tap {{ic|ESC}} on your keyboard and then {{ic|/}} and start typing "User privilege specification" you should see '''root ALL=(ALL) ALL'''
 
 
Now tap {{ic|ESC}} on your keyboard and then double tap {{ic|d}}, after this press {{ic|p}} twice.
 
 
This part of the file should now look like something below:
 
 
{{hc|1=/etc/sudoers|2=
 
root ALL=(ALL) ALL
 
root ALL=(ALL) ALL
 
}}
 
 
Edit the bottom one and add the username of the user created in the last step.
 
 
Example:
 
{{hc|1=/etc/sudoers|2=
 
root ALL=(ALL) ALL
 
''user'' ALL=(ALL) ALL
 
}}
 
 
=== Allowing users in a group ===
 
 
{{Note| I'm using the {{ic|sudo}} group for this example.}}
 
 
Open the {{ic|/etc/sudoers}} file.
 
 
# visudo /etc/sudoers
 
 
Tap {{ic|ESC}} on your keyboard and then {{ic|/}} and start typing "# %" and press {{ic|enter}}, then press {{ic|n}} twice and it should take you to the needed line in the file and you should see '''%sudo ALL=(ALL) ALL'''
 
 
This part of the file should now look like something below:
 
 
{{hc|1=/etc/sudoers|2=
 
# %sudo ALL=(ALL) ALL
 
}}
 
 
Simply remove the hash to uncomment the line.
 
 
Example:
 
{{hc|1=/etc/sudoers|2=
 
%sudo ALL=(ALL) ALL
 
}}
 
 
== Enabling multilib repositories ==
 
 
You will need to edit {{ic|/etc/pacman.conf}} and uncomment the multilib section.
 
 
{{hc|1=/etc/pacman.conf|2=
 
[multilib]
 
Include = /etc/pacman.d/mirrorlist}}
 

Latest revision as of 02:45, 19 October 2019