apt: Segfault when using non-standard directories

Josef Spillner 2005 at kuarepoti-dju.net
Fri Nov 28 15:00:20 UTC 2008

Package: apt
Version: 0.7.9ubuntu17
Severity: normal

[I'm sorry if this report arrives twice - my reportbug was stuck when sending 
via SMTP]

*** Please type your report below this line ***

I'm trying to use apt-get to install packages to a relocated system
directory, e.g. /tmp.

However, when running
 apt-get -o Dir::State::status=/tmp/ -o Dir::Cache::pkgcache=/tmp/ install w3m
apt produces a segfault.
The backtrace is:

(gdb) bt
#0  0xb7eac3f3 in pkgCache::ReMap () from
#1  0xb7eac638 in pkgCache::pkgCache () from
#2  0xb7ede900 in ?? () from /usr/lib/libapt-pkg-libc6.7-6.so.4.6
#3  0xb7edf00f in pkgMakeStatusCache () from
#4  0xb7ed4fd9 in pkgCacheFile::BuildCaches () from
#5  0xb7ed5104 in pkgCacheFile::Open () from
#6  0x08060022 in ?? ()
#7  0xb7e9ce8b in CommandLine::DispatchArg () from
#8  0x0804f06b in ?? ()
#9  0xb7c14450 in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
#10 0x0804ce91 in ?? ()

I assume this has to do with its inability to find a package cache
there. Running 'apt-get -o ... -o Dir::State::lists=/tmp update' first
creates the package cache, but then also segfaults, not contributing
anything positive to the issue above.

man apt.conf(5) mentions a RootDir setting but this is not explained
anywhere, nor contained in the example configuration files or the Google
Therefore, the whole out-of-order installation process with apt-get,
e.g. for quarantine purposes, is severely broken. It's not trivial with
RPM either, but at least it's possible with:
 mkdir -p $prefix/$rpmdb
 rpm --initdb --dbpath $prefix/$rpmdb
 rpm --nosignature --replacepkgs --nodeps --dbpath $rpmdb --root $prefix --
relocate /=$prefix -i $@

apt-get could beat it by just getting a --root option which works
without further ado, and especially without fakeroot, so debootstrap
could also be rewritten to be based on that instead of many error-prone
custom-built scripts (modulo a few system packages).

-- Package-specific info:

-- (no /etc/apt/preferences present) --

-- (/etc/apt/sources.list present, but not submitted) --

-- System Information:
Debian Release: lenny/sid
  APT prefers hardy-updates
  APT policy: (500, 'hardy-updates'), (500, 'hardy-security'), (500, 'hardy')
Architecture: i386 (i686)

Kernel: Linux 2.6.24-19-386
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages apt depends on:
ii  libc6                   2.7-10ubuntu4    GNU C Library: Shared libraries
ii  libgcc1                 1:4.2.3-2ubuntu7 GCC support library
ii  libstdc++6              4.2.3-2ubuntu7   The GNU Standard C++ Library v3

Versions of packages apt recommends:
ii  ubuntu-keyring                2008.03.04 GnuPG keys of the Ubuntu archive

-- no debconf information

More information about the ubuntu-users mailing list