Skip to content

Instantly share code, notes, and snippets.

@derek-adair
Last active September 20, 2024 15:21
Show Gist options
  • Save derek-adair/6f76a0d99c80fbb96634c37f3d7171e8 to your computer and use it in GitHub Desktop.
Save derek-adair/6f76a0d99c80fbb96634c37f3d7171e8 to your computer and use it in GitHub Desktop.
# Install / configure ubuntu
wsl –install (Takes a while)
* Make sure you create a new user.
* You may need to run `ubuntu config –default-user {username}` in powershell
## Configure Ubuntu
sudo apt update && sudo apt upgrade -yy
sudo apt install -yy python3 python3-dev build-essential libncurses-dev make
sudo ln -s /usr/bin/python3 /usr/bin/python
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && sudo python -m get-pip.py
# Install Docker
## Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
## Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
## Setup Permissions
sudo groupadd docker
sudo usermod -aG docker $USER
(OPTIONAL) Install zsh / oh my zsh
sudo apt install zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
(optional) install dracula theme
Fix color for windows terminal:
echo "export COLORTERM=truecolor" >> .zshrc # add true color to term
## Add to .tmux.conf
set -g default-terminal "xterm-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"
(OPTIONAL) Install vim with useful plugins
sudo apt remove vim # remove vim 8
git clone [email protected]:vim/vim.git && cd vim
sudo ./configure --with-features --enable-python3interp
sudo make && sudo make install
curl https://raw.githubusercontent.com/derek-adair/dotfiles/refs/heads/master/.vimrc -o ~/.vimrc
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
IN VIM… run :PluginInstall
## Install Firefox
1. Add keyrings if its not there.
sudo install -d -m 0755 /etc/apt/keyrings
2. Import mozilla apt repo
wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null
3. The fingerprint should match
gpg -n -q --import --import-options import-show /etc/apt/keyrings/packages.mozilla.org.asc | awk '/pub/{getline; gsub(/^ +| +$/,""); if($0 == "35BAA0B33E9EB396F59CA838C0BA5CE6DC6315A3") print "\nThe key fingerprint matches ("$0").\n"; else print "\nVerification failed: the fingerprint ("$0") does not match the expected one.\n"}'
4. Next, add the Mozilla APT repository to your sources list:
echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" | sudo tee -a /etc/apt/sources.list.d/mozilla.list > /dev/null
5. Configure APT to prioritize packages from the Mozilla repository:
echo '
Package: *
Pin: origin packages.mozilla.org
Pin-Priority: 1000
' | sudo tee /etc/apt/preferences.d/mozilla
6. Update your package list, and install the Firefox .deb package:
sudo apt-get update && sudo apt-get install firefox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment