0

I am trying to set up a chroot and I ran

sudo qemu-debootstrap --arch=amd64 stretch /srv/chroot/focal-amd64

during the second stage i realized that I wanted focal, not stretch. Copy & paste error.
So I hit ctrl + c and wanted to try again.

sudo rm -rf /srv/chroot/focal-amd64/*

however i get spammed with

rm: cannot remove '/srv/chroot/focal-amd64/proc/[...]': Operation not permitted

I tried setting write permissions to directories with

find -type d | xargs chmod +rwx

with the same errors. No matter what I try to do it seems like I can't delete the folder anymore to try again.

Before, when I let the chroot creation finish, I was able to delete the directory without any problems afterwards, it's only after I interrupted this one that this happens.

FalcoGer
  • 847
  • 1
  • 9
  • 26
  • 1
    [This solution might help](https://askubuntu.com/a/894026/1222991) – matigo May 05 '21 at 22:11
  • I had the same problem using Ubuntu under WSL. Running `wsl --shutdown` and then deleting the folder from explorer fixed it for me. – Jonno_FTW Feb 22 '22 at 04:22

1 Answers1

0

As suggested in the comments, this solution might help.

I managed by unplugging the hard drive and putting it into another machine and deleting the folder there without any issues.

FalcoGer
  • 847
  • 1
  • 9
  • 26