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

dpkg status history...how much is too much?



In the spirit of "Ignorance is the path to wisdom" please bear with me.

Discovering the ambiguities in certain file size accountings under
Unix/Linux (re: earlier post where du and ls gave vastly different
results for both /var/log/lastlog and /var/log/faillog) led me to
inspect /var more closely.

There seemed to be no ambiguity in the following:

# du -h /var/lib/dpkg
5.0M    /var/lib/dpkg/info
1.0k    /var/lib/dpkg/updates
56k     /var/lib/dpkg/alternatives
5.0k    /var/lib/dpkg/methods/disk/www
8.0k    /var/lib/dpkg/methods/disk
2.0k    /var/lib/dpkg/methods/floppy
1.0k    /var/lib/dpkg/methods/mnt
2.0k    /var/lib/dpkg/methods/multicd
2.0k    /var/lib/dpkg/methods/mountable
1.0k    /var/lib/dpkg/methods/ftp
17k     /var/lib/dpkg/methods
15M     /var/lib/dpkg

I am currently using apt-get and dpkg extensively to build and maintain
a workable Potato distro on a box with a smallish HDD (814 Mb). That 15M
in /var/lib/dpkg seemed chunky to me.

So I did du -k /var/lib/dpkg and got:

total 10762
drwxr-xr-x    6 root   root         1024 May 17 07:40 .
drwxr-xr-x   27 root   root         1024 May  7 17:51 ..
drwxr-xr-x    2 root   root         1024 May 15 22:12 alternatives
-rw-r--r--    1 root   root      3518844 May 17 03:04 available
-rw-r--r--    1 root   root      3518844 May 17 03:03 available-old
-rw-r--r--    1 root   root            8 May 17 02:47 cmethopt
-rw-r--r--    1 root   root         2128 May 17 03:02 diversions
-rw-r--r--    1 root   root         2020 May 17 03:02 diversions-old
drwxr-xr-x    2 root   root        65536 May 17 03:03 info
-rw-r-----    1 root   root            0 May 17 03:03 lock
-rw-rw----    1 root   root            0 May 17 02:47 methlock
drwxr-xr-x    8 root   root         1024 Apr  5 02:36 methods
-rw-r--r--    1 root   root         1129 Apr 13 06:19 predep-package
-rw-r--r--    1 root   root       870741 May 17 03:04 status
-rw-r--r--    1 root   root       870740 May 17 03:03 status-old
-rw-r--r--    1 root   root       870741 May 17 03:04 status.yesterday.0
-rw-r--r--    1 root   root       207236 May 15 23:59
status.yesterday.1.gz
-rw-r--r--    1 root   root       206679 May 14 01:42
status.yesterday.2.gz
-rw-r--r--    1 root   root       205638 May 13 20:57
status.yesterday.3.gz
-rw-r--r--    1 root   root       205079 May  7 17:53
status.yesterday.4.gz
-rw-r--r--    1 root   root       204288 May  7 01:03
status.yesterday.5.gz
-rw-r--r--    1 root   root       203151 May  5 13:18
status.yesterday.6.gz
drwxr-xr-x    2 root   root         1024 May 17 03:04 updates

Does dpkg need all that status history? And if not, must I monitor it
myself, or does dpkg have a self-cleansing method that is somehow not
being invoked here?

This may seem a small problem to some, but it grows in inverse
proportion to the size of ones hard disk.

I use 'apt-get clean' regularly to keep the overhead down, but I haven't
found, or knew that I'd found, anything similar in the dpkg manual page.

I hesitate to write a cron job to trim these status files on new
processes I'm still in the early stages of learning.

Thanks for whatever guidance you can give, and for your patience. 

montefin



Reply to: