$ sudo apt install firefox Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package firefox
It's likely, if you just installed WSL and (assuming, but you don't mention the exact distribution) Ubuntu (but could be any Debian-based distribution) that you haven't performed a critical first-step:
sudo apt update && sudo apt upgrade
It's really the first step in using any Debian-based distribution from the command-line, even when not using WSL.
Really only the first
update part is required to install Firefox, but the second
upgrade is highly recommended to bring your system up-to-date.
For the first part, most WSL distributions don't ship with the package cache populated, to save on download bandwidth. So you need to do this regardless on WSL.
The second part, upgrading, is recommended for the same reason you do a Windows Update after first installing -- The installed packages are almost always somewhat out-of-date, and updated packages have been released since the time the distribution was distributed.
That said, note that you will need to be running Windows 11 in order to use the Linux version of Firefox in WSL, at least without additional configuration. See my Super User answer here for more information.