Skip to content

Instantly share code, notes, and snippets.

@dimmg
Last active April 14, 2021 15:40
Show Gist options
  • Save dimmg/447e9be2296ee85b4890d9c68edcf6d9 to your computer and use it in GitHub Desktop.
Save dimmg/447e9be2296ee85b4890d9c68edcf6d9 to your computer and use it in GitHub Desktop.
# check internet connection
ping -c 3 google.com
# update pacman database
pacman -Syy
# install reflector
pacman -S reflector
# setup reflector
reflector -c "US" -f 12 -l 10 -n 12 --save /etc/pacman.d/mirrorlist
# list partitions
fdisk -l
# repartition partitions
# make a new mkdos partition that is primary and bootable, then write
cfdisk {{ partition to partition from }}
# format newly created partition to ext4
mkfs.ext4 {{ created partition }}
# mount the disk to system
mount {{ created partition }} /mnt
# install base system
pacstrap -i /mnt base base-devel
# generate fstab file
genfstab -U -p /mnt >> /mnt/etc/fstab
# login to the new system as root
arch-chroot /mnt /bin/bash
# set locale of the system
# (e.g uncommenting en_US.UTF-8 UTF-8)
nano /etc/locale.gen
# generate locale
locale-gen
# set the clock according to the region
ln -sf /usr/share/zoneoinfo/Europe/Chisinau /etc/localtime
hwclock --systohc --utc
# set computer name
echo "thinkpad-t460" > /etc/hostname
# edit hosts file
# 127.0.1.1 localhost.localdomain thinkpad-t460
nano /etc/hosts
# enable network service
systemctl enable dhcpcd
# set password for root
passwd
# install grub bootloader
pacman -S grub efibootmgr
# find the efi partition if exists, otherwise create a new one
mkdir /boot/efi
mount /dev/sda<efi_partition> /boot/efi
# install grub to disk drive
grub-install /dev/sda
# generate configuration file for grub
grub-mkconfig -o /boot/grub/grub.cfg
# install microcode
sudo pacman -S intel-ucode
sudo grub-mkconfig -o /boot/grub/grub.cfg
# logout of the system
exit
# unmount the system
umount -R /mnt
# reboot and plug out the disk or usb
reboot
# login into root using the set password
# create a new user
useradd -m -g users -G wheel -s /bin/bash {{ username }}
# set password for new user
passwd {{ username }}
# add the new user to sudo group (uncommed %wheel ALL=(ALL) ALL)
EDITOR=nano visudo
# Enable Multilib repository
# nano /etc/pacman.conf
[multilib]
Include = /etc/pacman.d/mirrorlist
pacman -Syy
# logout of root
exit
# log in as new user
# install audio packages
sudo pacman -S pulseaudio pulseaudio-alsa
# install xorg server (first option leave by default, second needs to be 1 if the graphics are integrated)
sudo pacman -S xorg xorg-xinit
# create file initiation for the GUI (in this case KDE Plasma 5)
echo "exec startkde" > ~/.xinitrc
sudo pacman -S plasma-desktop
# install KDE plasma addons
sudo pacman -S kdeplasma-addons
# install bluetooth
sudo pacman -S bluez bluez-utils
# install audio control
sudo pacman -S plasma-pa
reboot
# install file manager
sudo pacman -S dolphin
# install file utilities
sudo pacman -S file-roller p7zip zip unzip unrar
# install multimedia codecs
sudo pacman -S gstreamer0.10-bad-plugins gstreamer0.10-base-plugins gstreamer0.10-ffmpeg
sudo pacman -S gstreamer0.10-good-plugins gstreamer0.10-ugly-plugins gst-libav gst-plugins-bad
sudo pacman -S gst-plugins-base gst-plugins-good gst-plugins-ugly ffmpegthumbnailer
# install terminal (konsole, tilix, terminator, guake)
sudo pacman -S {{ terminal }}
# install ark (for archives), kinfocenter (details about system)
# kdewallet (authentication management tool), gwenview (image viewer)
# spectacle (screenshot utility), okular (pdf viewer), vlc(video player)
# ktorrent (torrent client), kscreen (multiple desktop management)
sudo pacman -S ark kinfocenter kwalletmanager gwenview kipi-plugins spectacle
libreoffice-fresh okular vlc ktorrent kscreen
# install user home dirs
sudo pacman -S xdg-user-dirs
xdg-user-dirs-update
# install openssh agent that will allow to generate ssh keys
sudo pacman -S openssh
# install power management and brightness controls
sudo pacman -S powerdevil
reboot
# to be able to mount exfat (SD card for example)
sudo pacman -S exfat-utils
# install yaourt
# add the following at the end of /etc/pacman.conf
[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/$arch
# update pacman database
sudo pacman -Suy
# install yaourt properly
# package-query might be needed
sudo pacman -S git
sudo pacman -S yaourt
# install browsers
sudo pacman -S firefox
sudo pacman -S google-chrome / yaourt -S google-chrome
# openvpn and tunnel bear configuration
sudo pacman -S openvpn
# login as root
sudo su -
# Download and place in /etc/openvpn/client
wget https://s3.amazonaws.com/tunnelbear/linux/openvpn.zip
cp /etc/openvpn/client/TunnelBear\ United\ States.ovpn /etc/openvpn/client/TunnelBearUS.conf
# add to the TunnelBearUS.conf file
keepalive 10 30
auth-user-pass login.key
# create login.key file with your credentials in the same directory as the conf file
yourtunnelbearusername
yourtunnelbearpassword
# run as root
openvpn /etc/openvpn/client/TunnelBearUS.conf
# power management
sudo pacman -S powertop
sudo powertop --calibrate
sudo powertop --auto-tune
# instal plank and add it to startup
sudo pacman -S plank
# update system
sudo pacman -Syu
sudo pacman -S tlp
# nano /etc/default/tlp and add/edit these lines
# ------------------------------------------------------------------------------
# tlp - Parameters for power save
# Hint: some features are disabled by default, remove the leading # to enable
# them.
# Set to 0 to disable, 1 to enable TLP.
TLP_ENABLE=1
# Dirty page values (timeouts in secs).
MAX_LOST_WORK_SECS_ON_BAT=15
# Battery charge thresholds (ThinkPad only, tp-smapi or acpi-call kernel module
# required). Charging starts when the remaining capacity falls below the
# START_CHARGE_TRESH value and stops when exceeding the STOP_CHARGE_TRESH value.
# Main / Internal battery (values in %)
START_CHARGE_THRESH_BAT0=75
STOP_CHARGE_THRESH_BAT0=90
# Ultrabay / Slice / Replaceable battery (values in %)
START_CHARGE_THRESH_BAT1=75
STOP_CHARGE_THRESH_BAT1=90
systemctl enable tlp.service
systemctl enable tlp-sleep.service
# intel brightness adjustments (optional)
/etc/X11/xorg.conf
Section "Device"
Identifier "Card0"
Driver "intel"
Option "Backlight" "intel_backlight"
EndSection
sudo pacman -S xf86-video-intel
# bind the brightness keys (optional)
sudo pacman -S xbindkeyst
xbindkeys -d > ~/.xbindkeysrc
# copy the following (optional)
# increase brightness level by 5%
"xbacklight -inc 5"
XF86MonBrightnessUp
# decrease brightness level by 5%
"xbacklight -dec 5"
XF86MonBrightnessDown
# install vscode / postman
yaourt -S visual-studio-code postman
# install login manager
sudo pacman -S sddm
sudo systemctl enable sddm.service
reboot
# install lts kernel
sudo pacman -S linux-lts
sudo grub-mkconfig -o /boot/grub/grub.cfg
sudo pacman -S linux-lts-headers
# remove old kernels
sudo pacman -Rs linux
# encrypt the home directory
...
# remove oprhans packages
sudo pacman -Rns $(pacman -Qtdq)
# optimize pacman database
sudo pacman-optimize
# UI configuration
...
# install network manager
sudo pacman -S networkmanager plasma-nm
sudo systemctl stop dchpcd
sudo systemctl disable dchpcd
sudo systemctl enable NetworkManager
sudo systemctl start NetworkManager
reboot
sudo pacman -S breeze-gtk kde-gtk-config
# fonts and spell checkers
sudo pacman -S adobe-source-sans-pro-fonts aspell-en enchant gst-libav gst-plugins-good hunspell-en icedtea-web jre8-openjdk languagetool libmythes mythes-en pkgstats ttf-anonymous-pro ttf-bitstream-vera ttf-dejavu ttf-droid ttf-gentium ttf-liberation ttf-ubuntu-font-family
sudo pacman -S kate
sudo pacman -S python-pip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment