JustToThePoint English Website Version
JustToThePoint en español
JustToThePoint in Thai

Installing Arch from Scratch II.

Microsoft gives you Windows, Linux gives you the whole house.

Arch Linux is an independently developed, free and open-source, rolling release distribution. It is a minimalist, lightweight, and bleeding edge distribution that targets advanced users.

Installing Arch is challenging and time consuming. However, you end up with a system you understand very well and set up the way you want. Arch Linux challenges you to build your PC’s operating system yourself. Talk is cheap. Show me the code, Linus Torvalds.

Update the System

sudo pacman -Syu

Configuring PacMan

Let’s set up PacMan. Reflector is a Python script that can retrieve the latest mirror list from the Arch Linux Mirror Status page.

sudo pacman -Sy reflector
sudo reflector --verbose --country 'Spain' --latest 5 --sort rate --save /etc/pacman.d/mirrorlist

It filters the most up-to-date mirrors from your location, sorts them by speed, and overwrites the file /etc/pacman.d/mirrorlist.

sudo sed -i '/Color/s/^#//' /etc/pacman.conf # It adds color to the package manager.
sudo sed -i '/Color/a ILoveCandy' /etc/pacman.conf
sudo sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf
sudo sed -i '/Color/s/^#//' /etc/pacman.conf # It adds color to the package manager.
  1. sed ‐‐in-place edits text on the file /etc/pacman.conf. The syntax of the s (substitute) command is as follows: ‘s/regexp/replacement/flags’.
  2. First, the first pattern is: Color “/Color/”
  3. Next, we are going to do a search and replace “s” and we match the comment with the hash (#) character (pattern or match) at the beginning of the line: s/^#
  4. And replace it with nothing, in other words, remove it: //’. The end result is that we uncomment the color line in /etc/pacman.conf.
sudo sed -i '/Color/a ILoveCandy' /etc/pacman.conf

In this example, the pattern is: Color “/Color”, but we don’t search and replace text, but append “/a” the line “ILoveCandy” after the line where the matching condition applies. The end result is that we add the line ILoveCandy.

sudo sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf

Let’s explain it:

  1. sed ‐‐in-place edits text on the file /etc/pacman.conf. The syntax of the s (substitute) command is as follows: ‘s/regexp/replacement/flags’.
  2. First, the two patterns at the beginning are "/[multilib]/,/Include/", i.e., [multilib] and Include.
  3. Then, we can match the comment with the hash (#) character at the beginning of the line: ’s/^#
  4. And replace it with nothing, in other words, remove it: //'

The result is /etc/pacman.conf: […]
Color
ILoveCandy

[multilib] # It enables multilib in PacMan by uncommenting these two lines in pacman.conf. It is used to run 32-bit applications on a 64-bit system.
Include = /etc/pacman.d/mirrorlist

Post-Installation

echo "BASH TOOLS - https://wiki.archlinux.org/index.php/Bash"
sudo pacman -Sy --noconfirm curl bc rsync mlocate bash-completion reflector bash-completion bleachbit gtop neofetch zsh zsh-completions conky variety
sudo pacman -Sy --noconfirm ranger alacritty nautilus cmatrix newsboat bat tmux kitty powerline cowsay calcurse task zsh fish fortune-mod lolcat lsd firefox
sudo pacman -Sy --noconfirm cmatrix bat tmux cowsay calcurse taskd fish fortune-mod lsd stow copyq man-db wget scrot cron clamav copyq pulseaudio pavucontrol libpulse

echo "(UN)COMPRESS TOOLS - https://wiki.archlinux.org"
sudo pacman -Sy --noconfirm tar gzip bzip2 unzip unrar p7zip
echo "SSH - https://wiki.archlinux.org/index.php/Ssh"
sudo pacman -Sy --noconfirm openssh

echo "LibreOffice, gedit"
sudo pacman -Sy --noconfirm libreoffice-still hunspell gedit

echo "Graphics, Multimedia Codecs, Messaging, Utilities"
# Wine is a cross-platform “windows compatibility layer” that lets you run Windows programs from Linux (wine wine_gecko). Grsync is a GUI for rsync. 
sudo pacman -Sy --noconfirm htop grsync wine wine_gecko virtualbox-host-modules-arch virtualbox-guest-iso filezilla lollypop vlc barrier
sudo pacman -Sy --noconfirm gimp inkscape python2-numpy python-lxml blender mcomix kodi variety keepassxc gnupg pulseaudio pavucontrol libpulse
sudo pacman -Sy --noconfirm gparted rofi a52dec faac faad2 flac jasper lame libdca libdv libmad libmpeg2 libtheora libvorbis libxv wavpack x264 xvidcore barrier

# Installing fonts
sudo pacman -Sy --noconfirm noto-fonts noto-fonts-cjk noto-fonts-emoji ttf-hack ttf-roboto
sudo pacman -Sy --noconfirm ttf-ubuntu-font-family ttf-dejavu ttf-freefont ttf-liberation ttf-droid terminus-font ttf-font-awesome

# Installing Nerd Font
mkdir -p ~/.local/share/fonts
cd ~/.local/share/fonts
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/Hermit.zip
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/Hack.zip
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/FiraCode.zip
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/SourceCodePro.zip
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/DejaVuSansMono.zip
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/Meslo.zip
unzip "fc *.zip"
rm *.zip

After installing the fonts, fc-cache scans the font directories on the system and builds font information cache files for the system’s applications.

fc-cache -fv
# Theme
sudo pacman -Sy --noconfirm arc-gtk-theme deepin-gtk-theme gtk-engine-murrine papirus-icon-theme

Install Yay

Yat means Yet Another Yogurt - An AUR Helper Written in Go.

sudo pacman -S --needed git base-devel

# The Arch User Repository (AUR) is a community-driven repository for Arch users. It contains package descriptions (PKGBUILDs) that allow you to compile a package from source with makepkg and then install it via pacman. 
# First, we clone the project.
git clone https://aur.archlinux.org/yay.git
cd yay # And we move to its directory.
# Second, we build the package and install it.
makepkg -si
cd ..
rm -rf yay

# Install more fonts
sudo yay -S --noconfirm ttf-dejavu ttf-liberation ttf-ubuntu-font-family ttf-droid
# Install Spotify, Dropbox, Chrome, Nuclear Music Player, Rambox,  etc.
yay -S dropbox dropbox-cli google-chrome spotify rambox-bin nuclear-player-bin
# "Powerpill is a pacman wrapper that uses parallel and segmented downloading to try to speed up downloads for Pacman", Arch Wiki.
yay -S powerpill 

Installing i3

i3 is a minimalist tiling manager that is primarily targeted at developers and advanced users. First, you need to install a driver for your graphics card: sudo pacman -S xf86-video-intel (Intel Graphics driver), sudo pacman -S xf86-video-ati (ATI graphics drivers), etc.

How do you know which drivers to install?

user@pc:~$ lspci -k | grep -A 2 -E “(VGA|3D)”

My output is as follows:
01:00.0 VGA compatible controller: NVIDIA Corporation GM204 [GeForce GTX 970] (rev a1)
Subsystem: Micro-Star International Co., Ltd. [MSI] Device 3160
kernel driver in use: nvidia

#!/bin/bash
echo "Nvidia GPU driver installation"
pacman -S --noconfirm nvidia nvidia-utils nvidia-settings nvidia-dkms

We are going to install: xorg, Xorg is a display server that just works; dmenu/rofi, application launchers; lightdm, a cross-desktop login manager; nautilus, a file manager; picom, a compositing manager; alacritty/kitty, terminal emulators; nitrogen, a graphical wallpaper utility. PulseAudio is a sound server intended to run as a proxy or middleware between your applications and your hardware devices.

A display login manager is not necessary, it is just sugar candy to customize your login experience: Run your Virtual Machine with XOrg

pavucontrol is the PulseAudio Volume Control. Rofi is an alternative application launcher. archlinux-wallpaper are Arch Linux Wallpapers. Alacritty is a modern terminal emulator that comes with sensible defaults. picom is a standalone compositor for Xorg, suitable for use with window managers that do not provide compositing. lxappearance is a program to change GTK+ themes, icon themes, and fonts used by applications.

Image  

sudo pacman -S xorg-server xorg-apps xorg-xinit xorg-xset xorg-xrandr lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings i3 i3-gaps i3status i3lock
sudo pacman -S i3blocks numlockx picom tumbler gedit rofi lxappearance nitrogen archlinux-wallpaper alacritty
sudo pacman -S pcmanfm xarchiver
sudo pacman -S pulseaudio pavucontrol mplayer alsa-utils

# Enable lightdm service
sudo systemctl enable lightdm

Modern Linux distributions, including Arch Linux, have transitioned to using the Advanced Linux Sound Architecture (ALSA) as the default audio subsystem. ALAS utilizes different device files and configurations compared to OSS (Open Sound System, audio device file “/dev/dsp”).

PulseAudio Volume Control (pavucontrol) is a GTX volume control tool (“mixer”) for the PulseAudio sound server.

user@pc:~$ pavucontrol. Start with the rightmost Configuration tab, which lists your sound cards, e.g., GM204 High Definition Audio Controller (yes, NVIDIA High Definition GM204, is listed as a sound card). GM204 has multiple HDMI’s profiles listed but all appear as unplugged and unavailable, so select one that is available. Sound cards may have both analog and digital (iec958) outputs, too. I need to play using the command: mplayer -ao alsa:device=default file.mp3 so it will use the default ALSA device for audio playback. 💣MPlayer is still trying to use the OSS💣

Most Linux distributions come with a preinstalled file manager, because a file explorer is an integral part, e.g., Nautilus (GNOME), Dolphin (KDE), Thunar (Xfce), etc. PCManFM is a fast and lightweight file manager that’s full of features (install xarchiver, a front-end to various command line archiving tools for Linux, so you can extract files directly from the file manager). Xarchiver is a front-end to various command line archiving tools for Linux. Thunar provide highs functionality with only modest demands on system resource. It can also enhance its capabilities with plugins.

user@pc:~$ vim .config/pcmanfm/default/pcmanfm.conf # Edit PCManFM's configuration filemarkdown_content

	[ui]
	font=MesloLGS NF Medium 18 # Modify Font Settings

user@pc:~$ vim .gtkrc-2.0 # Edit Thunar configuration filemarkdown_content.
# There are a bunch of additional settings that can be customized via the GTK theme or the ~/.gtkrc-2.0 file in the users home directory.
	style "thunar-path-entry-increased-style"
   	{
    	 ThunarPathEntry::icon-size = 24
		 # The path entry displays an icon right before the path
		 # Increase the size to 24 pixels
   	}
	gtk-font-name="MesloLGS NF Medium 18"

Arch (i3) 

Restoring our dotfiles.

# First-Time git setup. Set your username and email address:
git config --global user.name "myName"
git config --global user.email myEmail@gmail.com

# Installing SSH and GnuPG
sudo pacman -Sy openssh gnupg

Let’s generate a SSH Ed25519 key-pair:

ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "myEmail@gmail.com"

The ssh-agent is a helper program that keeps track of your keys and their passphrases. Let’s add the newly generated Ed25519 key to the SSH Agent.

First, we need to make sure that the SSH agent is running by executing: eval “$(ssh-agent -s)” Next, let’s add our SSH private key to the ssh-agent:

ssh-add ~/.ssh/id_ed25519
echo "⚠️This step is absolutely essential⚠️!!!!!!!!!!!!"
echo "Copy the public key to your GitHub account:"
cat ~/.ssh/id_ed25519.pub

# Let's allow authentication to our computer using the recently created key by adding the public key to the list of allowed keys ~/.ssh/authorized_keys:
cat ~/.ssh/id_ed25519.pub > ~/.ssh/authorized_keys

# Let's migrate our dotfiles in github.com to the new computer. 
# First, we need to clone your repository.
git clone https://github.com/nmaximo7/dotfiles.git

You need a token and enter it instead of your password when performing Git operations over HTTPS. There is a cool mechanism in Git to avoid having to type your password over and over again: git config ‐‐global credential.helper store

Let’s stow the files and directories into their target directories. First, check that it is working as expected: stow ‐‐adopt -nvSt ~ *, then do it: stow ‐‐adopt -vSt ~ *

You may want to read our article Dotfiles with Git + GNU Stow..

More apps & AppImages

#!/bin/bash
sudo pacman -Syu fuse2 # Let's install some Appimages. AppImages require fuse to mount the embedded sqashfs filesystem.

mkdir -p ~/AppImages
cd ~/AppImages
# Ferdi, All your apps in one place. Find your Appimages in AppImageHub, https://appimage.github.io/apps/
wget ...Ferdi.AppImage
chmod a+x *
Bitcoin donation

JustToThePoint Copyright © 2011 - 2024 Anawim. ALL RIGHTS RESERVED. Bilingual e-books, articles, and videos to help your child and your entire family succeed, develop a healthy lifestyle, and have a lot of fun. Social Issues, Join us.

This website uses cookies to improve your navigation experience.
By continuing, you are consenting to our use of cookies, in accordance with our Cookies Policy and Website Terms and Conditions of use.