7.3 KiB
Linux Mint Setup
- Setup home directory structure
- Configure apt to use a local mirror
- Install base packages
- Restore ssh keys and dotfiles
- Optional configuration
This guide will walk through how I setup fresh installations of Linux Mint. Linux Mint is an operating system for desktop and laptop computers. It is designed to work 'out of the box' and comes fully equipped with the apps most people need.
I use Linux Mint as my daily driver operating system on a variety of different machines. The intent of this guide is to make it easy for me to get back up and running quickly whenver I do a fresh installation.
Setup home directory structure
Configure apt to use a local mirror
To speed up how quickly our system can install new or updated packages we should tell apt to use a mirror here in New Zealand.
# Backup our apt sources configuration before we make changes
sudo cp /etc/apt/sources.list.d/official-package-repositories.list /etc/apt/sources.list.d/official-package-repositories.list.bak
# Replace packages repo with local
sudo sed -i 's|https://packages.linuxmint.com|http://ucmirror.canterbury.ac.nz/linux/mint/packages|g' /etc/apt/sources.list.d/official-package-repositories.list
# Replace base repo with local
sudo sed -i 's|https://archive.ubuntu.com/ubuntu|http://ucmirror.canterbury.ac.nz/ubuntu|g' /etc/apt/sources.list.d/official-package-repositories.list
Install base packages
Now that we have our apt package manager configured let's install the standard packages we use.
sudo apt install --yes htop screenfetch git curl wget xclip emacs xterm xtermcontrol jq tmux tmate apt-transport-https
For working with container images locally outside of kubernetes clusters we use podman so that we can avoid the security problems of a standard docker daemon. Follow the steps below to install podman:
# Add the repositories to our apt sources
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
# Add the repository key
curl -L "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/Release.key" | sudo apt-key add -
sudo apt update && sudo apt --yes install podman
When working with kubernetes applications we often use helm, unfortunately we need an extra apt repository for this so let's add that now and install.
curl https://baltocdn.com/helm/signing.asc | sudo apt-key add -
echo "deb https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
sudo apt-get update && sudo apt install -y helm
Finally, we should upgrade the python package manger pip that we installed, before using it to install podman-compose.
sudo pip install --upgrade pip && sudo pip3 install podman-compose
For additional package management namely bitwarden we use node package manager. The code below installs node 16.x, which is the latest stable release as of <2021-10-02 Sat>.
# Curl down the shell script for adding version 16 of nodejs to apt
sudo curl -sL https://deb.nodesource.com/setup_16.x | sudo bash -
# Install the nodejs package via apt
sudo apt-get install -y nodejs
For managing secrets we use bitwarden which provides a great cli utility. Additionally in our bashrc file included in this repository there are a number of helper functions to make working with bw easier.
# Install the bitwarden cli via node package manager
sudo npm install -g @bitwarden/cli
# Test login to bitwarden
bw login mail@jamesblair.net
For ad-hoc system administration we use ansible. We install ansible via pip3 to ensure any modules or additional packages required at a later date can be easily managed.
For significant ansible or python projects a virtual environment for python is suggested to keep project packages separate from system python packages.
pip3 install ansible
We use helm for packaging applications for kubernetes so let's install that now. Unfortunately we need an extra repository for this so let's separate this into a new step:
curl https://baltocdn.com/helm/signing.asc | sudo apt-key add -
echo "deb https://baltocdn.com/helm/stable/debidan/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
sudo apt-get update && sudo apt install -y helm
Restore ssh keys and dotfiles
Optional configuration
Optional - Cloud provider tools
Currently kubectl is packaged separately to gcloud and other cloud provider tools so let's install that first.
sudo apt-get update && sudo apt-get install -y apt-transport-https ca-certificates curl
sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update && sudo apt-get install -y kubectl
For working with google cloud platform we use the GCP SDK, which provides our cli tools.
# Download the sdk archive
curl -o gcpsdk.tar -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-375.0.0-linux-x86_64.tar.gz
# Extract to a folder in path then remove archive
sudo tar xvf gcpsdk.tar -C /usr/local/ && rm gcpsdk.tar
# Correct folder permissions
sudo chown -R $USER:$USER /usr/local/google-cloud-sdk
# Run the install script
/usr/local/google-cloud-sdk/install.sh
For working with Amazon Web Services we need the AWS CLI.
# Download the binary
cd ~/Downloads/
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
# Install
unzip awscliv2.zip
sudo ./aws/install
# Clean up
rm -rf ~/Downloads/aws*
Optional - Install hardware drivers
Optional - Setup humacs editor
Optional - Setup mutt mail client
Optional - Install rust
I've been tinkering with learning the Rust programming language lately, to set that up follow these steps:
# Ensure pre-requisites are installed
sudo apt install curl build-essential gcc make -y
# Install rust via setup script
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Once installed you can check if the rust compiler is installed with the code block below:
rustc -V && cargo -V