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

Bug#1004583: overwriting {,src}pkgcache.bin on near-every APT call strains flash



Control: reopen -1

On Sun, Jan 30, 2022 at 07:10:34PM +0000, Ivan Shmakov wrote:
> 	A proper solution would be to move to some file format that
> 	allows in-place updates, such as Berkeley DB or SQLite.

No it would not be. The best we can do, and maybe should do
is move pkgcache.bin to /run.

In-place updates means _a lot_ of things can go wrong. Like
you forget to delete packages that are no longer in the
repository.

There's also no way to change this in any case, the database
format is an integral part of the public API, it would take
decade(s) to switch to anything else.

Unfortunately I only thought about moving pkgcache.bin to
/run directly after sending the close email, but I think
that might be a reasonable compromise to discuss, and if
we support $XDG_RUNTIME_DIR/apt/pkgcache.bin as well, then
that would even get us caching for non-root users.

How to move that file out of /var/cache/apt is going to be
a tricky question, as that location is to some extend part
of the API as well - people might set Dir::Cache to /tmp/apt
and expect pkgcache.bin to end up in /tmp/apt.

With regards to srcpkgcache.bin, which represents the available
packages, but no installed packages (pkgcache.bin is built from
it by adding the dpkg status file in-place, in-memory, and then
writing it back out), I think having that around after a reboot
is what we want such that you don't need to rebuild the entire
cache each boot.

-- 
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer                              i speak de, en


Reply to: