Skip to content

Instantly share code, notes, and snippets.

@Bengt
Last active May 24, 2024 22:46
Show Gist options
  • Save Bengt/98df20e0708c9766fc9f12f11365029b to your computer and use it in GitHub Desktop.
Save Bengt/98df20e0708c9766fc9f12f11365029b to your computer and use it in GitHub Desktop.
This is how I setup Ubuntu ... more or less.

Detect USB

  • Press tab to autocomplete the device file, e.g. /dev/sda.
ls /dev/sd

Do not complete to the partition, e.g. /dev/sda1.

Installation Media

cd ~/Downloads && \
wget https://releases.ubuntu.com/jammy/ubuntu-22.04.4-desktop-amd64.iso
  • Replace /dev/sd<TODO> with your usb stick device in the following command:
sudo dd bs=4M if=ubuntu-22.04.4-desktop-amd64.iso of=/dev/sd<TODO> status=progress oflag=sync

Check image

sha256sum ~/Downloads/*.iso

Base Installation

  • Select Try or install Ubuntu
  • Select Minimal System.
  • Select Download Updates During Installation.
  • Select Something else.
  • Select proper mount points for partitions.
    In case of a dual boot, resize the Windows partition accordingly.
  • Select Install Now
  • Reboot

Deinstallations

Desktop Applications

sudo apt remove --yes gnome-characters gnome-font-viewer yelp gnome-contacts

Gnome Applications

(Open Ubuntu Software, go to Installed, uninstall any obviously useless stuff.)

GNOME Software Updater

sudo apt remove --yes update-manager update-manager-core update-notifier update-notifier-common

Switch to Vanilla GNOME

sudo apt install --yes gnome-core && sudo apt remove --yes ubuntu-gnome-desktop

Remove memtest86+

sudo apt remove --yes memtest86+

Remove left-over Packages

sudo apt autoremove --yes

Remove left-over config files

sudo dpkg -P $(dpkg -l | awk '/^rc/ { print($2) }')

Ubuntu Advantage

Install Ubuntu Advantage Tools

sudo apt-get install --yes ubuntu-advantage-tools

Remove APT Spam

sudo pro config set apt_news=false

Installations

Install Aptitude

sudo apt install --yes aptitude
update

Install Google Chrome

Chrome GNOME-Shell

sudo apt install --yes chrome-gnome-shell

Hugin

( sudo add-apt-repository --yes ppa:ubuntuhandbook1/apps &&
sudo apt install --yes hugin )

Inkscape

sudo apt install --yes inkscape

GIMP

sudo apt install --yes gimp

Git PPA

sudo add-apt-repository --yes ppa:git-core/ppa

Git, curl, Meld

sudo apt install --yes git git-lfs curl meld

Trash-CLI

sudo apt install --yes trash-cli

Current Python

See DeadSnakes PPA:

sudo add-apt-repository --yes ppa:deadsnakes/ppa && \
sudo apt update && \
sudo apt install --yes \
    python3.8 python3.9 python3.10 python3.11 python3.12 \
    python3.8-dev python3.9-dev python3.10-dev python3.11-dev python3.12-dev \
    python3.8-venv python3.9-venv python3.10-venv python3.11-venv python3.12-venv

LM-Sensors

sudo apt install --yes lm-sensors && \
sudo sensors-detect --auto

Stress Testing

sudo apt install --yes stress

PyCharm via Snap

sudo snap install --classic pycharm-professional

Raise inotify Limit

(For PyCharm)

echo "fs.inotify.max_user_watches = 524288" | sudo tee --append /etc/sysctl.conf
sudo sysctl -p --system

PWGEN

sudo apt install --yes pwgen

Steam

sudo apt install --yes steam

Ubuntu-X PPA

sudo add-apt-repository --yes ppa:ubuntu-x-swat/updates && \
sudo apt update && \
sudo apt upgrade

GLXGEARS

sudo apt install --yes mesa-utils

Shotwell

sudo apt install --yes shotwell

ROCm Kernel Module

AMD has made installing ROCm under Ubuntu 22.04 quite a hassle. See the ROCm GitHub for details, but in short:

sudo apt install --yes equivs
printf "Package: amdgpu-dependencies\nProvides: python,libstdc++-7-dev,libgcc-7-dev\nArchitecture: all\nDescription: Fixes the AMD GPU installation on Ubuntu 22.04\n" > amdgpu-dependencies
equivs-build amdgpu-dependencies
sudo dpkg -i amdgpu-dependencies_1.0_all.deb
rm amdgpu-dependencies*
sudo usermod -a -G render $LOGNAME
wget https://repo.radeon.com/amdgpu-install/22.20.3/ubuntu/jammy/amdgpu-install_22.20.50203-1_all.deb
sudo apt-get install --yes ./amdgpu-install_22.20.50203-1_all.deb
rm ./amdgpu-install_22.20.50203-1_all.deb
yes | amdgpu-install --usecase=dkms,graphics,hip,mllib,multimedia,rocm

Reboot and test:

uname -r
dmesg | grep kfd

/opt/rocm/bin/rocminfo
sudo apt install --yes clinfo && clinfo

python3.10 -m venv venv
venv/bin/python -m pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/rocm5.1.1
# This takes a little while
printf "import torch\nprint('ROCm is available.' if torch.cuda.is_available() else 'ROCm is unavailable.')" > main.py
venv/bin/python main.py
rm -rf main.py venv

Install acceleration libraries:

sudo apt install --yes miopengemm rocblas miopenkernels-gfx900-64kdb

Either: Latest CUDA that works with MixIT

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb
sudo dpkg -i cuda-keyring_1.0-1_all.deb
sudo apt-get update
sudo apt-get install --yes cuda-12-2
sudo apt-get --yes install cuda-12-2
sudo apt-get install --yes libcudnn8 libcudnn8-dev

Or: Latest CUDA

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda-repo-ubuntu2204-12-4-local_12.4.0-550.54.14-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2204-12-4-local_12.4.0-550.54.14-1_amd64.deb
sudo cp /var/cuda-repo-ubuntu2204-12-4-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get --yes install cuda-toolkit-12-4
sudo apt-get install --yes nvidia-driver-550-open
sudo apt-get install --yes cuda-drivers-550

RadeonTop

sudo apt install --yes radeontop

Docker

sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo   "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install --yes docker-ce docker-ce-cli containerd.io
sudo service docker start
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker 

Glances

sudo snap install glances

GNOME Shell System Monitor Extension

sudo apt-get install --yes gir1.2-gtop-2.0 gir1.2-nm-1.0 gir1.2-clutter-1.0 gnome-system-monitor gir1.2-gtop-2.0 gir1.2-nm-1.0 gir1.2-clutter-1.0 gnome-system-monitor gir1.2-gtop-2.0 gir1.2-nm-1.0 gnome-system-monitor libgtop2-dev

https://extensions.gnome.org/extension/3010/system-monitor-next/

VLC

sudo apt remove --yes totem
sudo apt install --yes vlc

GitLab Runner

curl -L "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh" | sudo bash
sudo apt install --yes gitlab-runner

Configurations

Git and GNOME Keyring

sudo apt install --yes libsecret-1-0 libsecret-1-dev build-essential
cd /usr/share/doc/git/contrib/credential/libsecret
sudo make
git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret

Git using SSH key for signatures

  • Make sure you have your private / public key pair at ~/.ssh.
chmod 600 ~/.ssh/id_rsa
ssh-add -L
git config --global commit.gpgsign true
git config --global gpg.format ssh
git config --global user.signingkey /home/bengt/.ssh/id_rsa.pub

Disable Webcam Microphone

sudo bash -c 'echo SUBSYSTEM==\"usb\", DRIVER==\"snd-usb-audio\", ATTRS\{idVendor\}==\"046d\", ATTRS\{idProduct\}==\"085e\", ATTR\{authorized\}=\"0\" >> /etc/udev/rules.d/90-blacklist-webcam-sound.rules'

sudo reboot

Disable microphone auto gain

sudo cp -vR /usr/share/pulseaudio/alsa-mixer/paths /usr/share/pulseaudio/alsa-mixer/paths_backup
sudo perl -pi -0 -e 's/(\[[A-Za-z ]*Mic Boost\][A-Za-z._=\s-]+volume *= *)merge/\1zero/g;' /usr/share/pulseaudio/alsa-mixer/paths/*
sudo diff -r -C 5 /usr/share/pulseaudio/alsa-mixer/paths_backup /usr/share/pulseaudio/alsa-mixer/paths

Source: https://nzeid.net/pulseaudio-disable-auto-volume

OBS Studio

sudo apt install --yes obs-studio xdg-desktop-portal-wlr slurp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment