You are not logged in.

#1 2009-06-09 16:42:56

print
Member
Registered: 2007-02-27
Posts: 174

pacman on RedHat

Hi, I'm trying to install pacman to manage package installation at work.  I want to have it set up so that everything gets installed into my /home/user prefix.  So far I have pacman built and running, but I get the following error when I try to sync:

% pacman -S
error: you cannot perform this operation unless you are root.

Here's strace output:

open("/home/user/lib/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=53096, ...}) = 0
mmap(NULL, 53096, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2ab8f56da000
close(3)                                = 0
open("/lib64/libc.so.6", O_RDONLY)      = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\332\341\3676\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1713088, ...}) = 0
mmap(0x36f7e00000, 3494168, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x36f7e00000
mprotect(0x36f7f4c000, 2097152, PROT_NONE) = 0
mmap(0x36f814c000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14c000) = 0x36f814c000
mmap(0x36f8151000, 16664, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x36f8151000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ab8f56e7000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ab8f56e8000
arch_prctl(ARCH_SET_FS, 0x2ab8f56e7af0) = 0
mprotect(0x36f814c000, 16384, PROT_READ) = 0
mprotect(0x36f7c1b000, 4096, PROT_READ) = 0
munmap(0x2ab8f56da000, 53096)           = 0
geteuid()                               = 2032
rt_sigaction(SIGINT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGINT, {0x406d80, [], SA_RESTORER, 0x36f7e30280}, NULL, 8) = 0
rt_sigaction(SIGTERM, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGTERM, {0x406d80, [], SA_RESTORER, 0x36f7e30280}, NULL, 8) = 0
rt_sigaction(SIGSEGV, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGSEGV, {0x406d80, [], SA_RESTORER, 0x36f7e30280}, NULL, 8) = 0
brk(0)                                  = 0x3ed3000
brk(0x3ef4000)                          = 0x3ef4000
open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
{st_mode=S_IFREG|0644, st_size=56413888, ...}) = 0
mmap(NULL, 56413888, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2ab8f56e9000
close(3)                                = 0
uname({sys="Linux", node="myhost", ...}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fffb5821600) = -1 EINVAL (Invalid argument)
stat("/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/home/user/var/lib/pacman/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/home/user/etc/pacman.conf", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=2131, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ab8f8cb6000
read(3, "#\n# /home/user/etc/pacman.conf"..., 4096) = 2131
stat("/home/user", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/home", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat("/home/user", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/home/user/var/lib/pacman/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/home/user/var/lib/pacman/sync/core", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/home/user/var/lib/pacman/sync/core/", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
fstat(4, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
fcntl(4, F_SETFD, FD_CLOEXEC)           = 0
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x2ab8f8cb6000, 4096)            = 0
open("/usr/share/locale/locale.alias", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=2528, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ab8f8cb6000
read(3, "# Locale name alias data base.\n#"..., 4096) = 2528
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x2ab8f8cb6000, 4096)            = 0
open("/home/user/share/locale/en_US.UTF-8/LC_MESSAGES/pacman.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/home/user/share/locale/en_US.utf8/LC_MESSAGES/pacman.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/home/user/share/locale/en_US/LC_MESSAGES/pacman.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/home/user/share/locale/en.UTF-8/LC_MESSAGES/pacman.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/home/user/share/locale/en.utf8/LC_MESSAGES/pacman.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/home/user/share/locale/en/LC_MESSAGES/pacman.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
fstat(1, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ab8f8cb6000
close(4)                                = 0
write(1, "error: you cannot perform this o"..., 62error: you cannot perform this operation unless you are root.
) = 62
exit_group(1)

Also, here's my ~/etc/pacman.conf:

# /home/user/etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives

#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
RootDir     = /home/user
DBPath      = /home/user/var/lib/pacman/
CacheDir    = /home/user/var/cache/pacman/pkg/
LogFile     = /home/user/var/log/pacman.log
HoldPkg     = pacman glibc
# If upgrades are available for these packages they will be asked for first
SyncFirst   = pacman
XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#XferCommand = /usr/bin/curl %u > %o
#CleanMethod = KeepInstalled

# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg   =
#IgnoreGroup =

#NoUpgrade   =
#NoExtract   =

# Misc options (all disabled by default)
#NoPassiveFtp
#UseSyslog
#ShowSize
#UseDelta
#TotalDownload

#
# REPOSITORIES
#   - can be defined here or included from another file
#   - pacman will search repositories in the order defined here
#   - local/custom mirrors can be added here or in separate files
#   - repositories listed first will take precedence when packages
#     have identical names, regardless of version number
#   - URLs will have $repo replaced by the name of the current repo
#
# Repository entries are of the format:
#       [repo-name]
#       Server = ServerName
#       Include = IncludePath
#
# The header [repo-name] is crucial - it must be present and
# uncommented to enable the repo.
#

# An example of a disabled remote package repository with multiple servers
# available. To enable, uncomment the following lines. You can add preferred
# servers immediately after the header and they will be used before the
# default mirrors.
[core]
Server = ftp://ftp.archlinux.org/core/os/arch
#Server = ftp://ftp.example.com/foobar/$repo/os/i686/
# The file referenced here should contain a list of 'Server = ' lines.

# An example of a custom package repository.  See the pacman manpage for
# tips on creating your own repositories.
#[custom]
#Server = file:///home/custompkgs

Can anyone shed some light?  It seems to me like this might be a permissions issue.

Thanks,
Noah


% whereis whatis whence which whoami whois who

Offline

#2 2009-06-09 18:30:53

tdy
Member
From: Sacremende
Registered: 2008-12-14
Posts: 440

Re: pacman on RedHat

As far as I can tell, pacman requires you to be root for all sync operations in its current implementation.  I don't think it checks or cares that all your db paths are user writeable.

Last edited by tdy (2009-06-09 18:45:37)

Offline

#3 2009-06-09 18:57:06

print
Member
Registered: 2007-02-27
Posts: 174

Re: pacman on RedHat

I fixed it by commenting out this code block in src/pacman/pacman.c:

/*
#if defined(HAVE_GETEUID) && !defined(CYGWIN)
  //check if we have sufficient permission for the requested operation
  if(myuid > 0 && needs_transaction()) {
    pm_printf(PM_LOG_ERROR, _("you cannot perform this operation unless you are root.\n"));
    cleanup(EXIT_FAILURE);
  }
#endif
*/

I might file a feature request for a --require-root flag.  Above code seems pointless because unix permissions support this type of access (or lack thereof) implicitly.

Thanks,
Noah

Last edited by print (2009-06-09 19:01:59)


% whereis whatis whence which whoami whois who

Offline

#4 2009-06-10 09:45:43

ckristi
Member
From: Bucharest, Romania
Registered: 2006-11-21
Posts: 225

Re: pacman on RedHat

Yes, you can change the source code by yourself and use it modified. You can also share this with friends who want that functionality... But remember to follow the GPL if you're going to share it. The fun of opensource. smile

Last edited by ckristi (2009-06-10 09:46:22)


In love I believe and in Linux I trust

Offline

#5 2009-06-10 18:55:16

print
Member
Registered: 2007-02-27
Posts: 174

Re: pacman on RedHat

The problem I'm running into now is that none of the post_install squibs work.  And; although I can install packages, they are looking for files relative to / as opposed to pacman.conf's RootDir.

Basically I want to be able to install _and use_ packages in an arbitrary prefix.  Might this work if I rebuilt all the packages from source using PKGBUILDs, or is there another/better way to do it?

For example, I get this when I run grep:

grep: error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such file or directory

Any way to tell it where to look as a normal (non-root) user?

Thanks,
Noah

Last edited by print (2009-06-10 19:12:56)


% whereis whatis whence which whoami whois who

Offline

#6 2009-06-10 21:25:13

ckristi
Member
From: Bucharest, Romania
Registered: 2006-11-21
Posts: 225

Re: pacman on RedHat

I guess you may use LD_LIBRARY_PATH environment variable to set path to your home-installed libraries, but I don't know if this will work. Never tried.

Last edited by ckristi (2009-06-10 21:25:46)


In love I believe and in Linux I trust

Offline

#7 2009-06-10 21:35:58

print
Member
Registered: 2007-02-27
Posts: 174

Re: pacman on RedHat

I tried that but I got a segfault.  I also tried LD_PRELOAD.  I was thinking if I could get pacman working (which I did) and then build everything else with abs it would work, but abs won't work and I get segfaults when I try to touch a file.

Noah


% whereis whatis whence which whoami whois who

Offline

#8 2009-06-10 22:07:35

Maki
Member
From: Skopje, Macedonia
Registered: 2007-10-16
Posts: 353
Website

Re: pacman on RedHat

I think it is better to make a chroot arch install http://wiki.archlinux.org/index.php/Arc … bit_system .
just do the setup on an arch box, copy on usb, setup schroot and enjoy smile


If it ain't broke, broke it then fix it.

Offline

#9 2009-06-11 04:31:48

print
Member
Registered: 2007-02-27
Posts: 174

Re: pacman on RedHat

Do I need root for schroot?  Can't seem to find much info on it out there.

TIA,
Noah

Last edited by print (2009-06-11 15:34:27)


% whereis whatis whence which whoami whois who

Offline

Board footer

Powered by FluxBB