Installing and Managing Development ToolsLesson 4.5
How to use apt and manage system packages in Ubuntu WSL2
apt vs apt-get, apt search, apt show, apt install, apt remove vs purge, apt autoremove, adding PPAs, dpkg for .deb files, snap packages
Package Management with apt
apt is the package manager for Ubuntu and Debian-based distros. It handles installation, updates, and removal of system software from curated repositories.
Finding packages
apt search ripgrep
apt show ripgrepInstalling and removing
sudo apt install ripgrep curl jq -y
sudo apt remove ripgrep # removes binary, keeps config
sudo apt purge ripgrep # removes binary AND config files
sudo apt autoremove # cleans unused dependenciesUpdating all packages
sudo apt update && sudo apt upgrade -yInstalling a .deb file directly
sudo dpkg -i package.deb
sudo apt install -f # fix missing dependenciesAdding a PPA
sudo add-apt-repository ppa:git-core/ppa
sudo apt update
sudo apt install gitSnap packages
sudo snap install go --classicUse snaps when a tool is not in official apt repos or you need a very recent version. For Node.js and Python, prefer nvm and pyenv over apt or snap for maximum flexibility.
