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

4
  • 1
    You shouldn't, as PKGBUILD can be out dated at anytime.
    – daisy
    Mar 21, 2013 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, 2013 at 4:21
  • If pkgver+pkgrel+pkgname are unchanged, it's useless to reinstall Mar 21, 2013 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, 2013 at 21:02

2 Answers 2

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

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .