Skip to content

Instantly share code, notes, and snippets.

@diniremix
Last active October 23, 2022 19:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diniremix/632435d2ab5879ce458d769479708262 to your computer and use it in GitHub Desktop.
Save diniremix/632435d2ab5879ce458d769479708262 to your computer and use it in GitHub Desktop.

Ubuntu 22.04 on Windows wsl2

https://youtu.be/BxlcSXKoiiU

in the Windows terminal, Basic commands for WSL

wsl --install wsl --set-default-version 2 wsl --help wsl -l -o wsl -l -all wsl --user USERNAME

Immediately terminates all running distributions and the WSL 2 lightweight utility virtual machine.

wsl --shutdown

install Ubuntu 22.04

https://apps.microsoft.com/store/detail/ubuntu/9PDXGNCFSCZV?hl=en-us&gl=us

linux vm (ubuntu 22.04)

as root

lsb_release -a adduser USERNAME usermod -a -G sudo USERNAME

change to new user

su - USERNAME

sudo apt-get update && sudo apt-get upgrade -y sudo apt install software-properties-common --no-install-recommends sudo apt install ubuntu-restricted-extras libavcodec-extra ffmpeg sudo apt install screenfetch sudo apt install x11-apps -y sudo add-apt-repository universe

sudo apt update sudo apt-get install Ubuntu-restricted-extras sudo apt install build-essential libglu1-mesa-dev sudo apt-get install zip gzip rar unrar zlib1g zlib1g-dev unzip xz-utils p7zip-full p7zip-rar sharutils

exfat-utils

sudo apt install exfat-fuse exfatprogs

sudo apt-get install tk libncurses5-dev libncursesw5-dev sudo apt-get install openssl libssl-dev openssl-dev sudo apt install curl nano wget git gitk git-gui git-flow sudo apt-get install bzip2 libbz2-dev libffi-dev sudo apt-get install libreadline8 libreadline-dev lib32readline8 lib32readline-dev sudo apt-get install sqlite3 libsqlite3-dev sudo apt-get install lzma liblzma-dev sudo apt install gnome-tweaks gnome-tweak-tool

for laptops

sudo apt-get install tlp tlp-rdw sudo systemct1 enable tlp

update graphics drivers

sudo apt install ubuntu-drivers-common sudo ubuntu-drivers list sudo ubuntu-drivers devices sudo ubuntu-drivers autoinstall

search packages

apt-cache search --help

install xfce4

in Windows, install vcxsrv

https://sourceforge.net/projects/vcxsrv/

in linux vm

sudo apt-get install xfce4-terminal xfce4

sudo apt-get autoclean sudo apt-get autoremove sudo apt-get clean

minimize button

gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'

mount/umount Windows devices on wsl2

examples

sudo mkdir /mnt/f sudo mount -t drvfs F: /mnt/f sudo umount /mnt/foldername

install pyenv

curl https://pyenv.run | bash pyenv versions pyenv install --list | grep " 3.[79]" pyenv install -v 3.7.15 pyenv install -v 3.9.15 pyenv global system 3.9.15 3.7.15

install nvm

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash nvm install --lts=fermium # 14 nvm install --lts=gallium # 16 nvm list nvm use 16.18.0 nvm alias default 16.18.0

references

https://learn.microsoft.com/en-us/windows/wsl/basic-commands#set-wsl-version-to-1-or-2

https://linuxconfig.org/things-to-install-on-ubuntu-22-04

https://linuxhint.com/40_things_after_installing_ubuntu/

https://averagelinuxuser.com/ubuntu-22-04-after_install/

https://itsfoss.com/things-to-do-after-installing-ubuntu-22-04/

https://help.ubuntu.com/community/InstallingCompilers

https://gist.github.com/diniremix/56cb0d1093e1c9747dc585efa38279bc

https://gist.github.com/diniremix/68b4a4bca32c2f98f3c024272543dabc

https://gist.github.com/diniremix/5340a2b388c6eaa1d24891b5f5d9d2ca

wsl2-tutorial (with XFCE4)

https://github.com/QMonkey/wsl-tutorial/blob/master/README.wsl2.md

WSL 2 GNOME Desktop

https://gist.github.com/Ta180m/e1471413f62e3ed94e72001d42e77e22

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