-2

I want to use Kali Linux on my Windows 11 machine through wsl. After installing kali on my wsl, I did sudo apt update -y which worked fine, then sudo apt upgrade -y which is now stuck at 2% progress for over 20 min. This operation shouldn't take that long.

this is how it looks like

Performed sudo apt update -y and this worked fine, then sudo apt upgrade -y, which is not completing. The progress bar is stuck at 2% for over 20 minutes now. I can't terminate the process with "ctrl + c". If I try to open another kali terminal window and run the sudo apt upgrade command, then I get the "Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 126 (apt)..." error.

Apparently the first upgrade command is still running, but it isn't finishing. What could be the reason behind this and what could I try to solve it?

Thank you!

1

3 Answers 3

0

I experienced this today and noticed that the telinit process was running at 100% cpu when looking at the top output in another terminal.

Executing sudo kill -9 <telinit pid> allowed the upgrade to complete.

2
  • Checked the processes with 'top' then found out that one was, indeed, at 100%. Killed it, reran the command and it worked. Thank you very much!
    – ValsiRod
    Commented May 29 at 14:58
  • Not sure why you were downvoted. Helped me
    – Brett
    Commented Jun 14 at 1:15
0

Steps

  1. Open Powershell as administration
  2. Run this command wsl --unresgister
  3. Uninstall Linux WSL from Windows
  4. Again download from Microsoft store
  5. Then run your Linux WSL after installation
  6. Don't run any upgrade just run sudo apt-get update
  7. After that run these two command in Linux WSL
  8. "sudo mv /usr/sbin/telinit /usr/sbin/telinit.bak "
  9. "sudo ln -s /usr/bin/true /usr/sbin/telinit"
  10. After this then run sudo apt-get update && sudo apt-get upgrade
  11. Boom Problem fixed

By Shahriyar Sojib Hasan

-1

I was experiencing the same problem during the upgrade of Kali Linux on wsl2. I also tried to fix the problem by deleting the lock files but it didn't work for me .

 $ sudo rm /var/lib/apt/lists/lock
 $ sudo rm /var/cache/apt/archives/lock
 $ sudo rm /var/lib/dpkg/lock

I used this command and it works for me.

$ `sudo apt install -f`

or

$ sudo dpkg --configure -a

You must log in to answer this question.