Can anyone explain why HaikuDepot waits until all the package dependencies are downloaded to then complain that a package is already installed and then halts the install? For example, tried to install aqemu. The prompt appears that other packages are necessary, fine. Click ‘apply changes’. Downloads commence. Then, after everything is downloaded, you might get a message like this:
Shouldn’t the package management already know that this package is installed and use it or update it or remove it?
This error indicates that the file is already in your packages folder, but it is not activated. There are some issues/edge cases where files end up in the folder without them properly being accounted for. Best way to solve it is to manually remove the package file from /boot/system/packages and use HaikuDepot to reinstall.
How do files end up not accounted for? Could it happen from a failed download? Is there a command to scan for packages that are broken or not accounted for? Does the package system need to be more proactive or fault tolerant?
The only cause I have seen is when users try to upgrade the system from an installation medium, which the Installer pretends may work, but in reality is broken. This will be fixed by Beta 3.
It should not, when doing downloads the package system uses transaction folders.
Not that I am aware of.
I think the focus is best on why unactivated packages end up in the folder in the first place. I would focus on fixing those root cause issues before adding any workarounds or tolerances.
You can list packages in /boot/system/packages folder and compare to the list in the activated packages file.
Haiku allows you drop to drop packages in /boot/system/packages to install them.
What happen is that HaikuDepot try to solve dependencies for the dropped package and then pop something up asking to cancel if there’s a conflict or to download dependencies if any and install the package (in fact, activate it).
And it will do that for each package dropped.
So better avoid to drop several packages in same time otherwise you end up with several HaikuDepot pop-ups asking to download the same thing.
So, if you have no access to internet and really need to do it, you will have to manage dependencies ahead and split packages in groups i.e you will drop libs before executables or other libs depending on them.
I don’t know about all this…I’ve looked into the /boot/system/packages directory, found 562 entries. Looked into the /boot/system/packages/administrative directory, found a file called ‘activated-packages’ with 523 entries. I haven’t tried to upgrade the system from any medium. I have had many download stalls which result in fails. So what I’m hearing is that I have to occasionally compare the two for errors, or attempt to install a program, pause while I check the packages directory for entries that are already there and delete them so that the install will complete.
Both should be in sync.
I don’t know how so many ended up non-activated. As nielx said, it shouldn’t happen from an interrupted download.
When you install a package and so also when you run SoftwareUpdater, HaikuDepot makes a transaction-* folder in administrative subdirectory. Only once every package successfully downloaded, HaikuDepot proceeds to the real installation. So normally there shouldn’t be half-downloaded packages in the packages directory. But in administrative subdirectory, there’s probably a few transaction-* folders with one or several packages, last of these packages being not complete and so broken.
To solve your issue, I would find all packages that are not activated comparing lists, move these elsewhere in a new folder. Then, I would clean old transactions folders as they may take a lot of place. At this point, things are back in a clean state and there shouldn’t be errors anymore.
After that, I would examine the packages I removed to see what I need and what I don’t. I would reinstall those I really want through HaikuDepot (Since these packages were in packages directory, they are probably complete and not broken so you could also click on them or drop them back but our goal is to get out of trouble…) then I would delete the folder.
Ok, then is there a log I can follow or a way to have verbose output during package management? I guess I’m looking for a transactional trail I can examine to find out what is happening.
When a package is installed and activated, it is mentioned in syslog file (/var/log/syslog), you may find it sufficient to check that.
Otherwise, you can use directly pkgman in a terminal. The options are install, remove, update and full-sync. update and full-sync can both be used to update your system, the difference is that full-sync will allow downgrading a package. (This is sometimes needed when projects are changing the way they’re naming versions or if a new version of a package is accidentally pushed. So, usually 3 times a year max)
You don’t have to keep them all. Usually keeping last three or five previous states is sufficient. So, if you need some space in your Haiku partition, you can delete a few without problems. But, states are steps to go back in time and you can’t make a cherry pick of what you want to keep. You have to keep them contiguous. For example, let’s say today is Wednesday. To go back to Friday, Haiku will go back to Tuesday then from there to Monday, from there will go to Friday. It won’t do Sunday or Saturday because it’s the week-end, you didn’t use Haiku and so no updates and no state.
Unfortunately, FilWip and tools like it tend to mask problems. Better look for the cause of the problem like Scott intend to. Once known, it can help to solve it permanently.
Although FilWip has an option to exclude files, last time I checked it wasn’t really helping.
It won’t help you to clean up non-activated packages that ended up already in packages directory either.
I envision a service or an extension of package management that deals with this. As it is now, nothing is preventing a program (like FilWip) or a user from deleting states saved under the package structure however they want. This can, as you have stated, render falling back to a previous state potentially useless. As it is now, these states will build up indefinitely unless managed. Something akin to a kernel manager but for states (keep last ‘n’ amount). Perhaps another tool to sniff out mismatches between packages and those listed in activated-packages. Just thinking out loud, I really enjoy using Haiku and want it to be the best it can be.
Though, it will take time before Haiku has multi-user support, that’s the kind of thing a superuser password would probably secure enough.
Devs are already thinking about limiting the number of states for R1 but it isn’t easy. There are a lot of cases to consider. I.e when you install a package that has no previous version the state folder only contains an activated-packages file. Not so useful. Repeated few times, it defeats keeping last 3 strategy.
I think that problems like yours are more frequent since SoftwareUpdater was changed to use full-sync option instead of update. It can be that we didn’t noticed them because the tree was hiding the forest. But, there’s certainly something to do also there.
For what it’s worth, I usually use the terminal for updating with pkgman full-sync. I use HaikuDepot for installing new software. I think the FilWip type of app is the most appropriate way to clean the system as long as there is fine grain control of which states to clean. It is an interesting mental exercise to think about how to best manage package management. The rollback feature is great and needs to be leveraged to its maximum potential. Perhaps the user could flag stable prior states or the system could flag crashiness of states. I’m an automotive tech, we use things like misfire counters, fault codes, all indicators of performance issues. I’m thinking that a diagnostic counter of sorts could flag states that have regressions or the opposite could exist, a counter of succesful operation could elevate a state as worth keeping. Well, enough rambling.
I think an option with pkgman full-sync to take a snapshot would be useful.
Then you could delete all previous statuses and only have one to go back.
pkgman full-sync -snapshot date or name
or when a new beta appears automatically with the name of the beta.
Then you could install the fullsync function in the software updater and the function to manage the snapshot or put function also in haikudepot.
I don’t understand what you want, this is exactly what the state directories are doing.
You can always keep only the latest one and go back to it. No problem with that. And pkgman creates them whenever you update, full-sync, add, or remove a package.
The SoftwareUpdater already uses the same code as pkgman full-sync and also does this.
The only remaining problems are:
We never clean up the states automatically. Deleting old states is not an hard thing to do, we could just add that (keep the 3 or 4 most recent ones or something)
What is not possible is deleting newer states while keeping older ones. This is because we need each intermediate state along the way and the system works in a “retracing your steps” way, it can’t jump to an arbitrary state but must go through all intermediate ones. If we want to do this, we need a way to merge states together. I’m not sure if this is needed, because usually you will only need only the most recent states. And I think it adds too much complexity.
Hi Pulkomandy, that’s exactly the point.
I can delete the files mamuell, which i will do too. The directory on the hard disk is now 7.5 GB in size and still contains beta1 data. Since the simple user cannot necessarily know that he can and may delete the data there, a cleanup function would be very helpful.
I would be very grateful if I could install this. I think a setting option via spincontrol from 1-5 would be cool. previous status up to the last 5th, as well as a transaction cleanup function would also be very nice.
The name of the app filwip is not exactly obvious to me. I only came across it by chance, so it would be nice if you could install it.