要启动代码和编译C ++,必须安装编译器。就我的情况而言, msys2 可以通过 mingw 提供。根据 weblote ,我在没有任何错误的情况下安装了该软件。现在,我应该通过输入 pacman -sys
来更新软件包数据库和基本软件包
错误:无法同步所有数据库(无法锁定数据库)
在线搜索解决方案后,我发现删除/删除 db.lck
将起作用,为此,我将有效使用此命令 rm/var/lib/pacman/db.lck
但是它显示了另一个错误。目前,在互联网上没有解决此问题的解决方案。
我还粘贴了引用的 msys2 msys 的终端输出。
$ pacman -Sys
:: Synchronizing package databases...
error: failed to synchronize all databases (unable to lock database)
VIRAT@DESKTOP-97BS0AB MSYS ~
$ rm /var/lib/pacman/db.lck
rm: cannot remove '/var/lib/pacman/db.lck': No such file or directory
VIRAT@DESKTOP-97BS0AB MSYS ~
$ pacman -S --needed base-devel mingw-w64-x86_64-toolchain
error: failed to init transaction (unable to lock database)
error: could not lock database: Permission denied
VIRAT@DESKTOP-97BS0AB MSYS ~
$ pacman -Su
error: failed to init transaction (unable to lock database)
error: could not lock database: Permission denied
VIRAT@DESKTOP-97BS0AB MSYS ~
$
To start Code and Compile C++, must install a compiler. For my case, it is MSYS2 through which MinGW is available. According to the installation guild mentioned on the website, I installed the software without any errors. Now I was supposed to update the package database and base packages by entering pacman -Sys
but it has shown an error
error: failed to synchronize all databases (unable to lock database)
After searching online for a solution I found that deleting/removing the db.lck
will work, for that, I used this command rm /var/lib/pacman/db.lck
but it showed another error. Right now there is no solution to this on the internet.
I've also pasted the terminal output of MSYS2 MSYS for refernce.
$ pacman -Sys
:: Synchronizing package databases...
error: failed to synchronize all databases (unable to lock database)
VIRAT@DESKTOP-97BS0AB MSYS ~
$ rm /var/lib/pacman/db.lck
rm: cannot remove '/var/lib/pacman/db.lck': No such file or directory
VIRAT@DESKTOP-97BS0AB MSYS ~
$ pacman -S --needed base-devel mingw-w64-x86_64-toolchain
error: failed to init transaction (unable to lock database)
error: could not lock database: Permission denied
VIRAT@DESKTOP-97BS0AB MSYS ~
$ pacman -Su
error: failed to init transaction (unable to lock database)
error: could not lock database: Permission denied
VIRAT@DESKTOP-97BS0AB MSYS ~
$
发布评论
评论(2)
正如我在那里发现了2个解决方案的解决方案。尝试两者:
解决方案:1
c:\ users \ your_account_name \ appdata \ roaming \ roaming \ microsoft \ microsoft \ windows \ windows \ start \ start菜单\ sprogry \ msys2 64bit
运行“ msys2 msys” as aistricator
运行命令: pacman -syu
解决方案-2 :
c:\ msys64 \ var \ lib \ lib \ pacman(转到下载的文件夹)
>
删除 “ db.lck” file
资源:
解决方案1:Padro先生( https:// stackoverflow .com/users/18910613/pedro )解决方案对我有所帮助。
对于解决方案2
As I found there 2 solutions for this error. Try both :
Solution : 1
C:\Users\your_account_name\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\MSYS2 64bit
Run "MSYS2 MSYS" as administrator
Run the command : pacman -Syu
Solution - 2 :
C:\msys64\var\lib\pacman ( Go to the downloaded folder)
Delete the "db.lck" file
RESOURCES :
For solution 1 : Mr. Padro's (https://stackoverflow.com/users/18910613/pedro) solution helped me.
For solution 2
https://www.reddit.com/r/archlinux/comments/nvrny2/pacman_error_failed_to_synchronize_all_databases/
尝试运行管理员特权的MSYS应用程序...为我工作
Try to run MSYS app under administrator privilege... worked for me