There may be two reasons for this error:
1. The current user has insufficient permissions;
2. This file may be being used by other programs or users.
The general cause of the error is the former. The solution is to use the vi command to open the file, plus sudo in front to temporarily provide administrator permissions, such as using the command "sudo vi vimrc" to open the edit file.