Cargo build hangs with " Blocking waiting for file lock on the registry index" after building parity from source

Running cargo clean seems to fix the problem.


I had the same issue and got around it with rm -rf ~/.cargo/registry/index/*.

Edit: I suggest looking at this answer first.


This happens when you run 2 compilations of the same project at the same time. The compiler uses a lock file to avoid having data race issues. There are some possibilities:

  • If you ran the 2 compilations yourself, the solution is obvious: you need to cancel one of them.

  • If you use an IDE that automatically compiles your project: you can wait for the job to be finished or close the IDE. If it does not work, this is probably because of RLS hanging out. You can just pkill rls to solve the issue.

  • As a last resort, you can remove the lock forcefully: rm -rf ~/.cargo/registry/index/* as said in another answer.