The Ubuntu terminal may throw out an error – Failed to fork on Windows 11/10. This terminal gets installed under the feature of Windows Subsystem for Linux. This error is caused by a lack of memory and can occur when a user tries to get the latest updates for the terminal. The error reads:
# apt-get update
FATAL -> Failed to fork.

What is a fork error in Ubuntu?
Fork is a method in Linux and Ubuntu for creating a new process. When there is an error or exception when the fork method is called, it results in Fork Error. There are many possible causes, including lack of memory (cannot allocate memory), a limit on the number of running processes (too many processes), etc.; the user or program receives this error.
Fatal, Failed to Fork error with Ubuntu on Windows 11
If you receive Failed to Fork error with Ubuntu on Windows 11/10, we suggest you try the following suggestions:
- Create a new Swap file.
- Disable the Antivirus.
You may need an admin account to execute these suggestions.
1] Create a new Swap file
Open the Terminal for the Windows Subsystem for Linux distro and enter the following command to create a new swap file and allocate 4 Gigabytes to it:
sudo fallocate -1 4G /swapfile
Make the file more secure by entering this command:
sudo chmod 600 /swapfile
Set the swap space with this command:
sudo mkswap /swapfile
Next, enable the swap space with this command:
sudo swapon /swapfile
Reboot your computer after closing the distro and check. Your error should be fixed.
2] Disable the Antivirus
Your antivirus might be affecting the proper functioning of the activities in the WSL Terminal. We recommend you to temporarily turn the Antivirus solution or Windows Defender off and check if that fixes the error.
Turn it on after the operation completes successfully.
We hope you found the steps easy to follow and that you were successful in resolving the issue.
Related: Windows Subsystem for Linux has no installed distributions.
What is a Swap file in Ubuntu?
Like Windows, Ubuntu allocates a portion of storage to store temporary information when the physical memory is full. It helps ensure processes run smoothly and that Ubuntu doesn’t run into “out of memory ” issues. Ubuntu also allows users to configure the total size of the Swap file, and it performs better when you have storage with high read-write speed.