Things to do on a fresh Linux installation

14.06.2025

My primary work laptop died recently which forced me to set up a working environment on a few new laptops. In practice, this means installing Linux on each of them, and, crucially, making quite a few adjustments. Most of these adjustments mean simply copying the config files (“dotfiles”) to the new machine, but there are things that I don’t know how to reproduce automatically. I decided to write this note for my future reference to document the list of things I need to do when setting a new machine.

Dotfiles

This is the easiest part: most of the important config files live in a git repository. I am not particularly proud of my skills in organizing the configs, so I prefer to keep the repository private. To pull such a repository using the command line it is best to first establish proper keys with the repository hosting. Large hostings have their guides: github, gitlab, bitbucket.

To manage the dotfiles, recently, I switched to chezmoi from GNU stow. There are numerous guides on the internet how to use these programs, or how to organize an effective dotfiles storage system: e.g., 1, 2, 3.

Sudo settings

By default, on EndeavourOS (perhaps, on other Linuxes too), sudo prompts and also the validity of an entered password expire after some time. To disable these timeouts, one needs to edit the sudoers file by issuing

% sudo -E visudo

in shell (should be apparent from the prompt symbol that I use zsh), and adding

Defaults timestamp_timeout=-1
Defaults passwd_timeout=0

to the file.

The prompt expiration is quite annoying when installing packages that require substantial compilation. In ArchLinux derivatives, this is typically when installing packages from AUR: these packages are first built from sources, then compiled binaries are moved to the target location (something like /bin/) which requires root access. The sudo prompt appears after the compilation stage, long after I have switched to a different thing. Some AUR helpers (e.g., paru) have options to prevent this (e.g., paru --sudoloop), so editing sudoers is not necessary, still, I prefer to have this.

Disabling password timing out (timestamp_timeout=-1) means that sudo will prompt user’s password once in each shell session. Perhaps, this can be a security issue, so use with caution.

Keyboard configuration

There are two commands that set my keyboard to usable regime. First is

% setxkbmap -option  -layout us,ru -option grp:toggle,ctrl:grouptoggle_capscontrol

It enables two layouts, English and Russian, allows switching between these using right Alt or left Control keys, and makes Caps Lock the Control key.

The second command

% xset r rate 190 50

controls the autorepeat. The autorepeat is the thing that keeps sending keypresses when a key is held pressed. The first number sets the delay before it starts, and the second specifies the rate at which the keypresses are generated. In practice, reducing the first number and increasing the second one, result in a faster scrolling when e.g. the Down key is held down.

These settings, unfortunately, are reset at each reboot. One option is to write these two commands in a script and run it whenever needed. A way to make these settings persist is to modify /etc/X11/xorg.conf.d/00-keyboard.conf. Mine contains

Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "us,ru"
        Option "XkbVariant" ""
        Option "XkbOptions" "grp:toggle,ctrl:grouptoggle_capscontrol"
        Option "AutoRepeat" "190 20"
EndSection

Note that the AutoRepeat section has a pair of numbers as a single quoted argument. Failing to conform to this syntax will make the X server fail to start (happened to me). Furthermore, the second number (above: “20”) here is measured in milliseconds (versus Hertz used in the arguments of xset).

Specific Software

Zotero

Zotero is a free open-source system for bibliography management that I use to sort out citations in my papers. I wrote a bit about how I use it here. A premium subscription allows syncing your library via built-in mechanisms, however a perfectly equivalent free workflow is available. It is described in detail in this post. A link to this post is also the single pinned thread in r/zotero on the reddit.

That guide suggests storing the PDFs of your library in a separate flattened directory (by default, Zotero keeps them in an obscure directory tree) with help of an extension. I believe, this extension is no longer needed as of Zotero version 7+. Second, it suggests the extension better-bibtex for, well, better bibtex.

I have set up Zotero using that guide on my second last laptop around 2018, and have moved the configuration to newer laptops by simply copying $HOME/.zotero and $HOME/zotero_library directories. The first one has Zotero’s configuration files, and the second one has the PDFs of the papers from the library. I found it the easiest to sync those two directories using syncthing.

StarDict and Dictd

These two are the dictionary software that I find quite convenient to use from the command line. Both can be nicely set up using guides from the ArchWiki: sdcv, dict. I prefer sdcv, however I also prefer to keep both, as dict seems to be a bit faster. To call each from the command line, I use shell functions (slightly modified suggestions from ArchWiki):

function ww() {
	sdcv -n --utf8-output --color "$@" 2>&1 | \
	fold -s --width=72 | \
	less
}
function ss() {
  dict $@ | colorit | less
}

One difficulty with these two programs is that by default they do not include the dictionary files. These files have to be installed separately. There are packaages in the AUR (ArchLinux User Repository) with dictionaries for both sdcv and dict, however, I am not sure whether these packages do not break any copyright laws, so use them at your own risk.