mingw pacman -sys无法锁定数据库

发布于 2025-01-21 16:16:39 字数 1144 浏览 0 评论 0 原文

要启动代码和编译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 ~
$

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

姜生凉生 2025-01-28 16:16:39

正如我在那里发现了2个解决方案的解决方案。尝试两者:

解决方案:1

  1. c:\ users \ your_account_name \ appdata \ roaming \ roaming \ microsoft \ microsoft \ windows \ windows \ start \ start菜单\ sprogry \ msys2 64bit

  2. 运行“ msys2 msys” as aistricator

  3. 运行命令: pacman -syu

解决方案-2

  1. c:\ msys64 \ var \ lib \ lib \ pacman(转到下载的文件夹)

    >

  2. 删除 “ 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

  1. C:\Users\your_account_name\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\MSYS2 64bit

  2. Run "MSYS2 MSYS" as administrator

  3. Run the command : pacman -Syu

Solution - 2 :

  1. C:\msys64\var\lib\pacman ( Go to the downloaded folder)

  2. 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/

美人迟暮 2025-01-28 16:16:39

尝试运行管理员特权的MSYS应用程序...为我工作

Try to run MSYS app under administrator privilege... worked for me

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文