This repository contains various configuration files and scripts.
See e.g. Ubuntu Wiki.
By default Ubuntu with LVM and encryption creates following partitions:
LVM VG vgubuntu, LV root as ext 4
LVM VG vgubuntu, LV swap_1 as swap
partition #1 of /dev/nvme0n1 as ESP
The swap partition is by default only ~1G. In order to resize the root logical volume and increase swap do the following:
increase_swap.sh
script that moves 40G space from root to swapUbuntu release upgrades can be done using the do-release-upgrade
utility from the update-manager-core
package.
One can verify that it's installed from the output of
dpkg -s update-manager-core
As a prerequisite make sure the system is up to date:
sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo apt autoremove
And finally, run the release upgrade with
sudo do-release-upgrade
or to upgrade from the latest supported release to the development release, run:
sudo do-release-upgrade -d
Note that new LTS versions become available with release xx.04.1
, as
explained here.
There is an installation make target that links config files to dedicated locations.
WARN: Note that original files will be overwritten!
make config
First check whether the system runs Wayland - e.g., by looking at
XDG_SESSION_TYPE
.
There is a Gnome extension alacritty-toggle, which enables toggling the visibility of the terminal window.
This extension can be installed with make alacritty-toggle
which
clones the repository and configures the toggle button to F1.
Unfortunately, the extension is picked up only after restarting current Gnome session so one must logout, log back in and re-run the make target.
This configuration is actually stored as .config/zsh/p10k.zsh
and
automatically symlinked to $POWERLEVEL9K_CONFIG_FILE
.
It is important to note that $POWERLEVEL9K_CONFIG_FILE
is set in
.zshrc
and uses $XDG_CONFIG_HOME
. Additionally, .zshrc
disables
the p10k configure
configuration wizard.
Therefore, if one deliberately wants to run it, the wizard must be re-enabled with
POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=false p10k configure
Also the XDG specification, respectively $POWERLEVEL9K_CONFIG_FILE
,
should be respected if p10k.zsh
ought to be rewritten by the wizard.
Generally, there are two setups which, according to the p10k documentation, respect terminal's color palette (and hence Base16):
Some settings used in p10k configure
when p10k.zsh
was originally
created include:
Additionally one can download
Meslo Nerd Fonts and configure terminals as
instructed. The font download is part of make fonts
.
Tinted Shell can be
installed with make tinted-shell
. One can then manually switch themes
with base16_<theme>
which creates/updates a link
$HOME/.config/tinted-theming/base16_shell_theme
.
Note that the shell hook is already added to and liked the oh-my-zsh
plugin tinted-shell
, so after installation with make
one just needs
to reload zsh and pick a theme:
omz reload
base16_gruvbox-dark-hard
The default theme is set in .zshenv
to
BASE16_THEME_DEFAULT=gruvbox-dark-hard
.
One can also test
the themes with included colortest
tool.
Note that alacritty.yml
automatically imports set color schemes:
import = ["~/.config/alacritty/colors.toml"]
The colors.toml
is a symlink created by make alacritty
which points
to a tinted-alacritty
theme. Note that currently the theme is selected just once before the
installation and further changes won't be automatically picked up.
Bat supports base16
color theme by
default via --theme=base16
option or BAT_THEME
environment variable.
Current setting is BAT_THEME=base16-256
which, according to the
documentation:
is designed for
base16-shell
Custom themes are supported if appropriate file exists in
BAT_CONFIG_DIR/themes
When new themes are downloaded and linked, one
must update the cache by running:
bat cache --build
and then check the theme is available via:
bat --list-themes
Unless the Base16 extension is properly synced, install it and follow the instructions.
Finish Poetry setup by manually configuring auth tokens.
Nvim config automatically installs coc.nvim plugin. In order to setup language support for various languages, refer to corresponding sub-section.
:CocInstall coc-rust-analyzer
:CocInstall coc-pyright
Custom configurations can be found in
$XDG_CONFIG_HOME/coc/coc-settings.json
.
Haskell Language Server (HLS)
is configured in $XDG_CONFIG_HOME/coc/coc-settings.json
.
The installation of HLS is done as part of ghcup
installation in
make haskell
Json language extension for coc.nvim
:CocInstall coc-json
Settings are automatically synchronized via build-in mechanism so one can just login to GitHub.
The nvidia-settings
application does not currently support
XDG specification.
The workaround is to set custom config path using the --config
option.
.envrc
defines an alias for this so when running nvidia-settings
from shell it will automatically use
$XDG_CONFIG_HOME/nvidia-settings/nvidia-settings-rc
as the config file.
However, the desktop entry (i.e. when running the app from Gnome menu) must be edited manually. One can do this by executing the following make target:
make nvidia-settings-rc-xdg-path
$HOME
by conforming to XDG specification~/.bashrc
, ~/.bash_logout
The default user script location (under $HOME
) is compiled with the
shell, so the only option how to change it is modifying the system-wide
configs /etc/bash.bashrc
(resp. /etc/bash.bash.logout
).
There is a handy make bash
target which does so automatically and
links custom files from this repository.
~/.bash_history
Since the shell in use is zsh
, bash
configs are not commited in this
repo. So to change the location of the ~/.bash_history
file one can
manually run the following:
mkdir -p "$XDG_STATE_HOME"/bash && \
mv ~/.bash_history $XDG_STATE_HOME/bash/history
and make sure this line is in the linked bashrc:
export HISTFILE="${XDG_STATE_HOME:-$HOME/.local/state}"/bash/history
~/.pki/nssdb
NSS data in ~/.pki
should be safe to move to XDG directories, see:
bugzilla issue.
Migration commands:
mkdir -p $XDG_CONFIG_HOME/pki/nssdb $XDG_DATA_HOME/pki/nssdb && \
mv $HOME/.pki/nssdb/pkcs11.txt $XDG_CONFIG_HOME/pki/nssdb && \
mv $HOME/.pki/nssdb/*.db $XDG_DATA_HOME/pki/nssdb && \
rm -r $HOME/.pki
Note that ~/.pki
might be created by other tools:
~/.ipython
ipython >= 8.x
supports XDG. So it should be sufficient to
just run (it's not quite clear which XDG directories one should use):
mv ~/.ipython $XDG_CONFIG_HOME/ipython
Edits to any linked configurations is automatically propagated here (via the symlink). Then simply commit and push the changes.
coc.nvim
configurationAlthough the .config/coc/coc-settings.json
configuration file is
linked automatically, the server might not load it correctly. This issue
is described in the Thoubleshooting section and can be fixed by
rewriting the :CocConfig
buffer.
Resources:
Whether it's even possible to setup KVM on certain system or not can be checked with
kvm-ok
If the CPU supports virtualization one can install all required packages and then run following validation check
virt-host-validate
Typically one can see
Makefile
target.
However, this step (and the kvm
target in general) needs a reboot.Start Minikube on KVM by running
minikube start --cpus 2 --memory 2048 --vm-driver kvm2
or for larger machnines
minikube start --cpus 4 --memory 8192 --vm-driver kvm2
Note that the test-k8s
make target sometimes fails due to timeout after
waiting on minikube. It may also leave some resources when it does not
succeed.
Ubuntu LTS releases become available with release xx.04.1
, as
explained here.
The issue manifests when the check indicates there's new LTS release:
❯ sudo do-release-upgrade -cd
Checking for a new Ubuntu release
New release '22.04 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
but it fails to do the release upgrade:
❯ sudo do-release-upgrade
Checking for a new Ubuntu release
There is no development version of an LTS available.
To upgrade to the latest non-LTS development release
set Prompt=normal in /etc/update-manager/release-upgrades.
There are two options to solve this problem:
xx.04.1
release (~ 3 months from the LTS release)sudo do-release-upgrade -d
.With Ubuntu 22.04 a notification might appear reporting "Pending Update of Snap Store".
The issue is that neither from terminal nor from Ubuntu Software
application the update works. This is because snap-store
starts
automatically on login.
So first kill
the process (either from command line or using System
Monitor), and then run
sudo snap refresh
Note: see all pending updates by running snap refresh --list
.
Missing nvidia-smi
after some updates (which was working after
installation):
❯ nvidi-smi
zsh: command not found: nvidi-smi
Fixed by running following and then rebooting.
sudo ubuntu-drivers autoinstall
Advised here and empirically might work even without restart.
Other option which might work (although one should be careful with this one) is to run dist upgrade:
sudo apt dist-upgrade
The issue with "missing" drivers is that the driver packages are "kept
back" (shown in the snippet below). This is due to an incompatibility
between driver libs and the kernel which apt
cannot resolve on its own.
❯ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
libnvidia-cfg1-460 libnvidia-compute-460 [...]
libnvidia-gl-460 libnvidia-gl-460:i386 libnvidia-ifr1-460 [...]
nvidia-utils-460 xserver-xorg-video-nvidia-460
0 upgraded, 0 newly installed, 0 to remove and 21 not upgraded.
As a consequence nvidia-smi
is unable to communicate to the driver and
fails (see this post).
The solution is as described above (possibly combination of both approaches). Also, reboot might be necessary for the fix to take effect.
Ubuntu 22.04 (LTS) will fallback to and start with X11 on a machine with Nvidia. It's possible, however, to override this rule and run it with Wayland just fine.
Enabling Wayland requires a manual change as described
here. Additionally, also modify
/etc/gdm3/custom.conf
as follows:
PreferredDisplayServer=wayland
WaylandEnable=true
XorgEnable=false
Note that on Ubunut, one can tell the session type from the
XDG_SESSION_TYPE
environment variable.
If minikube continously fails to boot, and as a last resort, one can clean up the whole minikube by running:
minikube delete
or even more excessive cleanup which also deletes the ~/.minikube
dir
minikube delete --purge
Some vim-plug plugins require the init.vim
file (the config file) to be
sourced again for the plugin installation to work.
:source $VIMRC
:PlugInstall
coc.nvim
Some language servers managed by
coc.nvim
may misbehave. For
instance the HLS
may error on hover to display documentation and generally not check the
code for errors.
There is a configuration file .config/coc/coc-settings.json
that is
automatically symlinked but nvim/coc may not load it. This situation can
be checked by running :CocConfig
and if the buffer is empty the linked
file is not loaded.
The fix is simply to paste the content of coc-settings.json
to the
:CocConfig
buffer and (re)write it.
cargo-audit
installation and usageThe installation of cargo-audit
might fail if installed manually and
the system does not have libssl-dev
installed (note that if one uses
make rust-tools
this should not happen).
In such case, and possibly in other situations, the advisory database might get into an invalid state.
Fortunately, according to this issue, the fix is simply to drop the database:
rm -rf $CARGO_HOME/advisory-db/
Next invocation of cargo audit
will fetch it again and fix the issue.
According to zsh-sdkman
's
usage notes:
if you do new installations on your sdkman candidate or just play around with new versions, uninstallations or updates, don't forget to refresh the completion script files with the following command:
sdk-refresh-completion-files
pipx
for new PythonAccording to this
issue comment
once should be able to fix pipx
installations as follows:
pipx reinstall-all
Alternatively, one can reinstall pipx
and the tools manually
(mentioned in the same issue that was referenced above):
pipx uninstall-all
pipx
and remove $XDG_BIN_HOME/pipx
and ~/.local/pipx
pipx
and tools using make python-tools
An indication for issues with pipx
might be an error log mentioning
No module named pip
Some profiling tools (e.g. samply
or flamegraph
) require access to
the performance events system.
These settings can help:
sudo sysctl kernel.perf_event_paranoid=1
sudo sysctl kernel.perf_event_mlock_kb=2048
Some tools (e.g. heaptrack
) need adjustment of the ptrace
scope:
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
Also, for Rust binaries it's necessary not to strip debug symbols
from the binary. This might be the case when building/running in the
--release
profile. One possibility is to add a custom profile like the
following one:
[profile.profiling]
inherits = "release"
debug = true