8

After removing yaourt and package-query, upgrading pacman to v4.0.1 and reinstalling the latest package-query and yaourt from AUR, I can't use yaourt anymore. It tells me:

Unable to open file: /usr/local/etc/pacman.conf

I don't understand why it's looking there now and not in /etc. Meanwhile pacman is working normally. If I create a symlink to pacman.conf, I get the following error instead:

failed to initialize alpm library (could not find or read directory)

My $PATH is:

/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/vendor_perl:/usr/bin/core_perl

I have tried looking in the yaourt PKGBUILD prior to installing, reinstalling it, looking in the yaourt script file, and I can't find anything suspicious. Not sure what to look for, what could have happened?

EDIT: Found the solution: /usr/bin needs to be before /usr/local/bin in $PATH.

  • Post your edit as an answer! :) – iglvzx Jan 19 '12 at 11:00
  • 1
    I would, but I need to wait 7 hours. :) – Toerndev Jan 19 '12 at 11:02
9

Yaourt apparently uses the first entry in $PATH, so /usr/bin needs to be before /usr/local/bin there.

Changing this in /etc/profile solved the problem.

| improve this answer | |
  • 2
    Programs always use the first entry in $PATH. The real problem seems to be that you have yaourt installed twice, in /usr and /usr/local. – user1686 Jan 22 '12 at 16:19
  • That's good to know! How can you tell that it is installed twice? I removed it with pacman -Rs before installing the new version. – Toerndev Jan 26 '12 at 5:59
1

Reinstall package-query using empty --prefix: ./configure --prefix=

| improve this answer | |
1

I had the same issue. The problem (as mentioned in other answers) is that if you run:

[linux]$ echo $PATH
[linux]$ /usr/local/sbin:/usr/local/bin:/usr/bin .....

Notice that /usr/local/sbin and /usr/local/bin appear first, so the programs searched for will be taken from these locations (if they exist).

Have a look in /usr/local/bin to see if you can see package-query there; if you can, then your issues are being caused by this, it shouldn't be there (unless you installed it there). So. Lets fix it......

Start by removing YAOURT:

sudo pacman -R yaourt
checking dependencies...

Packages (1) yaourt-1.9-1

Total Removed Size:  0.81 MiB

:: Do you want to remove these packages? [Y/n] y
:: Processing package changes...
(1/1) removing yaourt                                                                                                             [############################################################################] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...

And then remove package-query:

[linux]$ sudo pacman -R package-query
checking dependencies...

Packages (1) package-query-1.9-3

Total Removed Size:  0.08 MiB

:: Do you want to remove these packages? [Y/n] y
:: Processing package changes...
(1/1) removing package-query                                                                                                      [############################################################################] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...

Finally, manually remove the stray package-query binary:

[linux]$ sudo rm -rf /usr/local/bin/package-query

Now, re-install yaourt (and package-query) using the instructions supplied here: https://archlinux.fr/yaourt-en

And you should be good to go.

| improve this answer | |

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.