当软件包(来自 AUR)已经安装时,有没有办法让 yaourt 不重新安装
$ yaourt -Q jruby
local/jruby 1.7.3-1
但不知何故
$ yaourt --needed --noconfirm -S jruby
保持重新下载(即使之前已经下载过)并重新安装jruby
可以用一个简单的脚本来解决:
打开文件
$ vim yaourt-helper.sh
创建脚本
#!/bin/bash
_update="yaourt -Syua --noconfirm"
if ! which $1 2>/dev/null 1>&2; then
echo 'Package not installed, installing'
$_update $1
exit $?;
fi
echo 'Already installed, checking for upgrade'
$_update
设置权限并执行
$ chmod +x yaourt-helper.sh && ./yaourt-helper.sh jruby
注意:--noconfirm
除非您确切知道自己在做什么,否则使用是危险的。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句