6

Is there a way to make yaourt does not reinstall when the package (from AUR) already installed

 $ yaourt -Q jruby
 local/jruby 1.7.3-1

but somehow

 $ yaourt --needed --noconfirm -S jruby

keep redownload (even if it has been downloaded before) and reinstall jruby

  • 1
    You shouldn't, as PKGBUILD can be out dated at anytime. – daisy Mar 21 '13 at 3:55
  • 1
    but it doesn't even updating, the installed version is exactly the same as to be downloaded one – Kokizzu Mar 21 '13 at 4:21
  • If pkgver+pkgrel+pkgname are unchanged, it's useless to reinstall – Gilles Quenot Mar 21 '13 at 16:26
  • yes i know, and i do not want to reinstall, i just want it to install when not installed and reinstall when it's already installed but has an update, but yaourt keep reinstalling when the package is from AUR even when there is no new update – Kokizzu Mar 21 '13 at 21:02
7

A solution can be made with a simple script:

  1. Open file

    $ vim yaourt-helper.sh
    
  2. Create script

    #!/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
    
  3. Set permissions and execute

$ chmod +x yaourt-helper.sh && ./yaourt-helper.sh jruby

Note: using --noconfirm is dangerous unless your know exactly what you're doing.

0

I would suggest using $@ instead of $1 in @anonimal's script. it would let to check all packages sent to script one-by-one

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.