Bug#643787: apt-cache policy in non-default locale very slow
Package: apt
Version: 0.8.15.8
Severity: normal
If I run apt-cache policy (without arguments), it takes milliseconds.
If I run it under a different locale, e.g., LC_ALL=C apt-cache policy,
it takes about 4 or 5 seconds. There are some package build tools
that indirectly call apt-cache policy with LC_ALL=C, which makes the
overall package build very slow.
After digging a little deeper, the relevant locale category is
LC_MESSAGES. I guess it has to do with under which locale apt-get
update was run. strace of the apt-cache calls shows interesting
differences; I can forward those to someone privately if you can't
reproduce it.
-- Package-specific info:
-- apt-config dump --
APT "";
APT::Architecture "i386";
APT::Build-Essential "";
APT::Build-Essential:: "build-essential";
APT::Install-Recommends "true";
APT::Install-Suggests "false";
APT::Get "";
APT::Get::Purge "true";
APT::Get::AutomaticRemove "false";
APT::Get::Build-Dep-Automatic "true";
APT::Cache "";
APT::Cache::AllVersions "false";
APT::Cache::NamesOnly "true";
APT::Authentication "";
APT::Authentication::TrustCDROM "true";
APT::NeverAutoRemove "";
APT::NeverAutoRemove:: "^firmware-linux.*";
APT::NeverAutoRemove:: "^linux-firmware$";
APT::NeverAutoRemove:: "^linux-image.*";
APT::NeverAutoRemove:: "^kfreebsd-image.*";
APT::NeverAutoRemove:: "^linux-restricted-modules.*";
APT::NeverAutoRemove:: "^linux-ubuntu-modules-.*";
APT::NeverAutoRemove:: "^gnumach$";
APT::NeverAutoRemove:: "^gnumach-image.*";
APT::Never-MarkAuto-Sections "";
APT::Never-MarkAuto-Sections:: "metapackages";
APT::Never-MarkAuto-Sections:: "restricted/metapackages";
APT::Never-MarkAuto-Sections:: "universe/metapackages";
APT::Never-MarkAuto-Sections:: "multiverse/metapackages";
APT::Never-MarkAuto-Sections:: "oldlibs";
APT::Never-MarkAuto-Sections:: "restricted/oldlibs";
APT::Never-MarkAuto-Sections:: "universe/oldlibs";
APT::Never-MarkAuto-Sections:: "multiverse/oldlibs";
APT::Periodic "";
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "1";
APT::Periodic::Unattended-Upgrade "0";
APT::Update "";
APT::Update::Post-Invoke "";
APT::Update::Post-Invoke:: "touch /var/lib/apt/periodic/update-success-stamp 2>/dev/null || true";
APT::Update::Post-Invoke:: "echo timestamp >/var/lib/apt/update_success";
APT::Archives "";
APT::Archives::MaxAge "14";
APT::Archives::MinAge "2";
APT::Archives::MaxSize "512";
APT::Cache-Limit "40000000";
APT::Default-Release "testing";
APT::Architectures "";
APT::Architectures:: "i386";
Dir "/";
Dir::State "var/lib/apt/";
Dir::State::lists "lists/";
Dir::State::cdroms "cdroms.list";
Dir::State::mirrors "mirrors/";
Dir::State::extended_states "extended_states";
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::netrc "auth.conf";
Dir::Etc::parts "apt.conf.d";
Dir::Etc::preferences "preferences";
Dir::Etc::preferencesparts "preferences.d";
Dir::Etc::trusted "trusted.gpg";
Dir::Etc::trustedparts "trusted.gpg.d";
Dir::Bin "";
Dir::Bin::methods "/usr/lib/apt/methods";
Dir::Bin::dpkg "/usr/bin/dpkg";
Dir::Media "";
Dir::Media::MountPath "/media/apt";
Dir::Log "var/log/apt";
Dir::Log::Terminal "term.log";
Dir::Log::History "history.log";
Dir::Ignore-Files-Silently "";
Dir::Ignore-Files-Silently:: "~$";
Dir::Ignore-Files-Silently:: "\.disabled$";
Dir::Ignore-Files-Silently:: "\.bak$";
Dir::Ignore-Files-Silently:: "\.dpkg-[a-z]+$";
Acquire "";
Acquire::cdrom "";
Acquire::cdrom::mount "/media/cdrom/";
Acquire::Languages "";
Acquire::Languages:: "en";
Acquire::Languages:: "none";
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";
DPkg::Post-Invoke "";
DPkg::Post-Invoke:: "if [ -d /var/lib/update-notifier ]; then touch /var/lib/update-notifier/dpkg-run-stamp; fi; if [ -e /var/lib/update-notifier/updates-available ]; then echo > /var/lib/update-notifier/updates-available; fi ";
Unattended-Upgrade "";
Unattended-Upgrade::Origins-Pattern "";
Unattended-Upgrade::Origins-Pattern:: "origin=Debian,label=Debian-Security,archive=stable";
CommandLine "";
CommandLine::AsString "apt-config dump";
-- /etc/apt/preferences --
Package: *
Pin: release a=experimental
Pin-Priority: 101
Package: debian-policy
Pin: release a=unstable
Pin-Priority: 991
Package: devscripts
Pin: release a=unstable
Pin-Priority: 991
Package: lintian
Pin: release a=unstable
Pin-Priority: 991
-- /etc/apt/sources.list --
deb http://cdn.debian.net/debian/ oldstable main contrib non-free
deb-src http://cdn.debian.net/debian/ oldstable main contrib non-free
deb http://cdn.debian.net/debian/ stable main contrib non-free
deb-src http://cdn.debian.net/debian/ stable main contrib non-free
deb http://cdn.debian.net/debian/ testing main contrib non-free
deb-src http://cdn.debian.net/debian/ testing main contrib non-free
deb http://cdn.debian.net/debian/ unstable main contrib non-free
deb-src http://cdn.debian.net/debian/ unstable main contrib non-free
deb http://cdn.debian.net/debian/ experimental main contrib non-free
deb-src http://cdn.debian.net/debian/ experimental main contrib non-free
deb http://security.debian.org/ testing/updates main
deb-src http://security.debian.org/ testing/updates main
deb http://www.debian-multimedia.org testing main non-free
-- System Information:
Debian Release: wheezy/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (101, 'experimental')
Architecture: i386 (x86_64)
Kernel: Linux 3.0.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages apt depends on:
ii debian-archive-keyring 2010.08.28
ii gnupg 1.4.11-3
ii libc6 2.13-21
ii libgcc1 1:4.6.1-13
ii libstdc++6 4.6.1-13
ii zlib1g 1:1.2.3.4.dfsg-3
apt recommends no packages.
Versions of packages apt suggests:
ii apt-doc <none>
ii aptitude 0.6.3-4
ii bzip2 1.0.5-7
ii dpkg-dev 1.16.1
ii lzma 4.43-14
ii python-apt 0.8.0
ii synaptic 0.75.2
-- no debconf information
Reply to: