Page 1 of 1

How to uninstall with a script? - Solved

Posted: Mon May 30, 2022 10:40 pm
by mow9902

Hi - I realize that one would normally uninstall a PET package by using the uninstall function in the PPM.

However, I have a particular situation where I would like to be able to uninstall via a script. Is this possible? ie I would like to create a script to:
1. install a PET
2. ....use the installed application
3. uninstall the PET
4. restart-x

The main reason for doing it this way is that the application in question (chinese input) changes my system fonts (which it needs to do). This is necessary while I am using the app, but once I have finished I would like to set the fonts back the way they would normally be.

If there is another way to do this I'm grateful to take suggestions.

I am using Fossapup64 with kernel 5.4.53.

Thanks

Replies were much appreciated - problem solved - thank you all.


Re: How to uninstall with a script?

Posted: Tue May 31, 2022 12:45 am
by amethyst

This is a good one. The real problem comes at uninstalling the pet because there are several scripts involved to achieve this. I do have 2 scripts that makes the process quicker . For installing my script basically tries to eliminate all ((or limit)) the pop-up screens. For uninstall the best I can come up with is a script that opens the Package Manager. If you only need to use an application temporarily during a session I would rather suggest converting that specific pet file to an sfs file. sfs files can be loaded and unloaded very quickly with a script(s)...but the problem here is that this will probably not work for you due to the fact that the sfs is loaded "underneath" the base sfs, so your new fonts will not have preference. A user published an application called sfs_load-above. The latter is an application to load the sfs "above" the base sfs which is what you want in this case. I would use it with care though but it could work for you.
I attach it here (remove the fake .gz extension). Personally, I would stick with installing and uninstalling the pet as this is the safer option in this scenario. I attach my 2 scripts here (don't know if it will work with Fossa, I don't have that Puppy). These are right-click scripts so you need to place it in the "Open With" menu.

PS - Okay, I've checked out the sfs_load-above utility. It works but seems an addition to the builtin sfs_load module. This is what I did - I extracted the 2 files from the sfs_load-above package, then renamed that sfs_load script to sfs_load-above and then copied the 2 files to /usr/sbin. Now you can run the sfs_load-above script whenever needed. To unload the sfs, you do not have to run the sfs_load-above script again but can use this command:

Code: Select all

sfs_load -u -c -q- LocationAndNameOfSfs

[/b]


Re: How to uninstall with a script?

Posted: Tue May 31, 2022 4:19 am
by MochiMoppel
mow9902 wrote: Mon May 30, 2022 10:40 pm

Hi - I realize that one would normally uninstall a PET package by using the uninstall function in the PPM.

However, I have a particular situation where I would like to be able to uninstall via a script. Is this possible? ie I would like to create a script to:
1. install a PET
2. ....use the installed application
3. uninstall the PET
4. restart-x

So you also want to install via script, not just uninstall? If the PET doesn't contain pinstall/puninstall scripts and doesn't overwrite existing files then installation (without using PPM) could be fairly simple. Basically all that is needed is extracting the files contained in the PET and - if required - updating the menu.

Later you could uninstall (=delete) the extracted files, provided you haven't deleted the PET file or a least keep a list of the extracted files.


Re: How to uninstall with a script?

Posted: Tue May 31, 2022 6:23 pm
by rerwin
mow9902 wrote: Mon May 30, 2022 10:40 pm

I would like to be able to uninstall via a script. Is this possible? ie I would like to create a script to:
1. install a PET
2. ....use the installed application
3. uninstall the PET
4. restart-x

Try this:
1. petget (petname)
2. ....use the installed application
3. petget -(petname)
4. restartwm


Re: How to uninstall with a script?

Posted: Wed Jun 01, 2022 7:12 am
by amethyst

petget -(petname)

Thanks!!! :thumbup:


Re: How to uninstall with a script?

Posted: Thu Jun 02, 2022 4:14 pm
by norgo

to remove packages you can use pkg

example to remove a package

Code: Select all

pkg u package

example to remove multiple packages at once

Code: Select all

pkg u package1 package2 package3

example to install a package

Code: Select all

pkg i package

to remove builtin packages use this command
example

Code: Select all

remove_builtin packagename