rworkman / slackpkg

Slackware's slackpkg
35 stars 12 forks source link

The `removed_scripts` and `removed_packages` directories can use a lot of disk space #33

Open piterpunk opened 1 year ago

piterpunk commented 1 year ago

When a package is upgraded, its old installation scripts and list of files are kept under /var/lib/pkgtools. After a while, a long running system can have a lot of stale files under these directories. As you can see with the following output:

punk@number5:/usr/libexec/slackpkg$ du -skx /var/lib/pkgtools/removed_scripts/
58244   /var/log/removed_scripts/
punk@number5:/usr/libexec/slackpkg$ du -skx /var/lib/pkgtools/removed_packages/
382968  /var/log/removed_packages/

Slackpkg is the tool that is usually used to upgrades Slackware systems, so it seems to be the best place to implement some routine to do a janitorial job of these directories.

opty77 commented 1 year ago

On an more than 18 years old system:

opty@zeryk:~$ du -skx /var/lib/pkgtools/removed_scripts/ /var/lib/pkgtools/removed_packages/
24732   /var/lib/pkgtools/removed_scripts/
97800   /var/lib/pkgtools/removed_packages/

Please keep this disabled by default like now forever and add confirmation for sure.

Edit: Doubt about the second part here instead of PR so I'm better duplicating there.

piterpunk commented 1 year ago

Please keep this disabled by default like now forever and add confirmation for sure.

Edit: Doubt about the second part here instead of PR so I'm better duplicating there.

Answered at PR

opty77 commented 1 year ago

Five weeks ago I was also thinking about whether slackpkg should even do this as it (slackpkg) doesn't manage packages directly but using pkgtools.

On the other hand it might never see the production so whatever.