"apt-cache search" is slow because of listing /var/lib/apt/lists 45227 times (triggered by 'Acquire::Languages "none";')
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt (Debian) |
Fix Released
|
Unknown
|
|||
apt (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I've recognized that "apt-cache search" has become quite slow on my system, and when stracing it it shows that it lists the contents of /var/lib/apt/lists a lot (45227 times!):
openat(
getdents64(3, /* 156 entries */, 32768) = 13920
getdents64(3, /* 0 entries */, 32768) = 0
close(3) = 0
% grep -c 'openat(AT_FDCWD, "/var/lib/
45227
(this count is reproducible with a second run)
% time apt-cache search tomahawk
apt-cache search tomahawk 3.84s user 4.54s system 99% cpu 8.427 total
I am attaching the full output of strace.
TEST CASE:
% strace apt-cache search tomahawk 2>&1 | grep -c 'openat(AT_FDCWD, "/var/lib/
45227
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: apt 0.8.16~
ProcVersionSign
Uname: Linux 3.2.0-24-
ApportVersion: 2.0.1-0ubuntu8
Architecture: i386
Date: Sat May 26 19:39:11 2012
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release i386 (20110427.1)
SourcePackage: apt
UpgradeStatus: Upgraded to precise on 2011-12-16 (162 days ago)
CVE References
description: | updated |
Changed in apt (Debian): | |
status: | Unknown → New |
Changed in apt (Debian): | |
status: | New → Fix Released |
Status changed to 'Confirmed' because the bug affects multiple users.