Arch 用户软件仓库

Revision as of 16:16, 29 December 2022 by FuzzyBot (talk | contribs) (Updating to match new version of source page)
Other languages:
Deutsch • ‎English • ‎Türkçe • ‎français • ‎português do Brasil • ‎русский • ‎فارسی • ‎中文(中国大陆)‎

概述

自担使用AUR的风险!
Manjaro 团队不会向遇到 AUR 有关问题的用户提供帮助。当 Manjaro 更新后,来自 AUR 的软件包可能会停止工作。这不是 Manjaro 的问题

尽管 Manjaro 和Arch Linux 很像,并且 Manjaro 就基于它,但在 Manjaro 中访问他们的官方仓库以供使用是不可能的。Manjaro会使用自己的仓库以保证任何软件包都是可访问的且经过实验确保稳定的,例如系统更新和应用程序。但从 Arch 用户软件仓库(AUR)安装更多的软件包是可能的。

AUR是由 Arch Linux 用户社区管理的。尽管这个仓库是非官方的,但如果仓库中的软件包足够受欢迎,那么最终是可以进入 Arch Linux 的官方 community 库的。

AUR作为社区维护的仓库,存在潜在的风险和问题。

使用 AUR 软件包可能会出现的问题:

  • 同一个软件包会有两个版本
  • 软件包会过时
  • 软件包无法使用或只有部分功能可用
  • 错误配置的软件包会下载不必要的依赖,或不下载必要的依赖(两种可能同时出现)
  • 遇到恶意的软件包(尽管很罕见)。

因此,尽管 AUR 提供的许多软件包都应该可以工作,但不要期望安装过程总是像使用 Manjaro 官方仓库时那样简单。

有些时候,自己可能需要识别并安装依赖(例如安装中断后)。

同样,也不能保证任何已安装的软件都能正常工作(如果你已经安装了的话)。


Info
您应该熟悉手动编译过程,以便做好故障排除的准备。


访问 AUR

使用带有 GUI 的 Pamac

打开 Pamac ——在启动器中的名字叫做“添加/删除软件”——然后转到首选项页面。您需要输入密码以访问。选择第三方选项卡,然后打开 AUR 支持。请确保你有必要的程序从源代码编译应用程序

user $ pamac install base-devel git COPY TO CLIPBOARD


Using commandline Pamac

Info
It is strongly recommended to follow this link AUR website and examine the relevant page(s) for any and all software intended to be installed.


These pages contain comments from both existing users and package developers, which may provide valuable information (such as, warnings and/or solutions to problems). To search for and install software packages from the AUR, the syntax is:

user $ pamac search -a [software package name] COPY TO CLIPBOARD

For example, if wishing to install Google Chrome - first follow this link to all Google Chrome build scripts and verify which package you want to build.Or you can ask pamac - for Google Chrome candidates. Just use the search command and Google Chrome as the query. Look over the results or narrow the search parameters - just remember pamac cannot tell you of any issues with build scripts - only the relevant page. E.g. following this link to the buildscript for Google Chrome

user $ pamac search Google Chrome COPY TO CLIPBOARD

In the example we choose the standard version of Google Chrome. To build the google-chrome package with pamac enter the following and press enter

user $ pamac build google-chrome COPY TO CLIPBOARD

You will be presented with the outcome of the chosen build with all dependencies and you will be asked a couple of questions.

  1. Query to edit build files. This is a precaution to verify that the build scripts does not contain malicious actions.
  2. Query to continue download and install dependencies then download the sources, build and install the app.
  3. You will be asked for your password before anything happens.

Using GUI Octopi

See this guide for enabling AUR support in Octopi.

Installing from the AUR by hand

Manual

To do that follow the steps given below:

  • Be sure you have the necessary files for building applications from source
user $ pamac install base-devel git COPY TO CLIPBOARD

  • Clone the PKGBUILD
user $ git clone https://aur.archlinux.org/google-chrome.git COPY TO CLIPBOARD


  • Change directory to cloned folder
user $ cd google-chrome COPY TO CLIPBOARD


  • To make/compile the package, run:
user $ makepkg -s COPY TO CLIPBOARD


This will build the package and pull in any dependencies needed. Note: it won't pull a dependency from the AUR, only from the Manjaro Repos.. If you list the folder content

user $ ls COPY TO CLIPBOARD


you'll probably find a few new files. You're interested in the one that ends with .pkg.tar.zst

  • The final event is running $sudo pacman -U on that file
user $ sudo pacman -U google-chrome-ver.rel.bugfix.build-pkgrel.pkg.zst COPY TO CLIPBOARD


And you've done it...the safest way to install from the AUR. This is essentially what most install scripts do for you.

Note: Instead of using sudo pacman -U google-chrome-ver.rel.bugfix.build-pkgrel.pkg.zst can also use:

user $ makepkg -i COPY TO CLIPBOARD

Note: To combine above steps into one:

user $ makepkg -is COPY TO CLIPBOARD



Upgrading the packages installed from the AUR

The following command will upgrade all packages on the system including AUR builds

user $ pamac upgrade -a COPY TO CLIPBOARD