Now that I use Iceweasel, I want to uninstall the previous nightly firefox.
What is the proper way to do this?
[I have never uninstalled a software package under Haiku before,
and I don’t know the right procedure.]
Delete the package from /boot/system/packages
You’ll get a warning dialog. Just OK it.
You may need to reinstall Iceweasel just to get the dependencies all lined up. or just wait a few days for the next update.
Dependencies are the same so the only thing to do is to open HaikuDepot, to select the package and click Uninstall Nightly.
Or just double-click the package in /system/packages.
And just in case you weren’t confused enough yet, here is method number 4: Open a Terminal and type
pkgman uninstall nightly
and press ENTER
While we’re here … if one were to load up one of these monsters, and then wish to recover the disk space, is there a simple way to remove everything that came with it, i.e. dependencies needed for nothing else? If not, I suppose it would be possible to copy the list at the time of install.
Yeah, that’s how I do that. Open /system/packages
, sort after “Modified” and remove the main package of the app you want to uninstall plus all with the same date+time.
Hmm, you’d have to get in the habit of never installng more than one app at a time, and a pkgman update
would eventually mess up your system anyway.
We really need the equivalent of deborphan.
If you install only one app at a time, you should be able to create a list by making a diff on installed_packages.txt files before and after. So the one in main package directory and the one in the last state.
That would be automating what @Humdinger said. But it still doesn’t address the weaknesses I pointed out.
- You’re relying on social engineering, on people only installing one app at a time. That could work with HaikuDepot, but unless you rewrite pkgman to make
pkgman install app1 app2
an illegal instruction, it will fail sooner or later. - It would work fine if you just install an app to test, then delete it and any new dependencies immediately. But if app1 installs dependency-1, you leave it for a few days and an update brings you dependency-2, well it wouldn’t show up. Current Haiku users might be smart enough to figure it out, but the average user would just flood the forums with “What happened to the dependency in the diff?”
We don’t have a centralised dependency database AFAIK, and the Haiku packaging system doesn’t enforce one. You can specify your dependency as dependXX >= X.X.X-x
or you can just specify it as cmd:depend
. Both will run. So even extracting and parsing the .PackageInfo
information is not foolproof.
Having said all that, Haiku installations are tiny compared to other OS’s and this is probably not a big enough problem to warrant major surgery right now. Maybe when R1 is up and running and better minds than mine are thinking of revamping the packaging system for R2, this is something to be borne in mind.
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 !
As a proof of concept for a possible pkgman search -i --not-required
command, I had written a Python script that too prints a list of packages that are not dependencies of other packages.
You can find the code here.
(and in case you really want it integrated into pkgman, even if not perfect (but way faster)… here’s the branch where I implemented it on pkgman proper).
My “solution” (while sometimes handy) is far from the ideal. You can read discussions about it and the general issue in this ticket.
I finished up the version that uses the real dependency solver that I started a while back and committed it in hrev58434. So after that build comes around, you’ll be able to use pkgman search -i --not-required
and it will all “just work”.
I have 523 packages installed here, and running that pkgman
command takes … 0.07 seconds! So it’s pretty fast, I’d say
This would be a good candidate for backporting it to beta5?
EDIT: @BiPolar tried that python script, if I would uninstall all the it reports my system would be pretty clean (read basic install)
Seeing there are 1324 packages installed it’s not really surprising I guess
EDIT2: probably no real asset to backport it, listing it is one thing, an option to “uninstall not required” could be handy I guess, but then targeted to a specific case like: pkgman uninstall not required iceweasel
?
Yeah. This is just an interim solution, until pkgman gains an uninstall --orphaned
option (it needs to keep track which packages were user-requested for installation vs the ones installed just due to being dependencies).
Mmm, pkgman uninstall --dependencies iceweasel
sounds like something doable, and kinda handy. Both as in… “please uninstall iceweasel and its dependencies” in one go… but also if you had already uninstalled iceweasel, and later on you want to get rid of the left-overs.
I might give it a go, if @waddlesplash doesn’t implements it before I wake up
Would be nice, but it also has to detect if one or more of those dependencies are not used by other packages.
Right, that was what I had in mind. Perhaps the option should be called --unused-deps
, to better communicate the intention.
Hi Augustin. The 2nd run is very fast, the first run took a second or two.
On my system (laptop hrev58436, from 2021), running the quoted command, I get a list of all packages that have been installed with the Status S. Is it safe to assume that I do not have any “not-required” packages? Since nothing got flagged as not required, I’m assuming that I actually dont have any orphan leaf packages. Will try on main box as well (Haiku from 2020) and also on old MacBookPro laptop (Haiku from 2017). They might have more orphaned packages.
On my older laptop and desktop installs, I dont see any orphan packages, every package has the status S. There are either no unused packages, or I’m not following directions properly
I can notice that an older system accumulates cruft of ancient libs mixed with newer libs. Eg, on the laptop from 2018, I have 3 versions of libvpx (1.11, 3_bin, 6). With llvpm, I have 4 packages (unnumbered, 7, 8 and 17).
Status S just means the package is installed and up to date. Since the command includes -i (show only installed packages), it makes sense that all the shown packages have this status.
The new command line switch should filter out all packages that are depended on by something else. But you will still get all applications listed (since nothing usually depend on them). If you see something in the list that you don’t personally need, it should be fine to uninstall it without breaking anything.