Package: apt

A friend's laptop's / had become full.  I found 9 gigabytes of
uselessly retained ancient debs in /var/cache/apt/archives.
"apt clean" fixed the problem.

I wondered why my laptop doesn't do this and a small amount of
digging found an etckeeper commit from 2017.  (See below.)
Presumably I discovered this wasn't happening on my laptop and thought
that it was somehow the result of something weird about my setup.
But evidently not, since my friend's install is much more vanilla.

My friend usually uses a GUI package manager.  I could enquire as to
which one.  I usually use "apt" and sometimes "apt-get" aned never use
a GUI package manager.  I don't know if the cache would still be being
maintained properly without my local change - ie, I don't know if the
bug I experienced in 2017 would happen to *me* now, but it doesn't
seem likely that anything has changed very much given the bug reports
I saw.

IMO something should ensure that files in /var/cache/apt are
eventually deleted.  I don't know if there is a thing that is supposed
to do this, but if there is it doesn't always work.  It probably ought
to be part of src:apt, since it's code in that package which is
creating these files.  So that is why I'm filing this bug here.

I searched the BTS for (archived and unarchived) bugs with "clean" in
the title.  Most of them seems to be bug reports (or feature requests)
relating to the behaviour of `apt clean`.

I found #160743 which is a report of the the same outcome, which was
closed after having been only partially resolved.  The mechanisms may
be different nowadays.

Partly, I am filing this bug to document my workaround.  Apparently,
it was sufficient, since `cd /etc && git grep -i clean apt` doesn't
show anything else.  So, my workaround is as follows:

Create the file /apt/apt.conf.d/50actually-clean
containing just this one line:

APT::Periodic::AutocleanInterval 7;

Ian.

commit a6030b5ee990c826550fe5c530c54215817bdf65
Author: root <r...@zealot.relativity.greenend.org.uk>
Date:   Mon Oct 9 02:12:17 2017 +0100

    daily autocommit

diff --git a/.etckeeper b/.etckeeper
index 9167d07..b47e059 100755
--- a/.etckeeper
+++ b/.etckeeper
@@ -434,6 +434,8 @@ maybe chmod 0444 'apt/apt.conf.d/01autoremove-kernels'
 maybe chmod 0644 'apt/apt.conf.d/05etckeeper'
 maybe chmod 0644 'apt/apt.conf.d/20listchanges'
 maybe chmod 0644 'apt/apt.conf.d/20packagekit'
+maybe chgrp 'ian' 'apt/apt.conf.d/50actually-clean'
+maybe chmod 0664 'apt/apt.conf.d/50actually-clean'
 maybe chmod 0644 'apt/apt.conf.d/50apt-file.conf'
 maybe chgrp 'ian' 'apt/apt.conf.d/55aptsquid'
 maybe chmod 0664 'apt/apt.conf.d/55aptsquid'
diff --git a/apt/apt.conf.d/50actually-clean b/apt/apt.conf.d/50actually-clean
new file mode 100644
index 0000000..8f59382
--- /dev/null
+++ b/apt/apt.conf.d/50actually-clean
@@ -0,0 +1 @@
+APT::Periodic::AutocleanInterval 7;


-- 
Ian Jackson <ijack...@chiark.greenend.org.uk>   These opinions are my own.  

Pronouns: they/he.  If I emailed you from @fyvzl.net or @evade.org.uk,
that is a private address which bypasses my fierce spamfilter.

Reply via email to