How to Fix ‘Failed to fork on WSL with Ubuntu’ Error in Windows 10

WSL (Windows Subsystem for Linux) is a compatibility layer that is used to run Linux binary executables in Windows 10. The program was introduced in Windows 10 and Windows Server 2019 and has allowed a lot of developers the ease of using Linux based executables on Windows. However, quite recently, a lot of reports have been coming in of a “# apt-get update FATAL  -> Failed to fork” error while trying to update the Ubuntu system.

Error “/etc/cron.daily/apt:
FATAL -> Failed to fork.
channel: could not find working mirror, channel failed
sa-update failed for unknown reasons”

What Causes the “Failed to Fork” Error With Ubuntu in Windows 10?

After receiving numerous reports from multiple users, we decided to investigate the issue and devised a set of solutions to fix it completely. Also, we looked into the reasons due to which it is triggered and listed them as follows:

  • Insufficient Swap Memory: In some cases, there might be insufficient SWAP memory that is accessible by the application due to which this error is being triggered. The application requires a considerable amount of memory to be free in order to work properly.
  • Antivirus/Firewall: It was seen that a third-party antivirus or firewall might be blocking certain elements of the application from making contact with the server. The application requires a good internet connection to be established in order for it to work properly.

Now that you have a basic understanding of the nature of the problem, we will move on towards the solutions. Make sure to implement these in the specific order in which they are presented to avoid conflicts.

Solution 1: Disabling Antivirus

If you have a third party antivirus or Firewall installed it is recommended to completely disable it or add an exclusion for the Ubuntu application since it might be disabling some components of the application due to which the error might be triggered. In order to add an exclusion:

  1. Rightclick on the application in the system tray.
  2. Select “Open” and click on the settings option.
  3. Select “Add an Exclusion” button and point to the direction of the Ubuntu application.

Solution 2: Creating New Swap File

It is possible that the Storage on the Swap File was running out due to which the error was being triggered. Therefore, in this step, we will be creating a new Swap file. For that:

  1. Launch Ubuntu.
    Launching Ubuntu
  2. Type in the following command and press “Enter“.
    sudo fallocate -1 4G /swapfile
  3. The swap file has now been created but it still needs to be activated.
  4. In order to make the file more secure, type in the following command and press “Enter”.
    sudo chmod 600 /swapfile
  5. Now, type in the following command to set up the swap space and press “Enter”.
    sudo mkswap /swapfile
  6. In order to enable the swap space, type in the following command and press “Enter“.
    sudo swapon /swapfile
  7. Check to see if the issue persists after executing these commands.

Kevin Arrows

Kevin is a dynamic and self-motivated information technology professional, with a Thorough knowledge of all facets pertaining to network infrastructure design, implementation and administration. Superior record of delivering simultaneous large-scale mission critical projects on time and under budget.
Back to top button

Expert Tip

How to Fix ‘Failed to fork on WSL with Ubuntu’ Error in Windows 10

If the issue is with your Computer or a Laptop you should try using Restoro which can scan the repositories and replace corrupt and missing files. This works in most cases, where the issue is originated due to a system corruption. You can download Restoro by clicking the Download button below.

Download Now

I'm not interested