如何在 Arch Linux 上使用 Pacman 下载源代码?

发布于 2024-10-08 05:45:07 字数 1459 浏览 2 评论 0原文

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

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

发布评论

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

评论(3

沙沙粒小 2024-10-15 05:45:07
  1. pacman -S asp
  2. 说你是否想要Linux命令的源代码find

    1. 找出命令 find 属于哪个包:
      pacman -Qo $(找到)。结果是
      “/usr/bin/find 属于 findutils 4.4.2-3”。
  3. asp 导出 findutils

  4. cd findutils
    makepkg -o
    

现在您已经有了源代码。

  1. pacman -S asp
  2. say if you want the source code of the Linux command find

    1. find out which package the command find belongs to:
      pacman -Qo $(which find). The result is
      "/usr/bin/find is owned by findutils 4.4.2-3".
  3. asp export findutils

  4. cd findutils
    makepkg -o
    

Now you have your source code.

千年*琉璃梦 2024-10-15 05:45:07

2018 更新:

下面描述的 abs 工具已已弃用,自 2017 年中期以来,它及其 rsync 端点已被删除。

asp 工具现在提供类似的功能。更多信息请参见此处


正如已经提到的,您可以使用 ABS(Arch Build System):

使用 pacman 安装它:

sudo pacman -S base-devel abs

首先,下载 ABS 树:

sudo abs

然后,获取特定的包:

sudo abs [package_name]

然后从本地ABS树中复制您想要获得其源代码的包(例如 /var/abs/core/findutils)到另一个目录,例如 /home/blabla/abs

然后运行 ​​makepkg

  • 如果您只想获取源代码并且不想构建软件包,则可以运行 makepkg -od

  • 否则运行 makepkg -s,它将自动处理该包的所有依赖项

  • 请注意,因为 makepkg 会覆盖您的修改,请使用 makepkg -e 来构建本地源

如果您想安装您构建的软件包,请运行

pacman -U name-of-package.xz

2018 Update:

The abs tool described below has been deprecated and it along with its rsync endpoint have been dropped since mid 2017.

The asp tool now provides similar functionality. More information here.


As already mentioned you can use the ABS (Arch Build System):

Install it using pacman:

sudo pacman -S base-devel abs

First, download the ABS tree:

sudo abs

Then, get a specific package:

sudo abs [package_name]

Then copy the package, whose source you want to have, from the local abs tree (e.g. /var/abs/core/findutils) to another directory, e.g. /home/blabla/abs

Then run makepkg:

  • if you only want to get the sources and don't want to build the package you can run makepkg -od

  • otherwise run makepkg -s, which will then handle all the package's dependencies automatically

  • watch out becaouse makepkg will overwrite your modifications, use makepkg -e to build your local sources instead

If you want to install the package you've built, run

pacman -U name-of-package.xz
离鸿 2024-10-15 05:45:07

编辑:由于 ABS 的更改,此答案已过时。

您可以从 Arch Linux SVN 存储库(称为 ABS)获取软件包源。

首先在网上找到包:
http://www.archlinux.org/packages/?q=coreutils

然后,在包详细信息页面上,右侧使用 SVN 链接,例如:
http://repos.archlinux.org/wsvn/packages/coreutils/trunk/

在那里,你有一个可爱的“下载”按钮,在这种情况下它会导致:
http://repos.archlinux.org/wsvn/ packages/coreutils/trunk/?op=dl&isdir=1

它比 apt-get source 稍微复杂一点。但也许您在 AUR 上找到了适合您的工具,例如 yaourt 支持从源构建并导出它们。

Edit: This answer is outdated due to changes on ABS.

You get the package sources from the Arch Linux SVN repository, called ABS.

First find the package online:
http://www.archlinux.org/packages/?q=coreutils

Then, on the package details page, on the right side use the SVN links, e.g.:
http://repos.archlinux.org/wsvn/packages/coreutils/trunk/

And there, you have a sweet "Download" button, in this case it leads to:
http://repos.archlinux.org/wsvn/packages/coreutils/trunk/?op=dl&isdir=1

It is a little bit more complicated than apt-get source. But perhaps you find a tool on AUR that does the job for you, for example yaourt supports building from sources and exporting them.

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