Re: solution to / full
On Wed, Mar 01, 2023 at 03:15:07PM +0100, Jochen Spieker wrote:
The program dpigs from the package debian-goodies can help you find the
biggest debian packages you have installed. Of course you need to check
yourself whether you need them.
It's a shame that this requires installing debian-goodies (and
associated transitive dependencies), which can be a problem when the
root filesystem is full or nearly so.
A while ago I (privately) re-wrote dpigs in standard tools for this
reason (mostly for operating inside small containers). Once I got to
feature parity I was going to submit a wishlist bug to split it out from
debian-goodies, but the last feature was awkward to implement and I
never finished it.
Anyway, for OP's purpose, what I have is good enough. Presented in case
it's useful:
--✂--✂--✂--✂--✂--✂--✂--✂--✂--✂ --✂--✂--✂--✂--✂--✂--✂--✂--✂--✂--
STATUS_FILE=/var/lib/dpkg/status
dpigs()
{
TL=${1-10}
awk -v RS='' '/Status:.*installed\n/' "$STATUS_FILE" \
| grep -E '^(Installed-Size|Package)' \
| cut -d: -f2- \
| paste - - \
| sort -rnk2 \
| awk '{ print $2 "\t" $1 }' \
| head -n "$TL" \
| tac
}
dpigs "$@"
--✂--✂--✂--✂--✂--✂--✂--✂--✂--✂ --✂--✂--✂--✂--✂--✂--✂--✂--✂--✂--
--
Please do not CC me for listmail.
👱🏻 Jonathan Dowland
✎ jmtd@debian.org
🔗 https://jmtd.net
Reply to: