Setting up Arch Linux for Research
Introduction
Welcome to this comprehensive guide on setting up Arch Linux for research. This blog post is intended for anyone interested in using Arch Linux for their research activities. We’ll walk you through the installation process, highlighting common issues and their solutions. Additionally, we’ll guide you through configuring your system for optimal performance. Let’s get started!
NOTE: it is highly recommended to read the arch wiki.
NOTE: on Lenovo T490, Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz
Pre-installation Tips and Troubleshooting
Before we dive into the installation process, there are a few things you need to know:
- Configuration Updates: In the installer, you might encounter some issues related to the
self._config[key]
in the/usr/lib/python3.10/site-packages/archinstall/lib/configuration.py
file. To avoid this, addif key == 'disk_encryption' and self._config[key]:
to avoid faults before the installation. (this is no longer needed for 23.11) - Connecting to WiFi: During the installation, you may need to connect to WiFi. We’ll explain how to do this in a later section, so for now, just be aware that this is a step you’ll need to take.
- Running the Installation Script: To begin the installation process, you’ll need to type
archinstall
in the terminal.- Bootloader: grub-install
- Drive(s): this is tricky. If you have a small SSD and a large HDD, you might want to install the system on the SSD and use the HDD as a storage. In this case, you need to partition the SSD and HDD separately. If you have only one SSD, you can partition it as you wish. in my case, I have a large SSD. I just choose the SSD and then mount the HDD to the
/home/HDD
or/mnt
folder. - Disk layout: ext4
- Audio server: pulseaudio
- Profile: awesome, NVIDIA (proprietary)
- Optional repositories: multilib
- Choosing the Filesystem and Partition: When the script prompts you to choose a filesystem, select ext4. You won’t need to set up any extra partitions.
- Selecting an Audio Server: For the audio server, choose pulseaudio.
- Installing Additional Packages: You’ll also be prompted to install additional packages. Here, select:
htop
,neofetch
,neovim
,git
, andfirefox
. - Choosing a Desktop Environment: When it comes to selecting the desktop environment, I recommend choosing
awesome
. If you’re unsure what a desktop environment is, check out this resource.
That’s it for the pre-installation tips and troubleshooting. In the next section, we’ll dive into the things you need to do after installing Arch Linux.
Things to do after Installation
Once you have succssfully installed Arch Linux, there are a few additional steps to optimize your system for research:
- Configure Pacman: In
/etc/pacman.conf
, uncommentColor
andParallelDownloads
, and addILoveCandy
. This will enhance the readability and speed of your package manager. - Install and Configure Zsh: Install
zsh
andoh-my-zsh
and makezsh
your default shell. When you installoh-my-zsh
, it will prompt you to set it as the default. In your.zprofile
, add the following code to start X at login:if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then exec startx fi
- Install Useful Utilities: install
picom
,fzf
,tmux
,exa
,zip
,unzip
,alsa-utils
,noto-fonts-cjk
,exa
,bat
,skype
,discord
,zoom
,TexStudio
,anaconda
,texlive-core
,pcmanfm
,gcc-fortran
,docker
(sudo systemctl start docker
),ruby
, etc. - Check screen tearing: Screen tearing can be annoying and disrupt your workflow. Check the later section.
- Install font: A good set of fonts can make your system look clean and be easy on the eyes.
- Key setup: Set up your keys using
.Xmodmap
with the following configuration:clear lock clear control add control = Caps_Lock Control_L Control_R keycode 66 = Control_L Caps_Lock NoSymbol NoSymbol
- Fix Lenovo T490 Brightness function keys: If you are using a Lenovo T490, you might experience issues with brightness function keys. To resolve this, edit
/etc/default/grub
withGRUB_CMDLINE_LINUX_DEFAULT="quiet pcie_aspm=force acpi_osi="
and then run$ sudo grub-mkconfig -o /boot/grub/grub.cfg
. Please note that this could potentially cause issues with your system, so proceed with caution. - Audio Control Setup: Set up audio control by installing
xbindkyes
using the commandsudo pacman -S xbindkeys
. You can find more details about how to usexbindkeys
here - Setup xinitrc: Copy the system
xinitrc
to your home directory using the command ` $ cp /etc/X11/xinit/xinitrc ~/.xinitrc. Add
xbindkeys &to
.xinitrcto start
xbindkeys` when you start X. - Enable Touchpad Tapping: Add
40-libinput.conf
to enable tapping and other toughpad features. Here is a sample configuration:Section "InputClass" Identifier "libinput touchpad" MatchIsTouchpad "on" MatchDevicePath "/dev/input/event*" Driver "libinput" Option "Tapping" "on" Option "NaturalScrolling" "true" # Optional: Enable natural scrolling EndSection
- Prevent Accidental Shutdowns: Configure Display Power Management Signaling (DPMS) to prevent your PC from shutting down accidentally. Check
10-monitor.conf
for the correct settings. - Setup Screen Lock: Install
i3lock-color
and use this themehttps://github.com/Raymo111/i3lock-color
. There are some dependencies you’ll need to check. Usexautolock
to automatically activatei3lock
. - Setup File Synchronization: Install
rslsync
byyay -S rslsync
. Start Resilio Syncsystemctl start rslsync.service
. Start at bootsystemctl enable rslsync.service
. You can then access the Resilio Sync interface atlocalhost:8888
in your web browser. You need to add the permission of user’s foldersudo setfacl -R -m "u:rslsync:rwx" /home/your-username
— I removed it as this current PC doesn’t have too much space for download. - matlab is at
/usr/local/MATLAB/R2023a
. - Install MeshLab: from source code, need vcglib (from source code) to replace the empty folder at
src/
Check to see if the<cstdint>
header file is included in thesrc/external/downloads/libE57Format-2.3.0/include/E57Format.h
andsrc/external/downloads/nexus-master/src/corto/src/tunstall.cpp
file. If not, you can add the line#include <cstdint>
at the top of the file.
mv /home/{username}/Apps/anaconda3/lib/libstdc++.so.6 /home/{username}/Apps/anaconda3/lib/libstdc++.so.6.bak
maybeu3d
need to be installed — no errors currently - pymol install: The pymol is installed from its open source version. After the installation, you might have the following error.
➜ linux git:(main) ✗ pymol libGL error: MESA-LOADER: failed to open iris: /home/jiahuic/Apps/miniconda3/lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /usr/lib/dri/iris_dri.so) (search paths /usr/lib/dri, suffix _dri) libGL error: failed to load driver: iris libGL error: MESA-LOADER: failed to open iris: /home/jiahuic/Apps/miniconda3/lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /usr/lib/dri/iris_dri.so) (search paths /usr/lib/dri, suffix _dri) libGL error: failed to load driver: iris libGL error: MESA-LOADER: failed to open swrast: /home/jiahuic/Apps/miniconda3/lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /usr/lib/dri/swrast_dri.so) (search paths /usr/lib/dri, suffix _dri) libGL error: failed to load driver: swrast
To solve the error:
mv /home/{username}/Apps/miniconda3/lib/libstdc++.so.6 /home/{username}/Apps/miniconda3/lib/libstdc++.so.6.bak ln -s /lib/libstdc++.so.6 /home/{username}/Apps/miniconda3/lib/libstdc++.so.6
Connect to WiFi
Enter the iwd
mode:
iwctl # if saying "waiting for iwd to start", do sudo systemctl start iwd
In iwd
mode, you can check the WiFi device by device list
. If you see some devices with power off, you can try
adapter phy0 set-property Powered on # some say: device phy0, try both
device wlan0 set-property Powered on
Once that done, it is ready to scan and see the WiFi signals
station wlan0 scan
station wlan0 get-networks
station wlan0 connect yourWiFi
station wlan0 show
Bluetooth Connect
Use the bluetoothctl
utility which is part of the bluez
package in Arch Linux to manage your Bluetooth devices. Install bluez
and bluez-utils
by sudo pacman -S bluez bluez-utils
. Then start and enable the Bluetooth service:
sudo systemctl start bluetooth
sudo systemctl enable bluetooth
Now, start bluetoothctl
to pair and connect the devices.
- Start the
bluetoothctl
. - Turn the Bluetooth controller power on:
power on
. - Make the Bluetooth controller discoverable:
discoverable on
. - Start the agent:
agent on
. - Start scanning for devices:
scan on
. Copy its MAC address, then stop scanning:scan off
. - Pair and connect to the device. Replace
[device MAC address]
with the device’s MAC address:pair [device MAC address] trust [device MAC address] connect [device MAC address]
Type
quit
to exitbluetoothctl
when you’re done.
Conclusion
And there you have it! You’ve now set up and configured your Arch Linux system, and it’s ready for your research endeavors. Remember, the beauty of Linux lies in its flexibility and the control it offers you as a user. Don’t hesitate to explore, tweak, and personalize it to suit your needs.
I hope you found this guide helpful. If you run into any issues or have any questions, don’t hesitate to leave a comment. Your input could also help other readers who may encounter the same problems.
Thank you for reading and happy researching on Arch Linux!