简体   繁体   English

如何从AUR安装包还需要依赖AUR包的包

[英]How to install a package from AUR which further need dependent AUR packages

So. 所以。 I am using ArchLinux with i3 window manager (In short no proper Desktop Environment). 我正在使用ArchLinux和i3窗口管理器(简而言之,没有适当的桌面环境)。 I am new to Arch Linux 我是Arch Linux的新手

I am trying to install this package called "shutter" which will help me to take a screenshot. 我正在尝试安装这个名为“快门”的软件包,这将帮助我截取屏幕截图。

Now, i tried installing "shutter" 现在,我尝试安装“快门”

sudo pacman -S shutter

Unfortunately, shutter is not available in the pacman repository (Or whatever it is called, sorry) I knew its not available, yet I just wanted to try and went ahead and gave it a try. 不幸的是,在pacman存储库中没有快门(或者无论它叫什么,对不起)我知道它不可用,但我只是想尝试并继续尝试。

The reason why I knew it was not available was cause it was listed in AUR. 我知道它不可用的原因是因为它在AUR中列出。 Now packages in AUR are the one which are not there in the main repository. 现在,AUR中的包是主存储库中不存在的包。 Fine. 精细。 I download the package from its git and tried "making" it. 我从它的git下载包并试着“制作”它。

git clone aur.blah.blah.shutter.git
cd shutter
makepkg -s

Now this is the error I faced. 现在这是我面临的错误。

[pc@PC shutter]$ makepkg -s
==> Making package: shutter 0.93.1-11 (Thu May 18 19:05:21 UTC 2017)
==> Checking runtime dependencies...
==> Installing missing dependencies...
[sudo] password for pc:
error: target not found: gnome-perl
error: target not found: perl-gnome2-wnck
error: target not found: perl-gtk2-imageview
error: target not found: perl-gtk2-unique
warning: skipping target: perl-xml-simple
==> ERROR: 'pacman' failed to install missing dependencies.

Now, I saw this list carefully and realised that these dependency packages, for example, gnome-perl and other, are themselves not available in pacman's main repo but are present in AUR. 现在,我仔细看了这个列表,并意识到这些依赖包,例如gnome-perl和其他,本身在pacman的主回购中不可用,但存在于AUR中。 So it makes sense why pacman is not able to locate the target. 所以为什么pacman无法找到目标是有道理的。

To verify I tried : 验证我试过:

[pc@PC shutter]$ sudo pacman -S gnome-perl
error: target not found: gnome-perl

So Yes, this "gnome-perl" and the other dependencies too are a part of AUR and hence when "makepkg" tells pacman to install it, pacman simple fails. 所以,是的,这个“gnome-perl”和其他依赖项也是AUR的一部分,因此当“makepkg”告诉pacman安装它时,pacman simple就会失败。

So, How am I suppose to install such packages from AUR which are further dependent so heavily on other AUR packages? 那么,我想如何从AUR安装这些进一步依赖其他AUR包的包呢?

Thank You in advance. 先感谢您。 If my concepts are wrong. 如果我的想法是错的。 Please guide. 请指导。 Thanks again. 再次感谢。

PS : I did sudo pacman -Syyu, but not luck, afterall these packages are not the part of main repo and are in AUR so updating pacman mirrorlist and system update should not fix it. PS:我做了sudo pacman -Syyu,但没有运气,毕竟这些软件包不是主要仓库的一部分而且在AUR中,所以更新pacman mirrorlist和系统更新不应该修复它。

In case it is useful to you, this is a simple bash function that tries to download and install a list of packages. 如果它对您有用,这是一个简单的bash函数,它试图下载并安装包列表。 Of course it doesn't do dependency resolution, so you need to install dependencies before the packages that depend on them. 当然它不执行依赖项解析,因此您需要在依赖它们的包之前安装依赖项。

aur_manual_install() {
    [[ ! -d aur_packages ]] && mkdir aur_packages
    pushd aur_packages
    for PKG in "$@" ; do
        curl -o ${PKG}.tar.gz https://aur.archlinux.org/cgit/aur.git/snapshot/${PKG}.tar.gz
        tar zxvf ${PKG}.tar.gz
        rm ${PKG}.tar.gz
        pushd ${PKG}
        makepkg -csi --noconfirm
        popd
    done
    popd
    #rm -rf aur_packages # Uncomment if you want to clean up after install
}

Example of usage (the arguments are the list of packages to install in order): 用法示例(参数是要按顺序安装的软件包列表):

aur_manual_install cower-git pacaur

Maybe you want to add set -e to stop in case of error, etc. 也许你想添加set -e以在出现错误时停止等。

Edit 1: original code I posted had some issues because it was extracted from a bigger script. 编辑1:我发布的原始代码存在一些问题,因为它是从更大的脚本中提取的。

Edit 2: I made some progress trying to install that package: 编辑2:我在尝试安装该软件包时取得了一些进展:

aur_manual_install \
gnome-perl gnome-vfs gnome-vfs-nosmb gnome-vfs-perl gnomecanvas-perl libbonobo libbonoboui libgnome libgnome-data libgnomeui orbit2 perl-gnome2-wnck perl-gtk2-imageview perl-gtk2-unique shutter

(There are probably other packages that were already installed). (可能已经安装了其他软件包)。

Edit 3: I had to install gnome-vfs-nosmb manually because it conflicted with gnome-vfs. 编辑3:我必须手动安装gnome-vfs-nosmb,因为它与gnome-vfs冲突。

Edit 4: finally! 编辑4:终于! after filling in all the remaining packages, I got it to work. 在填写所有剩余的包装后,我得到了它的工作。 But probably would be a good idea to ask the dev to update to GTK3 or similar; 但要求开发人员更新GTK3或类似内容可能是个好主意; whoops, apparently the project was last updated in 2014... 哎呀,显然该项目最后一次更新于2014年......

快门

You can tell Cower to recursively download AUR dependencies of an AUR package by specifying the download option -d twice like so -dd , -d -d or --download --download 您可以通过指定下载选项-d两次来告诉Cower以递归方式下载AUR包的AUR依赖项,例如-dd-d -d--download --download

From man cower : OPERATIONS -d, --download Download target. Pass this option twice to fetch uninstalled dependencies (done recursively). 来自man cowerOPERATIONS -d, --download Download target. Pass this option twice to fetch uninstalled dependencies (done recursively). OPERATIONS -d, --download Download target. Pass this option twice to fetch uninstalled dependencies (done recursively).

It would be much clearer if AUR had been inserted : Pass this option twice to fetch uninstalled AUR dependencies (done recursively). 如果插入AUR会更清楚:将此选项传递两次以获取已卸载的AUR依赖项(递归完成)。 But to be fair Cower only deals with the AUR. 但公平Cower只处理AUR。 ;) ;)

(Main Arch Repo dependencies (non-AUR) are already taken care of underwater by the makepkg command of course.) (主要的Arch Repo依赖关系(非AUR)当然已经由makepkg命令在水下处理。)

When installing it's probably better to download all AUR packages to one dedicated folder and leave them there. 安装它时,最好将所有AUR包下载到一个专用文件夹并保留在那里。 Cower keeps track of where packages were downloaded to and installed from. Cower会跟踪下载和安装软件包的位置。 (My AUR packages are all downloaded into /home/myUsername/AUR-packages because I'm the only user.) It all depends on your situation though. (我的AUR包都被下载到/home/myUsername/AUR-packages因为我是唯一的用户。)这完全取决于你的情况。

You first have to run makepkg -sic (or whatever options) in the folder of each AUR dependency. 首先必须在每个AUR依赖项的文件夹中运行makepkg -sic (或任何选项)。 Then in the folder of the main AUR package. 然后在主AUR包的文件夹中。

Updating : 更新:

To easily check if there are updates for installed AUR packages : 要轻松检查是否有已安装的AUR包的更新:

  • cower -u

  • then combine -u with -dd to also check and recursively download all AUR dependencies : cower -udd (or do this right away) 然后结合-u-dd来检查并递归下载所有AUR依赖项: cower -udd (或立即执行此操作)

  • then first cd into the folder of each AUR dependency and run makepkg -sic (or whatever options that you normally use) 然后先cd到每个AUR 依赖的文件夹,然后运行makepkg -sic (或任何选项,您通常使用)

  • then go into the folder of each top/main AUR package ( non-dependency the one that you actually installed and want to use) and run makepkg -sic (or whatever options that you normally use). 然后进入每个top / main AUR包的文件夹( 非依赖实际安装和想要使用的makepkg -sic )并运行makepkg -sic (或者你通常使用的任何选项)。

Don't forget that there is also a verbosity option -v which will also let you see all other packages which were checked for updates. 不要忘记还有一个详细的选项-v ,它还可以让你看到所有其他检查过更新的包。 Not just the ones with updates. 不只是有更新的。

The more AUR packages you have installed, you will realise that this needs automation by one or more scripts. 您安装的AUR包越多,您就会发现这需要一个或多个脚本自动化。

You might find useful some AUR package manager. 您可能会发现一些有用的AUR包管理器。

I personally use yaourt, it's very simple and automatically resolve dependencies. 我个人使用yaourt,它非常简单并自动解决依赖关系。

It's very easy to install, just follow the instructions: 这很容易安装,只需按照说明操作:

Yaourt Official Website Yaourt官方网站

To install a package (and all of it dependencies) run: 要安装包(及其所有依赖项),请运行:

yaourt -S shutter

You can use Yaourt . 你可以使用Yaourt。

You can install it by adding a repository to your pacman.conf 您可以通过向pacman.conf添加存储库来安装它

sudo nano /etc/pacman.conf

Add this in 'the REPOSITORIES' section : 在“存储区”部分添加:

[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/$arch

Update the pacman database and install yaourt 更新pacman数据库并安装yaourt

sudo pacman -Sy yaourt

Now you can install your package with : yaourt shutter 现在您可以使用: yaourt shutter安装您的包裹

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

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