summaryrefslogtreecommitdiff
path: root/www/posts/arch/atom.xml
blob: b0a122db9e3c1baeb45dc04f3de8fe8378c559cc (plain)
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
205
206
207
208
209
210
211
212
213
214
215
216
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title type="text">The Home of David T. Sadler - All Posts About Arch</title>
    <id>https://davidtsadler.com/posts/arch/atom.xml</id>
    <link rel="alternate" type="text/html" href="https://davidtsadler.com/posts/arch/"/>
    <link rel="self" type="application/atom+xml" href="https://davidtsadler.com/posts/arch/atom.xml"/>
    <updated>2020-09-07T12:00:00Z</updated>
    <entry>
    <title type="text">Installing Zsh and Powerlevel10k on Arch Linux</title>
    <id>https://davidtsadler.com/posts/arch/2020-09-07/installing-zsh-and-powerlevel10k-on-arch-linux/</id>
    <link rel="alternate" type="text/html" href="https://davidtsadler.com/posts/arch/2020-09-07/installing-zsh-and-powerlevel10k-on-arch-linux/"/>
    <author><name>David T. Sadler.</name></author>
    <published>2020-09-07T12:00:00Z</published>
    <updated>2020-09-07T12:00:00Z</updated>
    <content type="html">&lt;h1&gt;Installing Zsh and Powerlevel10k on Arch Linux&lt;/h1&gt;&lt;blockquote&gt;Mon 7th September 2020 By David T. Sadler.&lt;/blockquote&gt;&lt;p&gt;I have been a bash user ever since I started using Linux. But after installing Arch Linux I wanted to give another shell a try and so decided on Zsh. Below is how I went about replacing bash with Zsh.&lt;/p&gt;&lt;h2&gt;Installing Zsh&lt;/h2&gt;&lt;p&gt;Zsh is installed via pacman.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ sudo pacman -S zsh&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Check that Zsh has been installed by running it from the terminal.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ zsh&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Since this is the first time that Zsh has been run you should now see zsh-newuser-install which will allow you to setup some basic configuration. If you wish to skip this just press the q key. You can always manually run this with the below commands at a later date.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ autoload -Uz zsh-newuser-install
$ zsh-newuser-install -f&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Changing The Default Shell&lt;/h2&gt;&lt;p&gt;Installing Zsh does not automatically make it the system's default shell. The next time you log back in you will find that your current shell is still in use. You can check which shell is been used by looking at the SHELL environment variable.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ echo $SHELL

/bin/bash&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To see a list of shells that have been installed use the chsh command.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ chsh -l

/bin/sh
/bin/bash
/usr/bin/git-shell
/bin/zsh
/usr/bin/zsh&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The same command can be used to change the default shell by providing it with the full path to the shell.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ chsh -s /bin/zsh&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Note that this change is not instant and you will need to log out and log in again for it to take affect. Once you have done that check the SHELL environment variable again to confirm the change.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ echo $SHELL

/bin/ksh&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Installing Powerlevel10k&lt;/h2&gt;&lt;p&gt;Powerlevel10k is a theme for Zsh and in order to make the most of it you should install the Meslo Nerd Font that has been patched for Powerlevel10k.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ yay -Sy --noconfirm ttf-meslo-nerd-font-powerlevel10k&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You need to configure your terminal to use this font. How this is done is dependant upon what terminal you are using. Since I use st from suckless I need to edit the file config.h and specify MesloLGS NF in the font settings.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;static char *font = &amp;quot;MesloLGS NF:pixelsize=14:antialias=true:autohint=true&amp;quot;;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Before rebuilding st.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ sudo make install&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now that the dependences have been meet Powerlevel10k can be installed.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ yay -Sy --noconfirm zsh-theme-powerlevel10k-git&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Once it has been installed ensure that Zsh loads Powerlevel10k.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ echo 'source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme' &amp;gt;&amp;gt;! ~/.zshrc&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can now open a new terminal which will start the Powerlevel10k configuration wizard. This will ask you a few questions and configure your prompt. If it doesn't trigger automatically, type p10k configure.&lt;/p&gt;&lt;p&gt;Once the configuration wizard has finished open a new terminal and you should see the Powerlevel10k theme been used.&lt;/p&gt;&lt;h3&gt;Links&lt;/h3&gt;&lt;a href=&quot;/posts/arch/2020-05-25/installing-arch-linux-on-a-x220-thinkpad/&quot;&gt;Installing Arch Linux on a Thinkpad X220.&lt;/a&gt;&lt;a href=&quot;https://www.zsh.org/&quot;&gt;Zsh.&lt;/a&gt;&lt;a href=&quot;https://github.com/romkatv/powerlevel10k/&quot;&gt;Powerlevel10k.&lt;/a&gt;&lt;a href=&quot;https://st.suckless.org/&quot;&gt;Simple Terminal.&lt;/a&gt;&lt;a href=&quot;/posts/arch/&quot;&gt;Arch - Read More Posts.&lt;/a&gt;&lt;p&gt;I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.&lt;/p&gt;&lt;a href=&quot;mailto:david@davidtsadler.com&quot;&gt;Email david@davidtsadler.com&lt;/a&gt;&lt;h3&gt;License&lt;/h3&gt;&lt;a href=&quot;https://creativecommons.org/licenses/by-sa/4.0/&quot;&gt;The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.&lt;/a&gt;&lt;p&gt;Copyright © 2021 David T. Sadler.&lt;/p&gt;&lt;a href=&quot;/&quot;&gt;Return to Homepage.&lt;/a&gt;</content>
</entry><entry>
    <title type="text">Enabling Audio in Arch Linux</title>
    <id>https://davidtsadler.com/posts/arch/2020-08-31/enabling-audio-in-arch-linux/</id>
    <link rel="alternate" type="text/html" href="https://davidtsadler.com/posts/arch/2020-08-31/enabling-audio-in-arch-linux/"/>
    <author><name>David T. Sadler.</name></author>
    <published>2020-08-31T12:00:00Z</published>
    <updated>2020-08-31T12:00:00Z</updated>
    <content type="html">&lt;h1&gt;Enabling Audio in Arch Linux&lt;/h1&gt;&lt;blockquote&gt;Mon 31st August 2020 By David T. Sadler.&lt;/blockquote&gt;&lt;p&gt;If you have recently installed Arch Linux you may have found that there is no sound when playing media. This is because by default ALSA has all channels muted.&lt;/p&gt;&lt;h2&gt;Installing the ALSA Utilities&lt;/h2&gt;&lt;p&gt;The Advanced Linux Sound Architecture (ALSA) is the part of the Linux kernel that manages the sound devices on your system. In addition to this the project also provides several command-line utilities that allow you to configure these devices. These can be installed with pacman.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ sudo pacman -S alsa-utils&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Unmuting The Channels&lt;/h2&gt;&lt;p&gt;Channels can be unmuted with amixer.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ amixer sset Master unmute
$ amixer sset Speaker unmute
$ amixer sset Headphone unmute&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can test that the speakers are working with the speaker-test command.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ speaker-test -c 2&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you are still getting no sound then it could be that the volume has been set to zero. Use amixer again to increase the volume.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ amixer sset Master 100%
$ amixer sset Speaker 100%
$ amixer sset Headphone 100%&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Unmute with Alsamixer&lt;/h2&gt;&lt;p&gt;If you prefer a more intuitive ncurses interface you can use alsamixer.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ alsamixer&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Channels that are muted will have the MM label below them. Unmuted channels have 00.&lt;/p&gt;&lt;p&gt;Use the ← and → keys to scroll to the muted channel and press m to unmute it.&lt;/p&gt;&lt;p&gt;The volume can be increased and decreased with the ↑ and ↓ keys.&lt;/p&gt;&lt;h3&gt;Links&lt;/h3&gt;&lt;a href=&quot;/posts/arch/2020-05-25/installing-arch-linux-on-a-x220-thinkpad/&quot;&gt;Installing Arch Linux on a Thinkpad X220.&lt;/a&gt;&lt;a href=&quot;/posts/arch/&quot;&gt;Arch - Read More Posts.&lt;/a&gt;&lt;p&gt;I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.&lt;/p&gt;&lt;a href=&quot;mailto:david@davidtsadler.com&quot;&gt;Email david@davidtsadler.com&lt;/a&gt;&lt;h3&gt;License&lt;/h3&gt;&lt;a href=&quot;https://creativecommons.org/licenses/by-sa/4.0/&quot;&gt;The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.&lt;/a&gt;&lt;p&gt;Copyright © 2021 David T. Sadler.&lt;/p&gt;&lt;a href=&quot;/&quot;&gt;Return to Homepage.&lt;/a&gt;</content>
</entry><entry>
    <title type="text">Pacman Cheat Sheet For Ubuntu Users</title>
    <id>https://davidtsadler.com/posts/arch/2020-08-24/pacman-cheat-sheet-for-ubuntu-users/</id>
    <link rel="alternate" type="text/html" href="https://davidtsadler.com/posts/arch/2020-08-24/pacman-cheat-sheet-for-ubuntu-users/"/>
    <author><name>David T. Sadler.</name></author>
    <published>2020-08-24T12:00:00Z</published>
    <updated>2020-08-24T12:00:00Z</updated>
    <content type="html">&lt;h1&gt;Pacman Cheat Sheet For Ubuntu Users&lt;/h1&gt;&lt;blockquote&gt;Mon 24th August 2020 By David T. Sadler.&lt;/blockquote&gt;&lt;p&gt;As a regular Ubuntu user I am used to using apt for system maintenance. But now that I've installed Arch Linux I will be using pacman and so below is a cheat sheet for myself that shows the pacman equivalent of some common apt actions.&lt;/p&gt;&lt;pre&gt;Action                     | Apt                            | Pacman                     |
---------------------------|--------------------------------|----------------------------|
Install a package          | apt install &amp;lt;package name&amp;gt;     | pacman -S &amp;lt;package name&amp;gt;   |
Remove a package           | apt remove &amp;lt;package name&amp;gt;      | pacman -Rs &amp;lt;package name&amp;gt;  |
Search for a package       | apt serch &amp;lt;search term&amp;gt;        | pacman -Ss &amp;lt;regexp&amp;gt;        |
Upgrade packages           | apt update &amp;amp;&amp;amp; apt upgrade      | pacman -Syu                |
Upgrade distribution       | apt update &amp;amp;&amp;amp; apt dist-upgrade | pacman -Syu                |
Clean up local caches      | apt autoclean                  | pacman -Scc                |
Remove unused dependencies | apt autoremove                 | pacman -Qmq | pacman -Rs - |&lt;/pre&gt;&lt;h2&gt;Install a Package&lt;/h2&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ pacman --sync &amp;lt;package name&amp;gt;

$ pacman -S &amp;lt;package name&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Installs a package and its dependencies.&lt;/p&gt;&lt;h2&gt;Remove a Package&lt;/h2&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ pacman --remove --recursive &amp;lt;package name&amp;gt;

$ pacman -Rs &amp;lt;package name&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Removes a package and all its dependencies, provided that (A) they are not required by other packages; and (B) they were not explicitly installed by the user.&lt;/p&gt;&lt;h2&gt;Search For a Package&lt;/h2&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ pacman --sync --search &amp;lt;regexp&amp;gt;

$ pacman -Ss &amp;lt;regexp&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Searches in the sync database for packages with a name or description that match the regexp.&lt;/p&gt;&lt;h2&gt;Upgrade Packages&lt;/h2&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ pacman --sync --refresh --sysupgrade

$ pacman -Syu&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Downloads a fresh copy of the master package database and then upgrades all out-of-date packages.&lt;/p&gt;&lt;h2&gt;Upgrade Distribution&lt;/h2&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ pacman --sync --refresh --sysupgrade

$ pacman -Syu&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Since Arch uses a rolling release system there is no distribution version as you just upgrade your packages to their latest versions.&lt;/p&gt;&lt;h2&gt;Clean Up Local Caches&lt;/h2&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ pacman --sync --clean --clean

$ pacman -Scc&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Free up disk space by removing from the cache any packages that are no longer installed. Also removes any cached sync databases.&lt;/p&gt;&lt;h2&gt;Remove Used Dependencies&lt;/h2&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ pacman --query --deps --unrequired --quiet | pacman --remove --recursive -

$ pacman -Qdtq | pacman -Rs -&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Remove dependencies that are no longer needed, because e.g. the package which needed the dependencies was removed.&lt;/p&gt;&lt;h3&gt;Links&lt;/h3&gt;&lt;a href=&quot;/posts/arch/2020-05-25/installing-arch-linux-on-a-x220-thinkpad/&quot;&gt;Installing Arch Linux on a Thinkpad X220.&lt;/a&gt;&lt;a href=&quot;/posts/arch/&quot;&gt;Arch - Read More Posts.&lt;/a&gt;&lt;p&gt;I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.&lt;/p&gt;&lt;a href=&quot;mailto:david@davidtsadler.com&quot;&gt;Email david@davidtsadler.com&lt;/a&gt;&lt;h3&gt;License&lt;/h3&gt;&lt;a href=&quot;https://creativecommons.org/licenses/by-sa/4.0/&quot;&gt;The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.&lt;/a&gt;&lt;p&gt;Copyright © 2021 David T. Sadler.&lt;/p&gt;&lt;a href=&quot;/&quot;&gt;Return to Homepage.&lt;/a&gt;</content>
</entry><entry>
    <title type="text">Installing ST, DMENU and DWM in Arch Linux</title>
    <id>https://davidtsadler.com/posts/arch/2020-08-17/installing-st-dmenu-dwm-in-arch-linux/</id>
    <link rel="alternate" type="text/html" href="https://davidtsadler.com/posts/arch/2020-08-17/installing-st-dmenu-dwm-in-arch-linux/"/>
    <author><name>David T. Sadler.</name></author>
    <published>2020-08-17T12:00:00Z</published>
    <updated>2020-08-17T12:00:00Z</updated>
    <content type="html">&lt;h1&gt;Installing ST, DMENU and DWM in Arch Linux&lt;/h1&gt;&lt;blockquote&gt;Mon 17th August 2020 By David T. Sadler.&lt;/blockquote&gt;&lt;p&gt;Continuing my Arch Linux installation I now have a user account for daily use. However this only provides me with a terminal. What I would like is a traditional multi-window desktop environment which will require me to install two things. A window system of some sort and a layout manager. For this installation I'm going with Xorg and dwm. For those that are not aware dwm is dynamic window manager for Xorg that has been developed by Suckless. Since by default dwm expects st to be installed as the system's terminal and also makes use dmenu to allow you to launch applications I will installed both of them in addition to dwm.&lt;/p&gt;&lt;h2&gt;Install Dependencies&lt;/h2&gt;&lt;p&gt;Firt off I need to install the dependencies required by st, dmenu and dwm. Since this is Arch Linux I use pacman to do this.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ sudo pacman -S base-devel git libx11 libxft xorg-server xorg-xinit terminus-font&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;base-devel Since I will be installing from source this package contains various tools to compile software.&lt;/li&gt;&lt;li&gt;git Is needed to get the source code from the suckless git repositories.&lt;/li&gt;&lt;li&gt;libx11 and libxft Dependanices required by dwm oherwise it will fail when trying to compile it.&lt;/li&gt;&lt;li&gt;xorg-server Is the display server that provides the windows that dwm will manage.&lt;/li&gt;&lt;li&gt;xorg-xinit Allows us to start the display server.&lt;/li&gt;&lt;li&gt;terminus-font Dwm is configured to use a monospaced font and since I installed a barebones system I need to install such a font now.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Download Git Repositories&lt;/h2&gt;&lt;p&gt;The source code for the software is avialable from the Suckless git repositories so I simply clone them.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ mkdir -p ~/.local/src

$ git clone git://git.suckless.org/st ~/.local/src/st
$ git clone git://git.suckless.org/dmenu ~/.local/src/dmenu
$ git clone git://git.suckless.org/dwm ~/.local/src/dwm&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Install ST&lt;/h2&gt;&lt;p&gt;I install st by first moving to the directory created when cloning the repository.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ cd ~/.local/src/st&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then its as simple as compiling and instaling the software with the below commands.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ make clean
$ sudo make install&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Configure and Install DMENU&lt;/h2&gt;&lt;p&gt;Again move to the directory created earlier.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ cd ~/.local/src/dmenu&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Before compiling a small edit needs to be made to the file config.mk.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ nvim config.mk&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Since I have not installed Xinerama on this system I need to comment out any flags that reference this otherwise dmenu will fail during the compiling.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;vim&quot;&gt;# XINERAMALIBS  = -lXinerama
# XINERAMAFLAGS = -DXINERAMA&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Again compiling and installing is done with the below commands.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ make clean
$ sudo make install&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Configure and Install DWM&lt;/h2&gt;&lt;p&gt;For the final time move to the directory created earlier.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ cd ~/.local/src/dwm&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;As with dmenu the same edit needs to be made to the file config.mk.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ nvim config.mk&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code class=&quot;vim&quot;&gt;# XINERAMALIBS  = -lXinerama
# XINERAMAFLAGS = -DXINERAMA&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Compile and install as usual.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ make clean
$ sudo make install&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Starting DWM&lt;/h2&gt;&lt;p&gt;Since I have installed xorg-xinit I need to create a .xinitrc in my home folder.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ nvim ~/.xinitrc&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The contents of this file is just.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;vim&quot;&gt;exec dwm&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;I can now start xorg and dwm with the below command.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ startx&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;Links&lt;/h3&gt;&lt;a href=&quot;/posts/arch/2020-05-25/installing-arch-linux-on-a-x220-thinkpad/&quot;&gt;Installing Arch Linux on a Thinkpad X220.&lt;/a&gt;&lt;a href=&quot;https://dwm.suckless.org/&quot;&gt;Dynamic Window Manager (DWM).&lt;/a&gt;&lt;a href=&quot;https://suckless.org/&quot;&gt;Suckless Software.&lt;/a&gt;&lt;a href=&quot;https://st.suckless.org/&quot;&gt;Simple Terminal.&lt;/a&gt;&lt;a href=&quot;https://tools.suckless.org/dmenu/&quot;&gt;DMenu.&lt;/a&gt;&lt;a href=&quot;/posts/arch/&quot;&gt;Arch - Read More Posts.&lt;/a&gt;&lt;p&gt;I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.&lt;/p&gt;&lt;a href=&quot;mailto:david@davidtsadler.com&quot;&gt;Email david@davidtsadler.com&lt;/a&gt;&lt;h3&gt;License&lt;/h3&gt;&lt;a href=&quot;https://creativecommons.org/licenses/by-sa/4.0/&quot;&gt;The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.&lt;/a&gt;&lt;p&gt;Copyright © 2021 David T. Sadler.&lt;/p&gt;&lt;a href=&quot;/&quot;&gt;Return to Homepage.&lt;/a&gt;</content>
</entry><entry>
    <title type="text">Granting Sudo Access to a User in Arch Linux</title>
    <id>https://davidtsadler.com/posts/arch/2020-06-22/granting-sudo-access-to-a-user-in-arch-linux/</id>
    <link rel="alternate" type="text/html" href="https://davidtsadler.com/posts/arch/2020-06-22/granting-sudo-access-to-a-user-in-arch-linux/"/>
    <author><name>David T. Sadler.</name></author>
    <published>2020-06-22T12:00:00Z</published>
    <updated>2020-06-22T12:00:00Z</updated>
    <content type="html">&lt;h1&gt;Granting Sudo Access to a User in Arch Linux&lt;/h1&gt;&lt;blockquote&gt;Mon 22nd 2020 By David T. Sadler.&lt;/blockquote&gt;&lt;p&gt;So by the end of my last post my minimal installation of Arch Linux had a user account that I could log into instead of the root user. However in order to do anything useful on the system I need to be able to run commands such as pacman that only the root user can do. Now one way to solve this is to change to the root user with su before running the command, but this defeats the point in creating a non-root user account in the first place. Instead a better way is to make use of sudo.&lt;/p&gt;&lt;p&gt;Sudo (su &amp;quot;do&amp;quot;) gives the ability for a user (or groups of users) to run some (or all) commands as root and also provides an audit trail of the commands and their arguments. Usage is very simple, you enter sudo followed by the command that you want to run. For example,&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ sudo pacman -Syu&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Configuration is done in the file /etc/sudoers. This is where you can specify which users or groups can use sudo and what commands they can run. However, you must be careful when editing this file as any syntax errors will make sudo unusable. Therefore it is strongly recommended to do any editing via the visudo command. This locks the sudoers file, saves edits to a temporary file, and checks that file's grammar before copying it to /etc/sudoers.  &lt;/p&gt;&lt;p&gt;Traditionally in Linux systems users that should have privileged administrator rights are added to the wheel group which is then given sudo access. As the root user the first thing that I needed to do was add my user account to the wheel group with the usermod command.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ usermod -aG wheel david&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;I used the below options with the command.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;-a Modifies the -G argument so that the user is added to the specified groups and not removed from any existing ones.&lt;/li&gt;&lt;li&gt;-G The list of supplementary groups that the user will be made a member of. In this case it's just wheel. Note that you need to pass -a otherwise the user will be removed from any group that is not listed. &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The sudo package then needed to be installed.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ pacman -S sudo&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Next I needed to grant sudo access to the wheel group by editing /etc/sudoers with visudo. Note that the default editor for visudo is vi. Since this has not been installed on my system I can change the editor to be nvim by first setting the variable EDITOR.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ EDITOR=nvim visudo&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Once the file was opened I located and uncommented the below line before saving and exiting nvim. This allows members of the wheel group to execute any command without having to enter their password.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;%wheel ALL(ALL) NOPASSWD: ALL&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;I checked that I had sudo access by running the below command while logged into my user account.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ sudo pwd

/home/david&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Since I wasn't prompted for my password and the command was executed I knew that I now had sudo access.&lt;/p&gt;&lt;h3&gt;Links&lt;/h3&gt;&lt;a href=&quot;/posts/arch/2020-06-15/adding-a-user-in-arch-linux/&quot;&gt;Adding a User in Arch Linux.&lt;/a&gt;&lt;a href=&quot;/posts/arch/&quot;&gt;Arch - Read More Posts.&lt;/a&gt;&lt;p&gt;I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.&lt;/p&gt;&lt;a href=&quot;mailto:david@davidtsadler.com&quot;&gt;Email david@davidtsadler.com&lt;/a&gt;&lt;h3&gt;License&lt;/h3&gt;&lt;a href=&quot;https://creativecommons.org/licenses/by-sa/4.0/&quot;&gt;The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.&lt;/a&gt;&lt;p&gt;Copyright © 2021 David T. Sadler.&lt;/p&gt;&lt;a href=&quot;/&quot;&gt;Return to Homepage.&lt;/a&gt;</content>
</entry><entry>
    <title type="text">Adding a User in Arch Linux</title>
    <id>https://davidtsadler.com/posts/arch/2020-06-15/adding-a-user-in-arch-linux/</id>
    <link rel="alternate" type="text/html" href="https://davidtsadler.com/posts/arch/2020-06-15/adding-a-user-in-arch-linux/"/>
    <author><name>David T. Sadler.</name></author>
    <published>2020-06-15T12:00:00Z</published>
    <updated>2020-06-15T12:00:00Z</updated>
    <content type="html">&lt;h1&gt;Adding a User in Arch Linux&lt;/h1&gt;&lt;blockquote&gt;Mon 15th June 2020 By David T. Sadler.&lt;/blockquote&gt;&lt;p&gt;In a previous post I installed Arch Linux on my Thinkpad X220. Since it was a very minimal install there are no user accounts except for the root user. So to add myself as a user I need to use the useradd command.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ useradd -m -s /bin/bash david&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;I used the below options with the command.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;-m Create the home directory for this account.&lt;/li&gt;&lt;li&gt;-s /bin/bash Make bash the login shell for this account.&lt;/li&gt;&lt;li&gt;david The name of the new user.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;This creates a new account for me and also ensures that a home directory is created as /home/david.&lt;/p&gt;&lt;p&gt;The new account will require a password so assign one with the passwd command.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ passwd david

New password:
Retype new password:
passwd: password updated successfully&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now all I have to do is logout of the root account.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ logout&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then login with the new credentials to confirm that everything is okay.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;suliman login: david
Password:

david@suliman:$&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;Links&lt;/h3&gt;&lt;a href=&quot;/posts/arch/2020-05-25/installing-arch-linux-on-a-x220-thinkpad/&quot;&gt;Installing Arch Linux on a Thinkpad X220.&lt;/a&gt;&lt;a href=&quot;/posts/arch/&quot;&gt;Arch - Read More Posts.&lt;/a&gt;&lt;p&gt;I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.&lt;/p&gt;&lt;a href=&quot;mailto:david@davidtsadler.com&quot;&gt;Email david@davidtsadler.com&lt;/a&gt;&lt;h3&gt;License&lt;/h3&gt;&lt;a href=&quot;https://creativecommons.org/licenses/by-sa/4.0/&quot;&gt;The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.&lt;/a&gt;&lt;p&gt;Copyright © 2021 David T. Sadler.&lt;/p&gt;&lt;a href=&quot;/&quot;&gt;Return to Homepage.&lt;/a&gt;</content>
</entry><entry>
    <title type="text">Installing Arch Linux on a Thinkpad X220</title>
    <id>https://davidtsadler.com/posts/arch/2020-05-25/installing-arch-linux-on-a-thinkpad-x220/</id>
    <link rel="alternate" type="text/html" href="https://davidtsadler.com/posts/arch/2020-05-25/installing-arch-linux-on-a-thinkpad-x220/"/>
    <author><name>David T. Sadler.</name></author>
    <published>2020-05-25T12:00:00Z</published>
    <updated>2020-05-25T12:00:00Z</updated>
    <content type="html">&lt;h1&gt;Installing Arch Linux on a Thinkpad X220&lt;/h1&gt;&lt;blockquote&gt;Mon 25th May 2020 By David T. Sadler.&lt;/blockquote&gt;&lt;h2&gt;Introduction&lt;/h2&gt;&lt;p&gt;So I purchased a used Thinkpad X220 for about £90 on eBay and decided to install Arch Linux onto it. This guide is the steps that I took to achieve this.&lt;/p&gt;&lt;p&gt;Now when it comes to Linux there is always more than one way of doing things and this guide is just my preferred way. Feel free to follow it for your own installation, just keep in mind that you may have to change some of the steps to suit your own circumstances. Also there is every chance that the information presented here will be out of date so I recommend that you at least read the through the official installation guide for the most up-to-date information.&lt;/p&gt;&lt;h2&gt;Download the Arch Linux ISO Image&lt;/h2&gt;&lt;p&gt;The Arch Linux download page provides direct download and torrent links. You should also download the PGP signature to the same location and use the gpg command to verify that the ISO has not been compromised.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ gpg --keyserver-options auto-key-retrieve --verify archlinux-2020.05.01-x86_64.iso.sig&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Create a Live USB of Arch Linux&lt;/h2&gt;&lt;p&gt;Flash the image to a USB drive using Etcher. Alternatively you can use the dd command. Just ensure that /path/to/archlinux.iso is to where you have downloaded the image and that /dev/sdx is your USB drive.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;dd bs=4M if=/path/to/archlinux.iso of=/dev/sdx status=progress &amp;amp;&amp;amp; sync&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Boot the Live Environment&lt;/h2&gt;&lt;p&gt;I wanted to make sure that the Thinkpad was using UEFI as I would be using EFISTUB to load the Linux kernel as an EFI executable. This is done through the BIOS which can be gotten to by pressing the ThinkVantage button as the machine is booting before pressing F1 to get to the BIOS settings. From there navigate to Startup and changed the UEFI/Legacy Boot option to be UEFI Only. Press F10 to save and exit the BIOS and then power down the machine.&lt;/p&gt;&lt;p&gt;With the USB drive plugged in power the machine back on, all the while pressing F12 until the boot menu appears and select USB HDD: Mass Storage Device and wait for the installation image to boot. When prompted select Arch Linux archiso X86_64 UEFI CD where you will be take to the live environment's terminal. &lt;/p&gt;&lt;h2&gt;Set the Keyboard Layout&lt;/h2&gt;&lt;p&gt;The default console map is US which meant that for me pressing Shift+3 was displaying the hash symbol (#) instead of the pound symbol (£). So the UK keyboard layout needed to be loaded.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ loadkeys uk&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can get a list of supported keyboard layouts if you need to load a different one.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;ls /usr/share/kbd/keymaps/**/*.map.gz&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Verify the Boot Mode&lt;/h2&gt;&lt;p&gt;To verify that the Thinkpad has UEFI enabled check that the efivars directory exists.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ ls /sys/firmware/efi/efivars&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Connect to the Internet&lt;/h2&gt;&lt;p&gt;Verify that the machine can connect to the internet with the ping command.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ ping -c3 davidtsadler.com&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Before booting the machine I plugged in an Ethernet cable that was connected directly to my home network's router. The installation environment detected the network connection and obtained an IP address via DHCP. &lt;/p&gt;&lt;h2&gt;Update the System Clock&lt;/h2&gt;&lt;p&gt;Ensure the system clock is correct.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ timedatectl set-ntp true&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Partition the Disks&lt;/h2&gt;&lt;p&gt;Use the lsblk command to determine which disks and partitions exist on the system.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ lsblk

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0    7:0    0   535M  1 loop /run/archiso/sfs/airootfs
sda      8:0    0 298.1G  0 disk
sdb      8:16   1   7.4G  0 disk
├─sdb1   8:17   1   652M  0 part /run/archiso/bootmnt
└─sdb2   8:18   1    64M  0 part&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;From the above output I could see that my hard drive was sda as sdb was the USB drive and loop0 could just be ignored.&lt;/p&gt;&lt;p&gt;I knew that I wanted to have an encrypted partition and make use of LVM on it so my disk layout would be.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;+-------------------+ +--------------------------------------------------------+
| Boot partition    | | Logical volume 1 | Logical volume 2 | Logical volume 3 |
|                   | |                  |                  |                  |
| /boot             | | /                | [SWAP]           | /home            |
|                   | |                  |                  |                  |
|                   | | 50G              | 16G              | 200G             |
|                   | |                  |                  |                  |
|                   | | /dev/vg0/root    | /dev/vg0/swap    | /dev/vg0/home    |
|                   | |_ _ _ _ _ _ _ _ _ |_ _ _ _ _ _ _ _ _ |_ _ _ _ _ _ _ _ _ |
|                   | |                                                        |
|                   | |              LUKS2 encrypted partition                 |
| /dev/sda1 (512MB) | |                    /dev/sda2                           |
+-------------------+ +--------------------------------------------------------+&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The hard drive would be split into two partitions. The first, sdb1 would be 512MB in size and mounted in the file system at /boot. This would be the EFI system partition. The reminder of the disk space would be given to the partition sda2 and encrypted using LUKS2. LVM would then be used to create the volume group vg0 that would be divided into three partitions as logical volumes.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;/dev/vg0/root 50G root partition.&lt;/li&gt;&lt;li&gt;/dev/vg0/swap 16G swap partition.&lt;/li&gt;&lt;li&gt;/dev/vg0/home 200G home partition.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Use fdisk to create the partitions.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ fdisk /dev/sda&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Enter g to create a new empty GPT partition table&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;Command (m for help): g
Created a new GPT disklabel (GUID: 6987D065-936E-1547-9F02-F78145025A96).&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Since this is a UEFI system there must be a EFI partition at the beginning of the disk. Enter n to add a new partition and enter 1 to assign it as the first partition. Use the default value for the first sector but enter +512M for the last sector.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;Command (m for help): n
Partition number (1-128, default 1): 1
First sector (2048-625142414, default 2048): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-625142414, default 625142414): +512M

Created a new partition 1 of type 'Linux filesystem' and of size 512 MiB.&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Enter t to change the partition type and enter 1 to make it an EFI System. You can also get a list of partition types by pressing L.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;Command (m for help): t
Selected partition 1
Partition type (type L to list all types): 1
Changed type of partition 'Linux filesystem' to 'EFI System'.&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To create the second partition enter n again to add another partition, and then enter 2 to assign it as the second partition. Use the default values for both first and last sectors to allocate the remainder of the drive.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;Command (m for help): n
Partition number (2-128, default 2): 2
First sector (1050624-625142414, default 1050624): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (1050624-625142414, default 625142414): 

Created a new partition 2 of type 'Linux filesystem' and of size 297.6 GiB.&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Enter w to write the changes and quit.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Use lsblk to confirm that two partitions have been created.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ lsblk /dev/sda

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 298.1G  0 disk
├─sda1   8:1    0   512M  0 part
└─sda2   8:2    0 297.6G  0 part&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;LUKS&lt;/h2&gt;&lt;p&gt;Encrypt the second partition with the cryptsetup command. &lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ cryptsetup luksFormat /dev/sda2&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;When prompted enter YES in capitals to overwrite any data that is currently on the partition. &lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;WARNING!
========
This will overwrite data on /dev/sda2 irrevocably.

Are you sure? (Type 'yes' in capital letters): YES&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Enter and verify a passphrase. Whenever the machine is now booted you will be prompted to enter this passphrase in order for the partition to be decrypted.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;Enter passphrase for /dev/sda2: 
Verify passphrase: 
cryptsetup luksFormat /dev/sda2  17.01s user 1.05s system 105% cpu 17.106 total&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;LVM on LUKS&lt;/h2&gt;&lt;p&gt;Before setting up LVM decrypt the partition.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ cryptsetup open /dev/sda2 cryptlvm&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You will be prompted to enter the passphrase that you set up earlier.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;Enter passphrase for /dev/sda2: 
cryptsetup open /dev/sda2 cryptlvm  6.48s user 0.36s system 92% cpu 7.436 total&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Create a physical volume.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ pvcreate /dev/mapper/cryptlvm&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Create a volume group called vg0.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ vgcreate vg0 /dev/mapper/cryptlvm&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Create three logical volumes for the root, swap and home partitions.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ lvcreate -L 50G vg0 -n root
$ lvcreate -L 16G vg0 -n swap
$ lvcreate -L 200G vg0 -n home&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Make use of lsblk again to verify that LVM has been setup as expected.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ lsblk /dev/sda

NAME           MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda              8:0    0 298.1G  0 disk  
├─sda1           8:1    0   512M  0 part  
└─sda2           8:2    0 297.6G  0 part  
  └─cryptlvm   254:0    0 297.6G  0 crypt 
    ├─vg0-root 254:1    0    50G  0 lvm   
    ├─vg0-swap 254:2    0    16G  0 lvm   
    └─vg0-home 254:3    0   200G  0 lvm&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Format the Partitions&lt;/h2&gt;&lt;p&gt;Format the boot partition at /dev/sda1 with a FAT32 file system as the UEFI specification requires the usage of it.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ mkfs.fat -F32 /dev/sda1&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The root and home partitions can be formatted with ext4.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ mkfs.ext4 /dev/vg0/root
$ mkfs.ext4 /dev/vg0/home&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Initialise the swap partition.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ mkswap /dev/vg0/swap
$ swapon /dev/vg0/swap&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Mount the File Systems&lt;/h2&gt;&lt;p&gt;Mount the root partition into /mnt.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ mount /dev/vg0/root /mnt&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Mount the boot partition into /mnt/boot. &lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ mkdir /mnt/boot
$ mount /dev/sda1 /mnt/boot&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Finally mount the home partition into /mnt/home.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ mkdir /mnt/home
$ mount /dev/vg0/home /mnt/home&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Select the Mirrors&lt;/h2&gt;&lt;p&gt;All mirror servers defined in /etc/pacman.d/mirrorlist where done at the time the installation image was built. Since it's ideal to try and use servers that are close to your location you can rebuild the list using the rankmirrors utility. This is not included by default on the live environment so you will need to download it.&lt;/p&gt;&lt;p&gt;First sync the pacman repository.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;pacman -Syy&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then download the pacmain-contrib package which contains the rankmirrors utility.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ pacman -S pacman-contrib&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The official Pacman Mirrorlist Generator can be used to get an up-to-date list of servers for your country. The below command obtains a list of UK servers that support https and pass it to rankmirrors to obtain the 5 fastest.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ curl -s &amp;quot;https://www.archlinux.org/mirrorlist/?country=GB&amp;amp;protocol=https&amp;amp;use_mirror_status=on&amp;quot; | sed -e 's/^#Server/Server/' -e '/^#/d' | rankmirrors -n 5 - &amp;gt; /etc/pacman.d/mirrorlist&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Install Essential Packages&lt;/h2&gt;&lt;p&gt;The pacstrap script is used to install the base package, Linux kernel and firmware.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ pacstrap /mnt base linux linux-firmware neovim wpa_supplicant dhcpcd cryptsetup lvm2 efibootmgr intel-ucode&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;I also installed a few other packages that I knew I was going to need.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;neovim. Allows you to edit files instead of using nano.&lt;/li&gt;&lt;li&gt;wpa_supplicant. Provides tools for connecting to a WPA2 protected wireless network.&lt;/li&gt;&lt;li&gt;dhcpcd. Needed so that you machine can obtain an IP address from your home router via dhcp.&lt;/li&gt;&lt;li&gt;cryptsetup. Since the partition is encrypted this package is required in order for it to be decrypted during booting. &lt;/li&gt;&lt;li&gt;lvm2. Provides the LVM tools to manage the LVM partition.&lt;/li&gt;&lt;li&gt;efibootmgr. Needed to configure the system to boot via UEFI.&lt;/li&gt;&lt;li&gt;intel-ucode. Enables microcode updates during boot.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Fstab&lt;/h2&gt;&lt;p&gt;Create a fstab file on the new system.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ genfstab -U /mnt &amp;gt;&amp;gt; /mnt/etc/fstab&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Chroot&lt;/h2&gt;&lt;p&gt;Use arch-chroot to enter the new system as the root user. From now on you will be configuring the new system.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ arch-chroot /mnt&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Time Zone&lt;/h2&gt;&lt;p&gt;Setup the timezone. Replace Europe/London with your timezone.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Update the hardware clock.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ hwclock --systohc&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Localization&lt;/h2&gt;&lt;p&gt;Use nvim to edit /etc/locale.gen.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ nvim /etc/locale.gen&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Uncomment your preferred language. For me this meant en_GB.UTF-8 UTF-8. Save the file and exit before generating the locales.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ locale-gen&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Edit /etc/locale.conf.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ nvim /etc/locale.conf&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Add the below line. Replace en_GB.UTF-8 with the language that you chose earlier.&lt;/p&gt;&lt;pre&gt;LANG=en_GB.UTF-8&lt;/pre&gt;&lt;p&gt;If you used loadkeys earlier you will need to edit /etc/vconsole.conf and add your chosen keymap.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ nvim /etc/vconsole.conf&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;For me this meant adding the UK keymap.&lt;/p&gt;&lt;pre&gt;KEYMAP=uk&lt;/pre&gt;&lt;h2&gt;Network Configuration&lt;/h2&gt;&lt;p&gt;Create the file /etc/hostname and add an entry to it. This hostname will be the name of the machine on your network. I tend to name by devices after characters from the book Howl's Moving Castle https://en.wikipedia.org/wiki/Howl%27s_Moving_Castle).&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ echo suliman &amp;gt; /etc/hostname&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You then need to edit the /etc/hosts file.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ nvim /etc/hosts&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Add the following lines to this file. Replace suliman with the hostname you set up earlier.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;127.0.0.1	localhost
::1		    localhost
127.0.0.1	suliman.localdomain suliman&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Wireless&lt;/h2&gt;&lt;p&gt;Use the ip command to determine the name of the wireless network interface.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ip link

1: lo: &amp;lt;LOOPBACK,UP,LOWER_UP&amp;gt; mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp0s25: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether f0:de:f1:86:e1:75 brd ff:ff:ff:ff:ff:ff
3: wwp0s29u1u4: &amp;lt;BROADCAST,MULTICAST&amp;gt; mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 86:06:37:c4:9b:41 brd ff:ff:ff:ff:ff:ff
4: wlan0: &amp;lt;BROADCAST,MULTICAST&amp;gt; mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 08:11:96:02:10:ac brd ff:ff:ff:ff:ff:ff&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Looking at the output of the ip command this is wlan0. This name however will not be the name of the interface once the installation has been completed. You see the Arch installation environment does not use predictable names for interfaces. This is due to it using iwd which is unable to cope with interface renaming and so it is disabled for wireless interfaces. When the system boots into the installed system predictable names for interfaces will be enabled and wlan0 will be assigned a different name.&lt;/p&gt;&lt;p&gt;In order to find out what name will be assigned use the udevadm command.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ udevadm test-builtin net_id /sys/class/net/wlan0

Load module index
Parsed configuration file /usr/lib/systemd/network/99-default.link
Parsed configuration file /usr/lib/systemd/network/80-iwd.link
Created link configuration context.
Using default interface naming scheme 'v245'.
ID_NET_NAMING_SCHEME=v245
ID_NET_NAME_MAC=wlx0811960210ac
ID_OUI_FROM_DATABASE=Intel Corporate
ID_NET_NAME_PATH=wlp3s0
Unload module index
Unloaded link configuration context.&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;What we are interested in is the value of ID_NET_NAME_PATH which is wlp3s0.&lt;/p&gt;&lt;p&gt;My wireless network is a WPA2 protected network with a hidden SSID. Since wpa_supplicant has been installed when running pacstrap it is possible to use wpa_passphrase to generate the configuration file that wpa_supplicant will use to connect to the wireless network. Replace &amp;amp;lt;SSID&amp;amp;gt; and &amp;amp;lt;PASSWORD&amp;amp;gt; with your details. Note that the name of the configuration file contains the name of the network interface wlp3s0. Replace this with the name of your network interface.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ wpa_passphrase &amp;lt;SSID&amp;gt; &amp;lt;PASSWORD&amp;gt; &amp;gt; /etc/wpa_supplicant/wpa_supplicant-wlp3s0.conf&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If your wireless network uses a hidden SSID you will need to edit the configuration file.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ nvim /etc/wpa_supplicant/wpa_supplicant-wlp3s0.conf&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And add the below line. &lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;scan_ssid=1&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Make sure that wpa_supplicant starts at boot.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ systemctl enable wpa_supplicant@wlp3s0.service&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Have an IP address assigned via DHCP during booting.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ systemctl enable dhcpcd@wlp3s0.service&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Initramfs&lt;/h2&gt;&lt;p&gt;You will need to rebuild the initial ramdisk and the current one is not aware that the filesystem will be encrypted. Before rebuilding it some configuration changes need to be made.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ nvim /etc/mkinitcpio.conf&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Locate the section where the HOOKS are configured and replace it with the line below.&lt;/p&gt;&lt;pre&gt;HOOKS=(base udev autodetect keyboard keymap modconf block encrypt lvm2 filesystems fsck)&lt;/pre&gt;&lt;p&gt;This ensures that the keyboard is present before the filesystem is detected so that you are enter the passphrase to decrypt the partition. It also ensures that the decryption is done before the LVM is handled.&lt;/p&gt;&lt;p&gt;Save the changes and exist before rebuilding with the mkinitcpio command. &lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;mkinitcpio -P&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;EFISTUB Booting and Microcode&lt;/h2&gt;&lt;p&gt;The Thinkpad X220 UEFI implementation allows an operating system to be booted without the need for an intermediate bootloader such as GRUB. It is possible to add a UEFI boot entry to the motherboard itself and have Arch booted directly.&lt;/p&gt;&lt;p&gt;Modifying the motherboard boot entries is done using efibootmgr. However usage of this command can be quite verbose so it is recommended to create a shell script instead. &lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;nvim /usr/local/sbin/mkefibootentry&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The shell script will call efibootmgr with the required arguments. &lt;/p&gt;&lt;pre&gt;#!/bin/sh

# Determine the UUID of the partition that is encrypted
PARTUUID=`blkid /dev/sda2 -s PARTUUID -o value`

efibootmgr \
  --disk /dev/sda --part 1 \
  --create --label &amp;quot;Arch Linux&amp;quot; \
  --loader /vmlinuz-linux \
  --unicode 'cryptdevice=PARTUUID='$PARTUUID':cryptlvm root=/dev/vg0/root rw initrd=\intel-ucode.img initrd=\initramfs-linux.img' \
  --verbose &lt;/pre&gt;&lt;p&gt;The --unicode argument is where the kernel parameters are specified. This tells the system that the partition identified by PARTUUID is encrypted and that the root filesystem to mount is the logical volume called root that is part of the volume group vg0. The microcode is also loaded with initrd=\intel-ucode.img.&lt;/p&gt;&lt;p&gt;Make this script executable.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;chmod u+x /usr/local/sbin/mkefibootentry&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Run the script to add to the motherboard boot entries.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ mkefibootentry&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Root Password&lt;/h2&gt;&lt;p&gt;Create a secure password for the root user.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ passwd&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Reboot&lt;/h2&gt;&lt;p&gt;Return to the Arch live installation environment.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ exit&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Unmount the partitions.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ umount -R /mnt&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Restart the machine with reboot. Remember to remove any installation media such as a USB drive.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;$ reboot&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Provided nothing has gone wrong your machine will boot into a fresh installation of Arch Linux. Don't forget that during the boot you will be prompted to enter the passphrase to decrypt the system partition. &lt;/p&gt;&lt;p&gt;Following this guide will leave you with a very minimal system where you can login as the root user. From this point how you configure the system is up to you as it will be very different to how I configure my own. If you interested in seeing how I do it then see my other posts on the subject. &lt;/p&gt;&lt;h3&gt;Links&lt;/h3&gt;&lt;a href=&quot;https://www.archlinux.org/Installation_guide/&quot;&gt;Offical Arch Installation Guide.&lt;/a&gt;&lt;a href=&quot;https://www.archlinux.org/download/&quot;&gt;Arch Linux Download Page.&lt;/a&gt;&lt;a href=&quot;https://www.balena.io/etcher/&quot;&gt;Etcher.&lt;/a&gt;&lt;a href=&quot;https://www.archlinux.org/mirrorlist/&quot;&gt;Pacman Mirrorlist Generator.&lt;/a&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Howl%27s_Moving_Castle/&quot;&gt;Wikipedia Entry for Howl's Moving Castle.&lt;/a&gt;&lt;a href=&quot;/posts/arch/&quot;&gt;Arch - Read More Posts.&lt;/a&gt;&lt;p&gt;I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.&lt;/p&gt;&lt;a href=&quot;mailto:david@davidtsadler.com&quot;&gt;Email david@davidtsadler.com&lt;/a&gt;&lt;h3&gt;License&lt;/h3&gt;&lt;a href=&quot;https://creativecommons.org/licenses/by-sa/4.0/&quot;&gt;The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.&lt;/a&gt;&lt;p&gt;Copyright © 2021 David T. Sadler.&lt;/p&gt;&lt;a href=&quot;/&quot;&gt;Return to Homepage.&lt;/a&gt;</content>
</entry>
</feed>