You are not logged in.

#1 2008-10-12 21:04:43

impert
Member
Registered: 2008-10-12
Posts: 8

pacman not finding libalpm

Hi all,

I'm trying to install Arch following the wiki on installing from an existing Linux. I'm having a problem getting pacman to work.
I've chrooted into the partition where I've put Arch, but I get the following error when trying to run pacman

bash-3.2# pacman -Sy
pacman: error while loading shared libraries: libalpm.so.3: cannot open shared object file: No such file or directory

bash-3.2# ls /usr/lib | grep 'libalp*'
libalpm.so.3
libalpm.so.3.1.0

Any ideas? Do I need a symlink somewhere? Thanks in advance.

Offline

#2 2008-10-13 08:53:49

cemsbr
Member
From: Brazil
Registered: 2008-05-03
Posts: 90
Website

Re: pacman not finding libalpm

Have you run

pacman -Su

?

Offline

#3 2008-10-13 12:11:25

impert
Member
Registered: 2008-10-12
Posts: 8

Re: pacman not finding libalpm

Thanks for your reply. Since posting last night, I've managed to screw everything up, so it's back to square one. sad
Right now, I'm getting:

root@cwpc:/TEMP# usr/bin/pacman.static -Sy -r /ARCH
error: config file /etc/pacman.conf could not be read.

I got past this before, but I can't remember how

Offline

#4 2008-10-13 12:41:37

cemsbr
Member
From: Brazil
Registered: 2008-05-03
Posts: 90
Website

Re: pacman not finding libalpm

These are the relevant lines of /etc/pacman.conf:

[options]
HoldPkg     = pacman glibc
SyncFirst   = pacman

[core]
Include = /etc/pacman.d/mirrorlist

[extra]
Include = /etc/pacman.d/mirrorlist

[community]
Include = /etc/pacman.d/mirrorlist

And don't forget to try "pacman -Su" if "pacman -Syu" doesn't work.

Offline

#5 2008-10-13 14:07:23

impert
Member
Registered: 2008-10-12
Posts: 8

Re: pacman not finding libalpm

Thanks again for your time.
I've got those lines in /etc/pacman.conf.  And pacman  -Su gives:

root@cwpc:/TEMP# usr/bin/pacman -Su
usr/bin/pacman: error while loading shared libraries: libalpm.so.3: cannot open shared object file: No such file or directory
root@cwpc:/TEMP# ls -l /usr/lib | grep 'libalp'
root@cwpc:/TEMP# ls -l usr/lib | grep 'libalp'
-rw-r--r-- 1 root root 198102 2008-08-27 03:16 libalpm.a
lrwxrwxrwx 1 root root     16 2008-10-13 13:02 libalpm.so -> libalpm.so.3.1.0
lrwxrwxrwx 1 root root     16 2008-10-13 13:02 libalpm.so.3 -> libalpm.so.3.1.0
-rwxr-xr-x 1 root root 154100 2008-08-27 03:16 libalpm.so.3.1.0
root@cwpc:/TEMP#

I've got to go out now, so I'll have to  leave it for a bit. I think the problem is simply that I'm working in a directory called /TEMP, and it's a matter of not having  the right pathnames

Offline

#6 2008-10-13 15:04:35

cemsbr
Member
From: Brazil
Registered: 2008-05-03
Posts: 90
Website

Re: pacman not finding libalpm

Try this:

# mv /TEMP/usr/lib/libalpm* /usr/lib/
# ldconfig
# pacman -Syu

Offline

#7 2008-10-13 17:19:53

impert
Member
Registered: 2008-10-12
Posts: 8

Re: pacman not finding libalpm

Hmm

root@cwpc:/home/cam# pacman -Syu
The program 'pacman' is currently not installed.  You can install it by typing:
apt-get install pacman
bash: pacman: command not found
root@cwpc:/home/cam# /TEMP/usr/bin/pacman -Syu
/TEMP/usr/bin/pacman: error while loading shared libraries: libdownload.so: cannot open shared object file: No such file or directory
root@cwpc:/home/cam#

1 Didn't know you could have pacman in Ubuntu.
2 I think pacman is probably going to find a swag of shared libraries it can't load because the pathnames will be wrong. The simplest will no doubt be to get out of TEMP altogether, and do it from /, which is what the wiki suggests

It'll have to wait till tomorrow, as I 've got to go out now. Thanks for your help.

Offline

#8 2008-10-13 22:04:07

cemsbr
Member
From: Brazil
Registered: 2008-05-03
Posts: 90
Website

Re: pacman not finding libalpm

You forgot to tell me you were running ubuntu!

Can't you boot arch again? "ldconfig" will update the information about the libraries you have, including recently moved libalpm* files and then we hope pacman will run successfully.

Offline

#9 2008-10-14 12:24:51

impert
Member
Registered: 2008-10-12
Posts: 8

Re: pacman not finding libalpm

cemsbr wrote:

You forgot to tell me you were running ubuntu!

Can't you boot arch again? "ldconfig" will update the information about the libraries you have, including recently moved libalpm* files and then we hope pacman will run successfully.

Well, I did say I was trying to install Arch from another Linux.  And 'trying' still applies, I haven't got Arch to boot yet, I've had quite a few interruptions.
Probably I should have posted under 'installation', but I thought I had a problem with pacman.
Please don't worry too much, I'll get it sorted out sooner or later, and it's not a life-or-death thing, I do have a couple of other distros working. I'm only installing Arch for the fun of trying another one, and for the learning that comes with solving these problems Incidentally, I'm doing it this way because my motherboard is not very good at booting from a CD, in spite of having the boot preferences set to make the CD first priority.

Offline

#10 2008-10-14 14:14:30

cemsbr
Member
From: Brazil
Registered: 2008-05-03
Posts: 90
Website

Re: pacman not finding libalpm

I haven't installed arch using chroot, but I did a couple of gentoo installations this way. Reading the posts again, I think you just missed "ldconfig" prior to running pacman in the first post. Run "source /etc/profile" as soon as you chroot, just in case.

Last edited by cemsbr (2008-10-14 14:15:04)

Offline

#11 2008-10-14 17:24:18

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: pacman not finding libalpm

It looks like you're not actually chrooting. Running usr/bin/pacman from OUTSIDE the root is going to fail. You need to make sure you chroot so that you can run /usr/bin/pacman (note the leading slash).

Offline

#12 2008-10-14 23:05:52

impert
Member
Registered: 2008-10-12
Posts: 8

Re: pacman not finding libalpm

cemsbr and phrakture:

Thank you both for your interest. I was hoping not to waste any more of cemsbr's time.
I've had another go at it, and got a bit further this time.
For some reason chroot won't work:

root@cwpc:/# chroot /ARCH /bin/bash
chroot: cannot run command `/bin/bash': No such file or directory
root@cwpc:/# ls -l /bin
total 6400
-rwxr-xr-x 1 root root  813912 2008-05-12 20:36 bash

chroot: cannot run command `/bin/bash': No such file or directory
root@cwpc:/ARCH# ls
bin  etc         pacman-3.2.1-1-i686.pkg.tar.gz         proc  sys  var
dev  lost+found  pacman-static-3.2.1-1-i686.pkg.tar.gz  root  usr  x86_64
root@cwpc:/ARCH# ls bin
bash          chown          fuser       lspci

Though as you can see, bin/bash exists both in / and the new ARCH directory.

I managed to get pacman.static to extract pacman and the base packages by putting pacman.conf in my Ubuntu /etc, editing it as per the wiki, copying it to /ARCH/etc, then modifying the Ubuntu one to read
RootDir  = /ARCH
DBPath = /ARCH/var/lib/pacman

and so on. This means that my original problem, getting pacman to work, is SOLVED. Magic. Unfortunately it all turned pear-shaped in the next few steps:

root@cwpc:/ARCH# mkdir dev
root@cwpc:/ARCH# cd dev
root@cwpc:/ARCH/dev# mknod -m 660 console c 5 1
root@cwpc:/ARCH/dev# mknod -m 660 null c 1 3
root@cwpc:/ARCH/dev# mount -o bind /dev /ARCH/dev
root@cwpc:/ARCH/dev# mount -t proc none /ARCH
root@cwpc:/ARCH/dev# mount -o bind /sys /ARCH/sys
root@cwpc:/ARCH/dev# cp /etc/resolv.conf /ARCH/etc/
cp: cannot create regular file `/ARCH/etc/': Is a directory

One or more of those commands zapped the whole /ARCH directory, scrubbing /etc with all the rest. My guess is that mount -t proc is the culprit, since ls gives:

1     2552  5215  5708  6114  6223  9068         fb            partitions
10    2555  5216  5715  6117  6264  9083         filesystems   sched_debug
11    2868  5272  5716  6133  6373  9090         fs            scsi

and much more of the same.
Tomorrow I'll re-extract all the bits with pacman.static, copy a /boot directory from elsewhere if necessary, edit an /etc/fstab file rc.conf and a menu.lst, and see if it will boot. It's a bit weird that chroot didn't work though - it has in the past.
Thanks again, and I'll mark this as solved, if I can figure out how.

Offline

#13 2008-10-15 00:35:00

cemsbr
Member
From: Brazil
Registered: 2008-05-03
Posts: 90
Website

Re: pacman not finding libalpm

I can't understand why chroot doesn't see /ARCH/bin/bash if it _is_ there. Could you post the wiki page you are following?

Offline

#14 2008-10-15 15:08:50

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: pacman not finding libalpm

Agreed. The initial chroot failing is the big issue here. It simply shouldn't be failing.

How did you setup the ARCH dir?

The reason your mount setup balked is because you mounted a proc filesystem over the ARCH dir. You probably wanted ARCH/proc instead

If pacman works in the host system... you can do:


cd /ARCH
mkdir {proc,sys,dev}
mount -o bind /dev dev/
mount -t proc none proc/
mount -t sysfs none sys/
cp /etc/resolv.conf /etc/mtab etc/

#Now we can install!
cd ..
pacman -r ARCH/ -S base

Offline

#15 2008-10-16 12:32:38

impert
Member
Registered: 2008-10-12
Posts: 8

Re: pacman not finding libalpm

OOPS!
I wrote a reply to this yesterday and apparently forgot to hit the Submit button.

cemsbr wrote:

I can't understand why chroot doesn't see /ARCH/bin/bash if it _is_ there. Could you post the wiki page you are following?

I can't understand it  either - yet . The wiki is at:
http://wiki.archlinux.org/index.php/Ins … ting_Linux

About a third of the way down the page you'll find:

If you don't mind to litter your install-host, you can just cd to /, and extract the pacman.pkg.tar.gz you downloaded.

I do mind littering my host so I thought I'd work in a directory.

How did you setup the ARCH dir?

If I remember rightly, (I've thrashed about a bit since) after downloading ftp.archlinux.orgto the desktop, I did:
mkdir /ARCH
mount /dev/sdb7 /ARCH
copied the folder to /ARCH, untarred it there, and added a few bits that seemed to be missing, like /bin/bash, /home, /sys and so forth.

The reason your mount setup balked is because you mounted a proc filesystem over the ARCH dir. You probably wanted ARCH/proc instead

Aha. Actually, I can't see the point of mounting these at this stage: surely if /etc/fstab is ok they will get mounted at boot.

Well, after telling you that I couldn't get my motherboard to boot from a live CD, lo and behold yesterday it relented. (I'm convinced it's dodgy, sometimes it will, usually not. Pausing doesn't seem to help) So last night I got three parts of th way through a live-CD installation but failed when I went to set the root password, with the message
chroot: password: no such file or directory. (Or words to that effect, repeated in an endless loop). Chroot again, but the one from Arch.
But things are looking up, most of the bits are there, it almost booted last night, but failed predictably enough because at one stage I pinched a kernel from Ubuntu, and there's a mismatch between the kernel image Grub tries to boot, and what's there. Fixable.

Anyway, thanks to both for your time and interest, but please don't give it any more thought. I'm doing this not quite by the book, so it's not surprising if things don't work sometimes. Also, I'm quite happy playing about, and I find I learn more if I make my own mistakes, rather than if someone smooths the way too much.

Cheers

Offline

Board footer

Powered by FluxBB