How uninstall nightly firefox

I have made a script to find unused packages.
It is clearly bad programmed, and you can use it with caution !
It is quite long because it read all dependencies of all packages.
With about 200 packages it takes 90 seconds to list orphaned packages. It removes nothing only display.

#! /bin/sh
cd /var/shared_memory
rm Provides.txt 2>/dev/null
rm Requires.txt 2>/dev/null
touch Provides.txt
touch Requires.txt
for i in $(ls /boot/system/packages/*.hpkg) ; do package list $i | tr ‘[A-Z]’ ‘[a-z]’ > tmp.txt ; cat tmp.txt | awk ‘/provides:/ { gsub(“lib:”,“”); gsub(“cmd:”,“”); toto = toto " "$2 ; } END {print toto;}’ >> Provides.txt ; cat tmp.txt | awk ‘/requires:/ { gsub(“lib:”,“”); gsub(“cmd:”,“”); gsub(“=”," “); gsub(”<“,” “); gsub(”>“,” "); toto = toto “\n”$2 ; } END {print toto;}’ >> Requires.txt ; done
rm tmp.txt
for i in $( cat Requires.txt |sort |uniq ) ; do grep -v $i Provides.txt > Provides2.txt; mv Provides2.txt Provides.txt ; done
cat Provides.txt | awk ‘{print $1;}’
rm Provides.txt
rm Requires.txt

Be careful ! :wink: