-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall.tex
More file actions
204 lines (179 loc) · 11.2 KB
/
install.tex
File metadata and controls
204 lines (179 loc) · 11.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
\documentclass{article}
\author{\textit{by @uditkarode}}
\title{\textbf{Basic Arch Linux \\ Installation Guide}}
\usepackage{fontspec}
\setmonofont{Cascadia Mono PL}[
Scale=MatchLowercase
]
\begin{document}
\maketitle
This document guides you through a very basic installation of \textit{Arch Linux.}
\section{Preparations}
This guide assumes you have a UEFI-based machine with a GPT partition table (all the new machines confirm to this), and that you already have a USB stick ready (with the ISO obtained from \texttt{https://www.archlinux.org/download/}), and have booted into it, hence obtaining a shell. This is where you're supposed to enter commands.
\subsection{Deciding install partition}
You first need to decide what partition you're going to install Arch on. You can examine the current partition table using the command \texttt{fdisk -l}, and make adjustments or create new partitions using the \texttt{cfdisk} command. An example partition table that \texttt{fdisk -l} would output is:
\texttt{
\\
Device Start End Sectors Size Type\\
/dev/nvme0n1p1 2048 1333247 1331200 650M EFI System\\
/dev/nvme0n1p2 1333248 211048447 209715200 100G Linux filesystem\\
/dev/nvme0n1p4 420763648 791891967 371128320 177G Apple APFS\\
}
\\
In my case, \texttt{/dev/nvme0n1p2} would be my \textit{target partition}. We'll refer to the target partition as \texttt{<target>} in the rest of this document.
\subsection{Readying partition for install}
Once you've decided the \textit{target partition}, you need to run the \texttt{mkfs.ext4} command on it this way:
\\\\
\texttt{mkfs.ext4 /dev/nvme0n1p2}
\\\\
This command will format your disk and set up an empty \texttt{ext4} filesystem on it.\\\\ Once the execution of this command finishes, you need to \textit{mount} the drive. Mounting basically refers to attaching the desired filesystem to a directory on the current filesystem. We'll mount it at the \texttt{/mnt} directory this way:
\\\\
\texttt{mount /dev/<target> /mnt}
\\\\
You now have your partition ready and mounted, that ends the first section!
\section{Connecting to the internet}
\subsection{Activating the connection}
From now on, we're going to install packages from the Arch repositories, which requires us to be connected to the internet. \textbf{If you want to use Ethernet, just plug in the Ethernet cable and go straight to 2.2!}\\Here's how you do it if you want to use WiFi:
\\\\
\texttt{wifi-menu}
\\\\
However, newer installation mediums for Arch Linux no longer contain the \texttt{netctl} package, so if you see \texttt{command not found} after executing \texttt{wifi-menu}, this is what you need to do:
\begin{itemize}
\item{\texttt{iwctl}}
\\This will open the \texttt{iwctl} prompt.
\item{\texttt{device list}}
\\This command will output the WiFi devices that \texttt{iwctl} detects on your machine. Note the \texttt{name} of the device you want to use. It'll usually be \texttt{wlan0}. We'll refer to it as \texttt{<device>} now.
\item{\texttt{station <device> get-networks}}
\\This command will output the WiFi networks it detects around you. Note the network you want to connect to. We'll refer to it as \texttt{<wifiname>} from now on.
\item{\texttt{station <device> connect <wifiname>}}
\\If you don't see an error like \texttt{Operation failed}, you're good to go! Press \texttt{CTRL + D} to exit the \texttt{iwctl} prompt and return your shell.
\end{itemize}
\subsection{Testing the connection}
To test your connection to the internet, execute:
\\\\\texttt{ping 8.8.8.8}
\\\\
You should see an output like:\\
\texttt{
\\
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.\\
64 bytes from 8.8.8.8: icmp\_seq=1 ttl=117 time=53.5 ms\\
}
\\
Press \texttt{CTRL + C} to stop it.
\\\\
If you see \texttt{connect: Network is unreachable}, something went wrong. You should retry section 2.1, or you won't be able to proceed.
\section{Installation}
\subsection{Installing the \texttt{base}}
We'll start off the installation process by installing the \texttt{base} and \texttt{base-devel} metapackages. the \texttt{base} metapackage contains all the basic packages that a system requires to function, while \texttt{base-devel} contains build tools and development related packages (even if you're not much of a developer, you might want to install this since it'll be used for AUR installs, more on that later). Here's the actual command:
\\\\
\texttt{pacstrap -i /mnt base base-devel}
\subsection{Fstab generation}
Now we're going to need to generate the fstab file, which tells your system what partitions it needs to mount and their mountpoints. It's basically telling Linux what partition everything's installed in. To generate it, you can use the following command:
\\\\
\texttt{genfstab -U -p /mnt > /mnt/etc/fstab}
\subsection{Chrooting into our installation}
At this point, you have a skeleton set up with all the basic packages in your target partition. However, we're missing some important packages, such as \textit{the kernel itself.} That's what we're going to install in this subsection. Let's first get into the system!
\\\\
\texttt{arch-chroot /mnt}
\\\\
\textit{> But you said we don't have the kernel yet, how are we inside our installed system?}
\\\\
You aren't completely inside your new installation yet! What the \texttt{chroot} command does is that it changes the apparent root directory (\texttt{/}) for your currently booted session, hence creating a sort of a sandbox. It's still using the kernel that came with the Arch installation drive.
\\\\
\subsection{Installation of necessary packages}
\subsubsection{Boot related packages}
\texttt{pacman -S grub os-prober efibootmgr}
\\\\
where:\\
\texttt{grub} is our bootloader\\
\texttt{os-prober} is used to find other EFI operating systems
\texttt{efibootmgr} is a helper tool for GRUB installation tool
\subsubsection{Kernel and firmware}
\texttt{pacman -S linux linux-headers linux-firmware}\\\\
You could also install \texttt{linux-lts} and \texttt{linux-lts-headers} if you want the LTS kernel, but the cutting-edge Arch kernel is stable enough, so it's on you.
\subsubsection{General use packages}
\texttt{pacman -S networkmanager sudo vim nano git zip unzip dialog}\\\\
This installs packages that help connect to WiFi/Ethernet, and so on.
\subsubsection{Processor/GPU Specific drivers}
If you have an Intel CPU, install \texttt{intel-ucode} and if you have an AMD CPU, install \texttt{amd-ucode}. These packages ensure system stability.\\\\Now for the \textbf{graphic drivers}, you have two choices - proprietary, or open-source drivers. Open-source drivers will usually do the job for you, so that's what I'm going to mention here.
\\\\
\textbf{NOTE}: If you're using a laptop that has two GPUs (i.e. \textit{Intel HD Graphics}\textbf{ or }\textit{AMD Radeon} \textbf{+} \textit{Nvidia}), install the graphic drivers for the first/weaker GPU (may be \textit{Intel HD Graphics} or \textit{AMD Radeon}). This is because the more powerful GPU provided (usually \textit{Nvidia}) is only supposed to be used for graphic intensive tasks, since the weaker GPU can usually handle all other tasks without any issues whatsoever. You'll need additional setup to be able to use the other/powerful GPU, and the configuration for it is out of scope for this guide.
\\
\begin{itemize}
\item for \textbf{Nvidia}: \texttt{pacman -S mesa xf86-video-nouveau}
\item for \textbf{Intel HD Graphics}: \texttt{pacman -S mesa xf86-video-intel}
\item for \textbf{AMD Radeon}: \texttt{pacman -S mesa xf86-video-amdgpu}
\end{itemize}
In case you have a newer \textbf{Nvidia} GPU, you might want to install the proprietary drivers instead, since they perform a bit better. However, this is only needed if you plan to perform graphic-intensive tasks on this machine.
\\\\
\texttt{pacman -S dkms nvidia nvidia-utils nvidia-dkms nvidia-settings}
\\\\
That concludes the driver installation segment of the guide!
Now you have an Arch Linux base with proper drivers for your system. You're getting closer to the end!
\section{Configuration}
\subsection{Setting up your user account}
Every person that uses a linux machine is supposed to have their own accounts. Let's make one for you - the primary user!
\\\\
\texttt{useradd -m -G wheel -s /bin/bash yournamehere}
\\\\
\textbf{NOTE:} make sure your username starts with a lowercase letter!
\subsection{Letting you use sudo}
\texttt{sudo} is a command that lets you execute other commands as the superuser. In order to use it, we must whitelist the group our user is in (\texttt{wheel}) in the sudo configs! To do this, execute:
\\\\
\texttt{echo '\%wheel ALL=(ALL) ALL' >> /etc/sudoers}
\subsection{Setting passwords}
To change the password for the root user, type in:
\\\\\texttt{passwd}\\\\
To change the password for your user, type in:
\\\\\texttt{passwd yournamehere}\\
\\Make sure to change the password for both the root user and your personal user. If you've done that, great work! This concludes the configuration section of the guide!
\section{Setting up visual factors}
Here, we set up how our installation looks. If you're coming from Windows or macOS, this might seem a bit strange to you. However, this is a common thing in the Linux world. What we did till now is just going to give us a command line interface. We now have choice over the Desktop Environment (commonly abbreviated as DE) we want to install. In this guide, we're going to go with Gnome, since this is what Ubuntu uses, and is easy to use and install for even new users. Here's what you need to do:
\\\\
\texttt{pacman -S gnome}
\\\\
That's it! This might install a lot of packages and take a lot of time.
\section{Installing the bootloader}
Now we're going to install the bootloader, \texttt{GRUB} onto our system.
\\Before we do this, you must find out the EFI partition of your system.
\\Again, we do this with \texttt{fdisk -l}. Let's look at a sample output.
\\\\
\texttt{
\\
Device Start End Sectors Size Type\\
/dev/nvme0n1p1 2048 1333247 1331200 650M EFI System\\
/dev/nvme0n1p2 1333248 211048447 209715200 100G Linux filesystem\\
/dev/nvme0n1p4 420763648 791891967 371128320 177G Apple APFS\\
}
\\
In my case, \texttt{/dev/nvme0n1p1} is the EFI partition. We'll call this \textit{efitarget} from now on. To install \texttt{GRUB}, run the following:
\\\\
\texttt{
cd /\\
mkdir efidir\\
mount efitarget efidir\\
grub-install --target=x86\_64-efi --efi-directory=efidir --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg
}
\\\\
That does it!
\section{Enabling required services}
This is the last step of this guide. We need to enable \texttt{gdm} (Gnome Display Manager) and \texttt{NetworkManager} (the tool to let us use the internet), and set a proper locale. This is how you do it:
\\\\
\texttt{systemctl enable gdm}\\
\texttt{systemctl enable NetworkManager}\\
\texttt{localectl set-locale LANG=en\_US.UTF-8}
\\\\
aaaand you're done!
\section{Exiting and Rebooting}
You're in the end game now :) all you need to do is:
\\
\texttt{
\\
exit\\
umount -R /mnt\\
reboot
}
\\\\
Once that's done, remove the USB Stick, and wait for the computer to boot. It should boot right into GRUB. If not, you can change the boot order from your BIOS to make it boot GRUB. Once your system boots, you'll see the login screen. Enter the password you entered in section 3.3 and you should be in your system :)
\end{document}