Package installers and old packages not removed after updates on Debian 6.x


I’ve found that on Debian based DirectAdmin installs, the old version(s) of the installed software are not removed, nor are the package archives. This was apparently a design decision, according to:

This became a problem recently, when MySQL was updated, while the partitions were configured to have a separate (logical) volume mounted on /usr. This is not uncommon with Debian, so I imagine this might be an issue with other users too.

In this case, the /usr partition was sized at 5 GiB, and this space was almost completely filled, thus generating nrpe warnings. This is caused by the fact that MySQL updates are downloaded as a .tar.gz archive, which is then extracted.

The new version is pointed to by a symlink to the newest installed version, but the old version(s) and the .tar.gz archives are not removed. This leads to a growing disk-usage.

What I would like to know if it would be possible to include a cleanup option to the relevant scripts, so that after a succesfull mysql update, the old version(s) and archives are removed.

If anyone has any insight into this, I would gladly like to know.

Yours sincerely,