archlinux-YYYY.MM.DD-x86_64.iso
from Arch Linux DownloadsBoot Arch Linux (x64_64)
ls /sys/firmware/efi/efivars
to check if you need UEFI
ip link
and verify the network intterface is listed and enabledping archlinux.org
to verify internet connectionctrl+c
to stop pingingtimedatectl set-ntp true
to update the system clocktimedatectl status
to check itlsblk
or fdisk -l
to see your disk devicesfdisk /dev/sda
, you may type m
for helpp
to print out everything that is in the drived
to delete partitions for each partition in the listn
to create a new partition, p
for primary, and 1
Enter
to keep first sector default+256M
to set the partition size to 256MBY
n
to create a new partition, p
for primary, and 2
Enter
to keep first sector default+8G
to set the partition size to 8GB (Rule of thumb is 1x RAM size)n
to create a new partition, p
for primary, and 3
Enter
to keep first sector default+24G
to set the partition size to 24GBn
to create a new partition, p
for primary, and 4
Enter
to keep first sector defaultEnter
to fill up the last sector will the remaining spacep
to print everything. DOUBLE CHECK BEFORE MOVING ON!w
to writelsblk
to see your disk devicesmkfs.ext4 /dev/sda1
for boot partitionmkfs.ext4 /dev/sda3
for root partitionmkfs.ext4 /dev/sda4
for home partitionmkswap /dev/sda2
to make the swap partitionswapon /dev/sda2
to initialize itmount /dev/sda3 /mnt
to mount the root partitionmkdir /mnt/boot
to create the boot directorymkdir /mnt/home
to create the home directoryls /mnt
and you should see “boot home lost+found”mount /dev/sda1 /mnt/boot
to mount the boot directorymount /dev/sda4 /mnt/home
to mount the home directorypacstrap /mnt base base-devel linux linux-firmware vim
genfstab -U /mnt >> /mnt/etc/fstab
to generate an fstab filevim /mnt/etc/fstab
to check itarch-chroot /mnt
to navigate out of the usb arch linux and into the computer’s root directory.ls
to verifyls /usr/share/zoneinfo
to browse the time zone optionsln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
to link the localtime file to your time zonedate
and verify the date and timehwclock --systohc
vim /etc/locale.gen
en_US.UTF-8 UTF-8
and en_US ISO-8859-1
locale-gen
to generate the localesvim /etc/locale.conf
to create the configuration file and write LANG=en_US.UTF-8
vim /etc/hostname
and write in a hostnamevim /etc/hosts
and add:
127.0.0.1 localhost
::1 localhost
127.0.1.1 myhostname.localdomain myhostname
pacman -S networkmanager
to install itsystemctl enable NetworkManager
to automatically start it on bootpasswd
to set the root passwordpacman -S grub
to install itgrub-install --target=i386-pc /dev/sda
to install grub on your machinegrub-mkconfig -o /boot/grub/grub.cfg
to make the configuration fileexit
to leave the computer’s root directory and back to the usb arch linux directoryumount -R /mnt
to unmount all partitions and type lsblk
to verifyshutdown now
to shutdown the computer, remove the usb drive, then start the computerInstalling or reinstalling(or updating) LARBS:
sudo su
to ensure you are super usercd ~
to navigate too the root/
directorypacman -Syu
to ensure all the arch packages are up to datecurl -LO larbs.xyz/larbs.sh
to get the larbs shell scriptsh larbs.sh
and follow the prompsNotes:
Definition | Description |
---|---|
kernel |
A program at the core of a computer’s operating system and has complete control over everything in the system (e.g. Linux). |
operating system |
Software that manages computer hardware, software resources, and provides common services for computer programs (e.g GNU, Ubuntu, Arch, etc.). |
terminal |
Device or emulator used to execute commands to interact with the computer. |
shell |
The user interface used to interact with the linux kernel and operating system (e.g. sh, bash). |
$ |
Indicates you are logged in as a user. |
# |
Indicates you are logged in as root. |
root |
The superuser account with all administrative capabilities. |
user |
An entity that can perform operations. |
group |
A collection of users. |
package |
A collection of files that perform a task. |
package manager |
A program that manages packages (e.g. dpkg, apt, pacman). |
repository |
A storage location (typically a server) that has a collection of software. |
daemon |
A long-running backgroung process that answers requests for services. |
process |
An instance of a running program. |
Helpful tips:
compgen -c
to list all commands that could be executedman [command]
to print the user manual for that command[command] -h (or --help)
to also view information about that commandapropos [keyword]
to search the manuals for that keywordctrl+a
to get to the front of your command (useful if you forgot to type sudo in front of a command)uparrow
to get previous commands&&
between commands to execute them one one line in the terminal|
between commands to pipe, or send output, of one command to another for further processingCommand | Description |
---|---|
compgen |
list all the commands that could be executed |
man |
an interface to the system reference manuals |
apropos |
search the manual page names and descriptions |
cat |
concatenate files and print on stdout (or shell) |
pwd |
print workind directory |
ls |
list directory |
cd |
change directory |
whoami |
who am I (prints current user name) |
clear |
clear terminal screen |
mkdir |
make directory |
rmdir |
remove empty directory |
rm |
remove files or directories |
cp |
copy files or directories |
mv |
move files or directories |
ln |
make hard or symbolic links |
chown |
change file owner and group |
chmod |
change file permissions |
dd |
convert and copy a file |
df |
report file system disk space usage |
tar |
tar archiver |
less |
terminal pager |
find |
search files or directories |
diff |
compare files line by line |
grep |
print lines matching a pattern |
sed |
stream editor |
awk |
pattern scanning and processing language |
dmesg |
print or control the kernel ring buffer |
lsblk |
list block devices |
mount |
mount a filesystem |
umount |
unmount a filesystem |
su |
substitute user |
sudo |
superuser do |
exit |
cause normal process termination |
kill |
terminate a process |
pgrep |
look up processes by name or attributes |
ps |
report a snapshot of the current processes |
pstree |
shows running processes as a tree |
free |
display amount of free and used memory |
which |
identify the location of executables |
id |
print real and effective user and group IDs |
uname |
print system information |
ip |
print network information |
netstat |
print status of the network |
ifconfig |
configure a network interface |
who |
show who is logged on |
env |
print environment variables |
scp |
secure copy files and directories between locations |
The Filesystem Hierarchy Standard (FHS) defines the directory structure and directory contents in Linux distributions. Everything in linux is represented by a file including devices, commands, and settings.
Directory | Description |
---|---|
/ |
Root directory of entire filesystem hierarchy. |
/bin |
Essential command binaries that need to be available in single user mode; for all users, e.g., cat, ls, cp. |
/boot |
Boot loader files, e.g., kernels, initrd. |
/dev |
Device files. |
/etc |
Host-specific system-wide configuration files. |
/home |
Users’ home directories, containing saved files, personal settings, etc. |
/lib |
Libraries essential for the binaries in /bin and /sbin . |
/lib64 |
Alternative format essential libraries. |
/lost+found |
Orphaned or corrupted files are places here. |
/mnt |
Temporarily mounted filesystems. (or /media) |
/opt |
Optional application software packages. |
/proc |
Virtual filesystem providing process and kernel information as files. |
/root |
Home directory for the root user. |
/run |
Run-time variable data. |
/sbin |
Essential system binaries, e.g., fsck, init, route. |
/srv |
Site-specific data served by this system. |
/sys |
Contains information about devices, drivers, and some kernel features. |
/tmp |
Temporary files. (or /temp) |
/usr |
Secondary hierarchy for read-only user data; contains the majority of (multi-)user utilities and applications. |
/var |
Variable files—files whose content is expected to continually change during normal operation of the system. |
Users and Groups are used on GNU/Linux for access control to system files, directories, and peripherals.
Adding users:
sudo useradd -m [username]
to add a user (-m creates home directory)sudo passwd [username]
to add a passwordcat /etc/passwd
to view the user file: [username]:x:[user_id]:[group_id]:[name_and_comments]:[home_dir]:[default_shell]
Adding a group:
sudo groupadd [groupname]
sudo gpasswd [groupname]
to add a passwordcat /etc/group
to view the group file: `[groupname]:x:[group_id]Modifying user account:
usermod
(to view capabilities type man usermod
)Giving a user admin privileges:
sudo
before commands)export EDITOR=vim
to set vim as the visudo editor instead of nanovisudo
to properly edit /etc/sudoers
User privilege specification
type [username] All=(All) All
ctrl+x
to exit out of the file if using nanoreboot
to restart computersudo ls
to test if user has sudo accessDeleting users or groups:
sudo userdel [username]
to delete usersudo groupdel [groupname]
to delete a groupPacman is an Arch Linux package management utility that tracks installed packages. It should already be installed through the base package.
Command | Description |
---|---|
pacman -S [package] |
install package |
pacman -Syu |
update package database and upgrade installed packages |
pacman -Sy |
update package database |
pacman -Su |
upgrade installed packages |
pacman -Syy |
force update of package database even if recently updated |
pacman -Syyuw |
download programs but leave them uninstalled (for manual install) |
pacman -R [package] |
remove package |
pacman -Rs |
remove package as well as unneeded dependencies |
pacman -Rns |
remove package, dependencies, and system config files (reccomended) |
pacman -Q |
display all installed packages |
pacman -Q | wc -l |
display total number of installed packages by countint lines of output |
pacman -Qe |
display only packaged explicitly installed |
pacman -Qeq |
display only names of explicitly installed packages and not version numbers |
pacman -Qn |
display only packages installed from main repositories |
pacman -Qm |
display only packages installed from AUR |
pacman -Qdt |
display orphaned dependencies |
pacman -Ss |
search remote repository for package |
pacman -Qs |
search local repository for package |
Listing processes:
systemd
is the “master daemon” or a system and service manager. When linux boots, systemd is the first service started and controls mounting the file system and starting all the services. Also note that systemd calls services or daemons “units”.ps -aux
to see every process on the system (remember a process is an instance of a running program.ps -aux | grep [process]
to filter out all but the particular processpstree
to see every process as a treeUsing systemctl
to control services:
systemctl status [service]
to view the status of a servicesystemctl is-active [service]
to view if the service is currently activesystemctl is-enabled [service]
to view if the service is currently enabled to start at bootsystemctl start [service]
to start a servicesystemctl stop [service]
to stop a servicesystemctl restart [service]
to restart a servicesystemctl reload [service]
to reload a servicesystemctl enable [service]
to start a service at bootsystemctl disable [service]
to not start a service at bootsystemctl list-units
to list all active (in memory) services, devices, et. al. (use -t service
to only list services)systemctl list-units | grep [service]
to list the particular servicesystemctl list-unit-files
to list all services, devices, et. al.sudo pacman -S openssh
to install sshsudo vim /etc/ssh/sshd_config
to edit the config filesudo systemctl enable sshd.service
to enable service startup on bootsudo systemctl start sshd.service
to start the serviceip addr
to retrieve your local IP address (it’s by “inet”, for example 192.168.1.xxx/yy)ssh -p 22 <username>@<ipaddress>
to ssh into the machine/dev
dmesg | tail
, fdisk -1
, or lsblk
to see the assigned disk device name and partition namemkdir /mnt/<directory>
to create a new mount pointmount /dev/<partition> /mnt/<directory>
to mount the device filesystem to your linux filesystemmount | grep <partition>
to verify device has been mounted correctly (no output means partition was not mounted)cd /mnt/<directory>
to access the data from the mount pointumount
to make sure no process is currently using the mount point directoryumount /mnt/<directory>
to unmount the device partitioneject /dev/<partition>
to safely eject the device from your computerMan lets you read package manuals.
sudo pacman -S man-db
to installman [package]
to view the package’s manualYay or Yet Another Yogurt is a n AUR Helper Written in Go.
git clone https://aur.archlinux.org/yay.git
to clone the yay repocd yay
makepkg -si
yay --version
to verify installGit is the version control system (VCS) designed and developed by Linus Torvalds, the creator of the Linux kernel.
sudo pacman -S git
to install gitmkdir ~/.config/git
to create a git config directorygit config --global user.name John Doe
git config --global user.email johndoe@example.com
git config --list
to check the user git settingsgit clone https://github.com/ddigiorg/ddigiorg.github.io.git
to clone ddigiorg’s websitePip is the package installer for Python.
pip install [package]
to install a particular Python package (might need to use pip3 to specify Python3)pip install -r requirements.txt
to install the Python packages listed in the requirements.txt fileMake is a build automation tool that automatically builds executable programs and libraries from source code by reading files called Makefiles which specify how to derive the target program.
sudo pacman -S make
to install makemake --version
to verify installationXorg (commonly referred as simply X) is the most popular display server among Linux users.
sudo pacman -S xorg-server xorg-xinit xterm
to install X, xinit, and xtermlspci | grep -e VGA -e 3D
to identify the graphics cardsudo pacman -Ss xf86-video
to search the remote package database for a list of open-source video driverssudo pacman -S [driver package]
to install the driver (My ThinkPad x220 uses xf86-video-intel
)startx
to testexit
in left terminal to exitcp etc/X11/xinit/xinitrc .xinitrc
to copy root xinit config file to user.config/Xresources
!xrdb .config/Xresources
pacman -S ttf-linux-libertine ttf-liberation
to install these fontsBrave is a web browser that blcoks ads and trackers by default.
yay -S brave-bin
to install bravebrave --version
to verify installbrave
to launch braveDWM is a dynamic window manager for X.
cd ~/.local/src
to navigate to the appropriate directorygit clone https://git.suckless.org/dwm
to clone the dwm reposudo vim config.mk
and set:
X11INC = /usr/include/X11
X11LIB = /usr/lib/X11
sudo make clean install
to install dwm~/.xinitrc
add exec dwm
ST is a simple terminal implementation for X.
cd ~/.local/src
to navigate to the appropriate directorygit clone https://git.suckless.org/st
to clone st reposudo make clean install
to install stAlt+Shift+Enter
SXHKD is a simple X hotkey daemon that reacts to input events by executing commands.
sudo pacman -S sxhkd
to install sxhkdvim ~/.config/sxhkd/sxhkdrc
to edit the config file~/.xinitrc
put export XDG_CONFIG_HOME="$HOME/.config"
and sxhkd &
systemctl --user restart sxhkd
to reload the user’s sxhkd serviceCreate a virtual hard disk now
VDI (VirtualBox Disk Image
Dynamically allocated
Create
Settings...
System
set Processor
to 2 coresDisplay
set
Storage
under Controller: IDE
add a new optical drive and navigate to the archlinux-YYYY.MM.DD-x86_64.iso
(Note: see Arch Linux install for download details)pacman -S virtualbox-guest-utils xf86-video-vmware
and make sure you select virtualbox-guest-modules-arch
systemctl enable vboxservice.service
reboot
NetworkChuck’s tutorials (for complete newbies):