简体   繁体   English

makepkg 错误“无法创建目录 $BUILDDIR”

[英]makepkg error "failed to create the directory $BUILDDIR"

Title explains it all really.标题真的说明了一切。 Whenever I try to makepkg in a directory in non-root I get the previous error followed by "An unknwon error has occured. Exiting...".每当我尝试在非 root 目录中的 makepkg 时,我都会收到先前的错误,然后是“发生未知错误。正在退出...”。

I had the same error when trying to install yaourt on a clean install of arch, what fixed it was changing write permissions with:当我尝试在全新安装的 arch 上安装 yaourt 时,我遇到了同样的错误,修复它的是更改写入权限:

sudo chmod a+w sudo chmod a+w

This error comes from https://git.archlinux.org/pacman.git/tree/scripts/libmakepkg/util/util.sh.in?h=v5.1.0#n88 and means that the directory referred to by the BUILDDIR variable documented in the makepkg.conf(5) manpage, does not exist and you don't have permissions to create it.此错误来自https://git.archlinux.org/pacman.git/tree/scripts/libmakepkg/util/util.sh.in?h=v5.1.0#n88并且意味着 BUILDDIR 变量引用的目录记录在makepkg.conf(5)联机帮助页中,不存在并且您无权创建它。

So... figure out where this is being set, and fix that.所以...弄清楚这是在哪里设置的,然后修复它。

Note also that the full error message provided by makepkg would include the directory which could not be created, in parentheses after the text of your title.另请注意,makepkg 提供的完整错误消息将包括无法创建的目录,位于标题文本后的括号中。 So not only does the title not say it all, it is missing the debugging information specifically added by the developers in order to help users solve the issue as fast as possible.所以不仅标题没有说明一切,还漏掉了开发者为了帮助用户尽快解决问题而特意添加的调试信息。

I had the same problem trying to install yay.我在尝试安装 yay 时遇到了同样的问题。 yay does not like to run as root, or under the /root folder (directly or not directly). yay 不喜欢以 root 身份运行,或在 /root 文件夹下运行(直接或不直接)。 The problem was that I tried to do everything under /root directory: cloned the yay git package into /root/downloads, then chown the git file (and directory) to user arch, then switched user to arch (su arch), then tried to run makepkg... The solution was simple - switch to arch user first :问题是我试图在 /root 目录下做所有事情:将 yay git package 克隆到 /root/downloads,然后将 git 文件(和目录) chown到用户 arch,然后将用户切换到 arch(su arch),然后尝试运行 makepkg... 解决方案很简单 -首先切换到 arch 用户

su arch
cd /home/arch
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si

his issue comes up in a search—you are most likely trying to run makepkg somewhere outside your home directory, where you do not have permissions.他的问题出现在搜索中——你很可能试图在你的主目录之外的某个地方运行makepkg ,而你没有权限。

Move the PKGBUILD (and any associated files) somewhere under another folder like Download or..... try 100% work.PKGBUILD (和任何相关文件)移动到另一个文件夹下的某处,例如下载或......尝试 100% 工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM