How to Use apt install in WSL (Windows Subsystem for Linux)
If you've set up WSL on your Windows machine, you're running a real Linux environment — which means you have access to APT, the package manager used by Debian-based distributions like Ubuntu. Understanding how apt install works inside WSL unlocks the ability to install development tools, servers, utilities, and language runtimes without ever leaving Windows.
What Is apt and Why Does It Work in WSL?
APT (Advanced Package Tool) is the standard package management system for Debian and Ubuntu Linux distributions. When you install WSL with Ubuntu (the default distro), you get a fully functional Linux userland, including APT and its package repositories.
Because WSL runs an actual Linux kernel (in WSL 2) or a compatibility layer (WSL 1), the package manager behaves almost identically to how it would on a native Linux machine. This means apt install fetches real Linux packages from Ubuntu's official servers, resolves dependencies automatically, and installs binaries your Linux environment can run.
Running Your First apt install Command
The basic syntax is straightforward: