1, package manager problem
There are many people who get a brand new Linux environment and subconsciously execute yum update
, apt update && apt upgrade
, but I don't recommend you to do this in WSL.
After I installed Ubuntu for the first time, I performed an upgrade, and soon encountered ridiculous problems in subsequent use:
dpkg cannot be used because of dependency problems, but the only solution is to use aptitude to repair dependencies, but aptitude can only be installed through apt, and apt cannot be used because of dpkg problems.
Encountering such a nasty problem, I decided to just delete and reopen, which wasted me a few more hours.
Therefore, I recommend installing aptitude first, so that no matter whether you encounter problems or not, there is such a solution.
2. Port conflict problem
In a previous post, I mentioned being aware of port conflicts.
However, the port conflict of WSL is not like a pure Linux/Windows environment, it will directly report a fatal error and then exit. If WSL uses the same port as Windows, there will be no prompt.
For example: SSH Server For Windows uses port 22, and WSL's SSH uses port 22. This does not conflict, but access to port 22 can only access SSH Server For Windows.
Therefore, when the correct port is accessed but the returned results do not match, you can try to troubleshoot this problem.
3, Systemd problem
WSL is not a full Linux system, so there will be some weird bugs, such as systemctl
not working at all.
Therefore, replace systemctl
with service
. NOTE: The order of parameters differs between the two commands, for example:
1 | systemctl start ssh service ssh start |
4. Software download and installation problems
Because the system release version cannot be obtained (or Microsoft is returned), using pip
to download some software (for example: supervisor) will report an error, and there is no version corresponding to the release version.
Therefore, it is recommended to install directly using apt:
1 | sudo apt install supervisor |
5, Windows firewall problem
By default, using WSL to install software (such as OpenSSH, Python) will pop up Windows Firewall, asking whether to allow the software to use the network.
When using cmd/powershell directly, you can directly click to allow access, but if you use SSH connection, it is often not easy to notice this problem.
Therefore, when the installation software is stuck, you can remotely connect to the desktop to see if there is a Windows Firewall pop-up, or disable it directly.
WSL Tutorial (2) Error Avoidance Guide
Comments