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

Re: /.cache directory



On Fri, Sep 26, 2025 at 10:53:33 +0200, Jörg-Volker Peetz wrote:
> Avinash Sonawane wrote on 25/09/2025 17:59:
> > I'm using Debian GNU/Linux 13 (trixie) which I recently installed. I
> > noticed that there is a directory named ".cache" at root level. It
> > seems to be created at the time of installation. What is it? Who has
> > created it? Seems to be a bug in some package which has created it...
> > 
> > $ ls -la /
> > total 76
> > drwxr-xr-x  19 root root  4096 Sep 23 12:17 .
> > drwxr-xr-x  19 root root  4096 Sep 23 12:17 ..
> > lrwxrwxrwx   1 root root     7 Sep 15 06:58 bin -> usr/bin
> > drwxr-xr-x   4 root root  4096 Sep 23 12:18 boot
> > drwx------   2 root root  4096 Sep 15 07:08 .cache
> > drwxr-xr-x  20 root root  3620 Sep 25 20:30 dev
> > drwxr-xr-x 160 root root 12288 Sep 25 20:34 etc
> > ...
> 
> Hi,   probably, it was created by an installer script. By going through the
> log (files) of dpkg, it may be possible to narrow down the list of candidate
> packages using the creation time of /.cache.

Why do you assume it was done by an "installer script"?  Based on the
timestamps, it looks like it was about 10 minutes after the installation
created the /bin symlink, which is either short enough that it *could*
have happened at a late stage of the installation, or long enough that
it *could* have been done by Avinash shortly after the installation.

> Of course, no installation (postinst) script (which are stored in
> /var/log/dpkg/info/) should leave a /.cache directory.

Indeed.

Since nobody else is seeing one of these directories on their systems,
or at least nobody is *reporting* one, my guess is it was created by
something Avinash did, which was not a common or standard installation
step.  Unfortunately, we just don't have enough information at this
time to deduce what that might have been.  All we can offer are guesses.

So, here are some guesses:

 1) A (slightly) broken third-party package was installed.

 2) Avinash ran something with "sudo" which cleared the environment,
    including HOME, and this program wanted a ~/.cache directory, so
    it created /.cache.

 3) Avinash meant to type "mkdir ~/.cache" as root for some reason, but
    typoed it as "mkdir ~ /.cache".  (Or variants, including mkdir -p
    which would have suppressed any warnings about ~ already existing.)

 4) Avinash restored a backup, which for some reason included an empty
    /.cache directory.  (This seems unlikely due to the timestamps, but
    I can't 100% rule it out.  Some restoration tools might not preserve
    the backup's timestamps.)

 5) What Avinash reported to be "Debian GNU/Linux 13 (trixie)" might
    really have been something else, e.g. some derivative that
    self-identifies as Debian but has subtle changes.

I'm sure there are other possibilities, but my imagination is currently
running dry.


Reply to: