You are not logged in.

#1 2009-08-06 15:17:52

nmuntz
Member
From: MD, USA
Registered: 2008-11-27
Posts: 4

ldconfig: command not found

I just did a pacman -Syu and something went terribly wrong.
Whenever i try to install a new program i get something like this:

$ pacman -S glibc
warning: glibc-2.10.1-3 is up to date -- reinstalling
resolving dependencies...
looking for inter-conflicts...

Targets (1): glibc-2.10.1-3

Total Download Size:    0.00 MB
Total Installed Size:   31.47 MB

Proceed with installation? [Y/n]
checking package integrity...
(1/1) checking for file conflicts                   [##############################] 100%
(1/1) upgrading glibc                               [##############################] 100%
/tmp/alpm_ZLRuBH/.INSTALL: line 39: ldconfig: command not found
/tmp/alpm_ZLRuBH/.INSTALL: line 40: init: command not found
Generating locales...
  en_US.UTF-8... done
  en_US.ISO-8859-1... done
Generation complete.
sh: ldconfig: command not found
error: command failed to execute correctly
Checking the integrity of the local database in /var/lib/pacman/

any ideas?

Offline

#2 2009-08-06 15:21:02

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,392
Website

Re: ldconfig: command not found

workaround: put /sbin back in your path or do not upgrade using sudo.  This will be fixed in 3.3.1

Offline

#3 2009-08-06 15:22:11

nmuntz
Member
From: MD, USA
Registered: 2008-11-27
Posts: 4

Re: ldconfig: command not found

so is this a pacman issue?

Offline

#4 2009-08-06 16:02:23

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,392
Website

Re: ldconfig: command not found

yes - it was not spotted during testing as most people have /sbin in their path

Offline

#5 2009-08-08 13:49:31

gofree
Member
From: Slovakia
Registered: 2008-07-26
Posts: 51

Re: ldconfig: command not found

please could you guide me a little bit how to do it ( change the path ) ? I just did a fresh install on a new laptop and a feel like without hands withou pacman working sad thanks a lot

Offline

#6 2009-08-08 13:53:31

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,392
Website

Re: ldconfig: command not found

You should not have to by default...  The default /etc/profile contains:

PATH="/bin:/usr/bin:/sbin:/usr/sbin"

so you should have /sbin in your path.

Offline

#7 2009-08-08 14:28:22

gofree
Member
From: Slovakia
Registered: 2008-07-26
Posts: 51

Re: ldconfig: command not found

i feel like a dumb sad tried what I think was the solution based on your guide, unsuccesfull sad sorry but I need solution in copy paste format smile if you dont mind, your help will be really appreciated, thanks again

Offline

#8 2009-08-11 13:27:05

tmi999
Member
Registered: 2009-04-13
Posts: 6

Re: ldconfig: command not found

To add sbin:

export PATH="/bin:/usr/bin:/sbin:/usr/sbin"

But it will be removed after logout, so u need add this command to your .bashrc file

Last edited by tmi999 (2009-08-11 13:27:40)

Offline

#9 2009-08-15 12:30:02

djszapi
Member
From: Cambridge, United Kingdom
Registered: 2009-06-14
Posts: 1,439
Website

Re: ldconfig: command not found

gofree: Why isn't it default on your system ?

Offline

#10 2009-09-09 17:03:14

jordz
Member
Registered: 2006-02-01
Posts: 248

Re: ldconfig: command not found

Same problem with screen, /sbin is in my path, I have nothing strange in my .screenrc

Normal:

[jordz@jordz-server ~]$ echo $PATH
/bin:/usr/bin:/sbin:/usr/sbin:/sbin:/usr/bin/perlbin/site:/usr/bin/perlbin/vendor:/usr/bin/perlbin/core

Screen:

[jordz@jordz-server ~]$ echo $PATH
/usr/bin:/bin

Offline

#11 2009-09-23 22:11:57

iamsmrt
Member
Registered: 2009-08-12
Posts: 138

Re: ldconfig: command not found

I'm having the same problem and have /sbin in my path.

Offline

#12 2009-09-24 07:45:24

jordz
Member
Registered: 2006-02-01
Posts: 248

Re: ldconfig: command not found

I noticed that when you start screen from /etc/rc.local, /etc/profile doesn't get sources.
Starting screen manually works well.

Offline

#13 2009-09-24 08:32:54

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: ldconfig: command not found

Anyway pacman 3.3.1 is released and is in testing now.

But it looks like you all have pretty weird issues with $PATH that you need to investigate and fix.


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#14 2009-09-24 14:32:53

stargeizer
Member
Registered: 2004-04-05
Posts: 8

Re: ldconfig: command not found

Have all the users with GNOME started a root's Terminal window???

I've noticed that using the Gnome's root terminal messes up the $PATH variable (as of today)... when i start archlinux (note: i don't use GDM) my path is:

/bin:/usr/bin:/sbin:/usr/sbin....

and many other items... but when a root terminal is started inside gnome, $PATH changes to:

/usr/ucb:/bin:/usr/bin:/etc

And ldconfig will fail... (and any other tool in /sbin) this change is restricted to this window only. If you exit the root terminal and go to a normal terminal, the path is what is expected.

This happens on a clean reformatted machine, installed archlinux, doing a pacman -Syu, installing gnome and all extras (including system administrations tools) (as tested today).

Maybe some config file is messed or is a bug from the Gnome guys...

Anyways the only workaround i can think is to start a normal terminal (for the guys that use gnome or use GDM to start their machines) and in the terminal doing a "su -" to got root access (of course will ask for the password) and then update/install/whatever you want with pacman.

And sorry about my english.

J.

Last edited by stargeizer (2009-09-24 14:35:10)

Offline

#15 2009-09-27 20:28:33

pseudonomous
Member
Registered: 2008-04-23
Posts: 349

Re: ldconfig: command not found

I'm sorry to add more fuel to the fire here, but:

My $PATH variable looks okay:

/bin:/usr/bin:/sbin:/usr/sbin:/opt/java/jre/bin:/usr/bin/perlbin/site:/usr/bin/perlbin/vendor:/usr/bin/perlbin/core

But I still can't upgrade with "sudo pacman -S*" without getting the:

sh: ldconfig: command not found                                                                                              
error: command failed to execute correctly

error, although things seem fine when I upgrade packages as root.  I'm using the 3.3.0-3 version of pacman.  Should I bother reporting this bug, or just login as root to upgrade until the new pacman is released?

The only thing I don't have that isn't available from uncommenting lines the default sudoers file is:

Defaults env_keep="EDITOR VISUAL"

Offline

#16 2009-09-27 20:37:10

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: ldconfig: command not found

I don't know if this is a right way to check, but maybe you could check the output of "sudo echo $PATH" ?

Otherwise 3.3.1 is out. It is just that the package is still in testing repo.

I am not sure how reporting a bug would help. We can not fix the same problem twice smile


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#17 2009-09-28 23:35:12

pseudonomous
Member
Registered: 2008-04-23
Posts: 349

Re: ldconfig: command not found

My $PATH still looks the same w/ "sudo echo $PATH$ ... but "sudo env" will show that my sudo path is screwed up, guess I'll have to read the sudo Docs to fix it...

Offline

#18 2010-05-23 19:08:31

jalu
Member
Registered: 2009-04-05
Posts: 140

Re: ldconfig: command not found

sudo echo $PATH will show the $PATH of the calling user (at least that seems to be the case, please correct me if I'm wrong here).

To see the $PATH of the root user, you'll need to:
sudo su
echo $PATH

In my case, adding /sbin and /usr/sbin to the $PATH and reinstalling all affected packages seemed to do the trick.

Offline

#19 2010-05-23 19:10:26

jalu
Member
Registered: 2009-04-05
Posts: 140

Re: ldconfig: command not found

On a side note, why was I seeing this issue? I didn't have /sbin and /usr/sbin in root's $PATH, but I am running pacman v3.3.3.

Last edited by jalu (2010-05-23 19:10:43)

Offline

#20 2010-05-24 10:08:16

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: ldconfig: command not found

jalu wrote:

On a side note, why was I seeing this issue? I didn't have /sbin and /usr/sbin in root's $PATH, but I am running pacman v3.3.3.

Well I don't know how that's possible, pacman v3.3.3 uses full path to ldconfig, so as long at it exists, it should find it.
lib/libalpm/util.c:                     _alpm_run_chroot(root, "/sbin/ldconfig");

Are you using pacman on a normal system or in a chroot ? If the latter, ldconfig must be inside the chroot.

You could have a look at pacman --debug output , maybe strace too. And if that doesn't help, add some more debugging in the C code.


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#21 2010-05-24 18:33:05

jalu
Member
Registered: 2009-04-05
Posts: 140

Re: ldconfig: command not found

Not using chroot, no. I'll take a look at pacman --debug next time I'm upgrading something that involves ldconfig. Thanks for the tip.

Offline

#22 2010-06-27 02:26:05

jalu
Member
Registered: 2009-04-05
Posts: 140

Re: ldconfig: command not found

Hm, it does seem to be related to chroot. This is the output of pacman --debug:

debug: adding entry 'glibc' in 'local' cache
debug: executing ". /tmp/alpm_U4rgRh/.INSTALL; post_upgrade 2.12-4 2.12-4" under chroot "/"
debug: chrooting in /
/tmp/alpm_U4rgRh/.INSTALL: line 6: ldconfig: command not found
/tmp/alpm_U4rgRh/.INSTALL: line 7: init: command not found
Generating locales...
  en_US.UTF-8... done
  en_US.ISO-8859-1... done
Generation complete.
debug: call to waitpid succeeded
debug: running ldconfig
debug: executing "/sbin/ldconfig" under chroot "/"
...

Very interesting. What is chroot exactly? I read the ArchWiki article but don't exactly understand why pacman uses it. How do I stop using pacman from using it, or am I doing something wrong?

Last edited by jalu (2010-06-27 02:29:21)

Offline

#23 2010-06-27 03:11:42

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,392
Website

Re: ldconfig: command not found

shining wrote:
jalu wrote:

On a side note, why was I seeing this issue? I didn't have /sbin and /usr/sbin in root's $PATH, but I am running pacman v3.3.3.

Well I don't know how that's possible, pacman v3.3.3 uses full path to ldconfig, so as long at it exists, it should find it.
lib/libalpm/util.c:                     _alpm_run_chroot(root, "/sbin/ldconfig");

Are you using pacman on a normal system or in a chroot ? If the latter, ldconfig must be inside the chroot.

You could have a look at pacman --debug output , maybe strace too. And if that doesn't help, add some more debugging in the C code.

This is not pacman calling ldconfig but glibc calling it in post_install/upgrade.   There the full path is not used and people without /sbin in their path run into issues.

Offline

#24 2010-06-27 09:57:55

jalu
Member
Registered: 2009-04-05
Posts: 140

Re: ldconfig: command not found

Very interesting. Thanks for the tip, Allan.

It looks like my solution was to:
1. sudo visudo
2. Add PATH to the env_keep section.

Does this seem like a reasonable solution to everyone, or am I doing something atypical?

Offline

Board footer

Powered by FluxBB