Good evening out there,
I posted this is the vanilla forum some time ago but didn't get any response (maybe the idea was too bad but then again somebody would have at least laughed at me or said nasty things about my stupidity...), that's why I start a second turn here:
When I tried to scale down my Slitaz in order to have a real sneaky small version of a frugal-type installation (I use a ~40MB initrd.gz to do a 15 sec boot from HD, unzip the newest downloadable firefox while logging in and use squashfs to include the bigger-type of applications I need, e.g. OpenOffice or java) I found it hard to uninstall packages I thought of not needing.
After several times of breaking XOrg, producing kernel panics or similar, I tried to figure out an old Debian buddy by myself: deborphan-like. Since Slitaz is wonderfully built on quite some impressing shellscript, I was able to at least code some lines that do the basic trick for me (saved as tazorphan in my /sbin directory):
#----------------------------------------------
#! /bin/ash
# necessary for 'tazpkg rdepends' command
tazpkg list > /var/lib/tazpkg/packages.txt
# list of installed packages for testing each one
ls /var/lib/tazpkg/installed > /tmp/installed.txt
# name of the first package in the list (to start with)
AKT=$(head -n 1 /tmp/installed.txt)
# name of the last package in the list
LAST=$(tail -n 1 /tmp/installed.txt)
# Init the line to read out of package list
Zeile=1
# loop through the package list till last package
until [ "$AKT" = "$LAST" ]
do
# increment line = package name to read
Zeile=$((Zeile+1))
# add a 'p' to the line (e.g. 15p) as sed parameter
Parameter="${Zeile}p"
# read the name of the actual package to test
AKT=$(sed -ne $Parameter /tmp/installed.txt)
# use tazpkg rdepends to test whether there are any dependencies
DEPs=$(tazpkg rdepends $AKT)
# if none are reported back
if [ "$DEPs" = '' ]
then
# echo the name of the package
echo $AKT
fi
# and continue the loop
done
# remove the package list out of /tmp
rm /tmp/installed.txt
#---------------------------------------------------
So at least als packages that no other package depends upon is printed out. By that it's easier to find the last bits of flesh that can be drawn from the bones.
I have an additional suggestion concerning package management anyway:
By adding an extra "flag" in the installed-packages list e.g. like this:
linux s (system-essential)
epdfview c (chosen)
poppler d (dependency)
it would - after deliberate removal of a formerly chosen package - be easy to automatically remove packages that have been installed for dependency reasons recursively (the dependency would be orphaned since no package depends on it anymore and since it was not chosen but installed as "d" could be removed.)
For the time being this would not be a very fast (due to recursive action) but reliable option to have a slim an trimmed system.
Looking forward to some reactions..... ;-)