[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#414202: marked as done (apt: Unable to specify options on the command line that work via a conf file - lock errors)



Your message dated Sun, 11 Mar 2007 16:24:48 +0000
with message-id <20070311162448.e5e24d5c.codehelp@debian.org>
and subject line RTFM
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: apt
Version: 0.6.46.4-0.1
Severity: normal

This apt-conf file does work:
(In this example, /var/emdebian/sqlite is a non-privileged directory)

Dir "/var/emdebian/sqlite/"
{
  Etc "/var/emdebian/sqlite/"
  {
    SourceList "sources-debian.unstable";
  };
  State "unstable-amd64/"
  {
    Status "/var/emdebian/sqlite/status-debian"
  }
  Cache "unstable-amd64/";
};

The same options on the command line do not:

apt-get -o Apt::Dir="/var/emdebian/sqlite/" \
        -o Apt::Dir::Etc="/var/emdebian/sqlite/" \
        -o Apt::Dir::Etc::SourceList="sources-debian.unstable" \
        -o Apt::Dir::State=unstable-amd64/ \
        -o Apt::Dir::State::Status="/var/emdebian/sqlite/status" \
        -o Apt::Dir::Cache=unstable-amd64/ \
        update

Example in an arbitrary directory:
mkdir -p archives/partial 
mkdir -p lists/partial
mkdir unstable
touch status.unstable
apt-get -o Apt::Dir="$PWD" -o Apt::Dir::Etc::SourceList="sources.unstable" -o Apt::Dir::State="unstable/" -o Apt::Dir::State::Lists="lists/" -o Apt::Dir::State::Status="status.unstable" -o Apt::Dir::Cache="unstable/" update 
E: Could not open lock file /var/lib/apt/lists/lock - open (13 Permission denied)
E: Unable to lock the list directory

Despite the directories being specifically set to non-privileged
folders, apt still tries to use /var/lib/apt/

This is complicating my embedded work where it is common to require
multiple apt caches for different architectures and suites. The bug
leads to many many apt-conf.foo files being either auto-generated or
packaged alongside the script and then maintained or copied each time a
different architecture needs to be queried.

With 11 supported cross-building architectures, two suites (rising to
three, possibly four) and three buildd platforms, the permutations of
apt.conf-foo files is becoming a real problem.

When using sudo, apt-get ignores the command line options are updates
the cache files according to my /etc/apt/sources.list NOT the local
sources.unstable file that I specified on the command line.

The same errors occur with apt-cache:

$ apt-cache -o Apt::Dir="$PWD" -o Apt::Dir::Etc::SourceList="sources.unstable" -o Apt::Dir::State="unstable/" -o Apt::Dir::State::Lists="lists/" -o Apt::Dir::State::Status="status.unstable" -o Apt::Dir::Cache="unstable/" pkgnames

prints the list of pkgnames from the system cache, not the local one.

Enclosing all options within one quote does not affect the problem:

$ apt-get -o 'Apt::Dir="/var/emdebian/sqlite/"
Apt::Dir::Etc="/var/emdebian/sqlite/"
Apt::Dir::Etc::SourceList="sources-debian.unstable"
Apt::Dir::State="unstable-amd64/"
Apt::Dir::State::Status="/var/emdebian/sqlite/status-debian"
Apt::Dir::Cache="unstable-amd64/"' update
E: Could not open lock file /var/lib/apt/lists/lock - open (13 Permission denied)
E: Unable to lock the list directory

$ cd ~
$ apt-get -o Apt::Dir::State::Lists="$PWD/lists/" update
E: Could not open lock file /var/lib/apt/lists/lock - open (13 Permission denied)
E: Unable to lock the list directory

apt-(get|cache) just seem to ignore -o command line options that work fine
when using the -c <filename> method.

-- Package-specific info:

-- apt-config dump --

APT "";
APT::Architecture "amd64";
APT::Build-Essential "";
APT::Build-Essential:: "build-essential";
APT::Authentication "";
APT::Authentication::TrustCDROM "true";
Dir "/";
Dir::State "var/lib/apt/";
Dir::State::lists "lists/";
Dir::State::cdroms "cdroms.list";
Dir::State::userstatus "status.user";
Dir::State::status "/var/lib/dpkg/status";
Dir::Cache "var/cache/apt/";
Dir::Cache::archives "archives/";
Dir::Cache::srcpkgcache "srcpkgcache.bin";
Dir::Cache::pkgcache "pkgcache.bin";
Dir::Etc "etc/apt/";
Dir::Etc::sourcelist "sources.list";
Dir::Etc::sourceparts "sources.list.d";
Dir::Etc::vendorlist "vendors.list";
Dir::Etc::vendorparts "vendors.list.d";
Dir::Etc::main "apt.conf";
Dir::Etc::parts "apt.conf.d";
Dir::Etc::preferences "preferences";
Dir::Bin "";
Dir::Bin::methods "/usr/lib/apt/methods";
Dir::Bin::dpkg "/usr/bin/dpkg";
DPkg "";
DPkg::Pre-Install-Pkgs "";
DPkg::Pre-Install-Pkgs:: "/usr/bin/apt-listchanges --apt || test $? -ne 10";
DPkg::Pre-Install-Pkgs:: "/usr/sbin/dpkg-preconfigure --apt || true";
DPkg::Tools "";
DPkg::Tools::Options "";
DPkg::Tools::Options::/usr/bin/apt-listchanges "";
DPkg::Tools::Options::/usr/bin/apt-listchanges::Version "2";

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


-- /etc/apt/sources.list --

deb ftp://mirror.ox.ac.uk/debian/ unstable main
deb-src ftp://mirror.ox.ac.uk/debian/ unstable main

#deb ftp://mirror.ox.ac.uk/debian/ experimental main
#deb-src ftp://mirror.ox.ac.uk/debian/ experimental main

deb http://www.linux.codehelp.co.uk/packages unstable main
deb-src http://www.linux.codehelp.co.uk/packages unstable main

#deb http://www.linux.codehelp.co.uk/packages experimental main
#deb-src http://www.linux.codehelp.co.uk/packages experimental main

#deb http://www.emdebian.org/emdebian/unstable main
deb http://www.emdebian.org/debian/ unstable main
deb-src http://www.emdebian.org/debian/ unstable main

deb-src http://mentors.debian.net/debian unstable main


-- System Information:
Debian Release: 4.0
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-4-amd64
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)

Versions of packages apt depends on:
ii  debian-archive-keyring      2007.02.19   GnuPG archive keys of the Debian a
ii  libc6                       2.3.6.ds1-13 GNU C Library: Shared libraries
ii  libgcc1                     1:4.1.1-21   GCC support library
ii  libstdc++6                  4.1.1-21     The GNU Standard C++ Library v3

apt recommends no packages.

-- no debconf information


--- End Message ---
--- Begin Message ---
Sorry, misread apt.conf(5) - the -o option is Dir::foo, not Apt::Dir::foo.

The correct syntax for the command line should have been:

apt-get \
	-o Dir="/var/emdebian/sqlite/" \
	-o Dir::Etc="/var/emdebian/sqlite/" \
	-o Dir::Etc::SourceList="sources-debian.unstable" \
	-o Dir::State=unstable-amd64/ \
	-o Dir::State::Status="/var/emdebian/sqlite/status" \
	-o Dir::Cache=unstable-amd64/ \
	update

Ign http://www.emdebian.org unstable Release.gpg
Hit http://www.emdebian.org unstable Release
Ign http://www.emdebian.org unstable/main Packages/DiffIndex
Ign http://www.emdebian.org unstable/main Packages
Hit http://www.emdebian.org unstable/main Packages
Reading package lists... Done

Similarly:
$ mkdir -p unstable/archives/partial
$ mkdir -p unstable/lists/partial
$ touch unstable/status.unstable
$ echo "deb ftp://mirror.ox.ac.uk/debian/ unstable main" > sources.unstable
$ echo "deb-src ftp://mirror.ox.ac.uk/debian/ unstable main" >> sources.unstable
$ apt-get \
	-o Dir="$PWD" \
	-o Dir::Etc="$PWD" \
	-o Dir::Etc::SourceList="sources.unstable" \
	-o Dir::State=unstable/ \
	-o Dir::State::Status="status.unstable" \
	-o Dir::Cache=unstable/ \
	update

Hit ftp://mirror.ox.ac.uk unstable Release.gpg
Hit ftp://mirror.ox.ac.uk unstable Release
Get: 1 ftp://mirror.ox.ac.uk unstable/main Packages/DiffIndex [2038B]
Get: 2 ftp://mirror.ox.ac.uk unstable/main Sources/DiffIndex [2023B]
Fetched 4061B in 1s (3970B/s)
Reading package lists... Done

Sorry for the noise.

Closing the report.

--


Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

Attachment: pgp_SHOhS4elv.pgp
Description: PGP signature


--- End Message ---

Reply to: