Skip to content

Instantly share code, notes, and snippets.

@flcdrg
Last active May 7, 2025 03:39
Show Gist options
  • Save flcdrg/796b941f1d90fc9904c3a6fe02065f4c to your computer and use it in GitHub Desktop.
Save flcdrg/796b941f1d90fc9904c3a6fe02065f4c to your computer and use it in GitHub Desktop.
WSL setup notes
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
# oh-my-posh
eval "$(oh-my-posh --init --shell bash --config '/mnt/c/Users/David.Gardiner/OneDrive - LeavePlus/Documents/ohmyposh.json')"
# fnm https://github.com/Schniz/fnm#shell-setup
eval "$(fnm env --use-on-cd --shell bash)"

Updates and Oh-My-Posh

sudo apt update
sudo apt upgrade

sudo apt install unzip

curl -s https://ohmyposh.dev/install.sh | bash -s

(exit and login again so that oh-my-posh is now in path)

Add this line to .profile

eval "$(oh-my-posh --init --shell bash --config /mnt/c/Users/david/OneDrive/Documents/ohmyposh.json)"

Install PowerShell

https://learn.microsoft.com/en-us/powershell/scripting/install/install-ubuntu?view=powershell-7.5&WT.mc_id=DOP-MVP-5001655

# Install pre-requisite packages.
sudo apt-get install -y wget apt-transport-https software-properties-common

# Get the version of Ubuntu
source /etc/os-release

# Download the Microsoft repository keys
wget -q https://packages.microsoft.com/config/ubuntu/$VERSION_ID/packages-microsoft-prod.deb

# Register the Microsoft repository keys
sudo dpkg -i packages-microsoft-prod.deb

# Delete the Microsoft repository keys file
rm packages-microsoft-prod.deb

# Update the list of packages after we added packages.microsoft.com
sudo apt-get update

sudo apt-get install -y powershell

Install Latest Git

https://git-scm.com/downloads/linux

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

sudo apt update
sudo apt upgrade

FNM (alternate to NVM)

curl -fsSL https://fnm.vercel.app/install | bash

NVM

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash

(exist and login)

nvm install --lts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment