Rcayot
Posts: 24
Joined: Sun Jan 26, 2020 8:24 pm

uninstalling software and recovering memory

Sun Dec 06, 2020 6:01 pm

I recently installed some software after updating and upgrading my Pi 4b. After realizing that although the software worked, my DSLR was not completely supported as it would not remote acquire an image.

Anyway, the software folders do not contain an uninstall.sh file. Is there a more generice way tro uninstall this software as outlined here?

https://pimylifeup.com/raspberry-pi-dsl ... a-control/

Thanks for any help.

Roger

User avatar
rpdom
Posts: 18170
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: uninstalling software and recovering memory

Sun Dec 06, 2020 6:16 pm

No, there is no generic way to uninstall software that you have built and installed from source.

Ideally there would be a "make uninstall" option provided with the software, but I don't see once from a quick look over the code.

Perhaps raise an issue on that github repo as the maintainer is the person who is most likely to advise correctly.
Unreadable squiggle

rh73
Posts: 129
Joined: Mon Nov 09, 2020 7:38 am

Re: uninstalling software and recovering memory

Sun Dec 06, 2020 9:41 pm

The software OP installed is gphoto2, which seems to be possible to install per 'apt-get install xyz'. It's just that he followed instructions how to build it from source to get an updated version. I have no idea how apt-get works exactly to be honest, so forgive me if the following suggestion is dumb: assuming the list of installed files is similar, would it be possible to remove it with 'apt-get remove'? Or does apt-get keep track of the exact files it installed itself, and removing thus not possible? Would it be possible to extract a list of affected files with a kind of "dry run" of 'apt-get remove' (piped into a text file) just to check which files it would touch?

User avatar
rpdom
Posts: 18170
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: uninstalling software and recovering memory

Sun Dec 06, 2020 10:06 pm

rh73 wrote:
Sun Dec 06, 2020 9:41 pm
would it be possible to remove it with 'apt-get remove'? Or does apt-get keep track of the exact files it installed itself, and removing thus not possible?
apt keeps track of which packages are installed and what files they use (the package .deb file contains this info). If you install something outside of apt and then ask apt to remove it, it will just say that the package isn't installed.

Even if you tried to use apt to install the package and then remove it, it will complain about the files and probably leave many behind as they are in different locations.
Unreadable squiggle

User avatar
scruss
Posts: 3859
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: uninstalling software and recovering memory

Sun Dec 06, 2020 10:20 pm

You can likely reverse most of it with:

* comment out the line you added in step 7

* do step 8

* go back to the folder you ran sudo make install in step 6, and try sudo make uninstall
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

Rcayot
Posts: 24
Joined: Sun Jan 26, 2020 8:24 pm

Re: uninstalling software and recovering memory

Mon Dec 07, 2020 3:48 pm

Scruss,

Did as you suggested, uninstall ran through a bunch of items but all returned "nothing for uninstall to do" or similar.

Roger

User avatar
scruss
Posts: 3859
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: uninstalling software and recovering memory

Mon Dec 07, 2020 6:22 pm

Is there still a gphoto2 command you can enter on the command line? If not, then it did uninstall things.

Not every source package comes with a "make uninstall". I gave what typically works. To find out exactly what works, I'd have to run through the whole install process, and I'm not going that far.

If there's really no uninstall option (it would say something like "No rule to make "uninstall"), do

Code: Select all

make -n install
and go through the output, removing/uninstalling all the files that it installs. It's not always easy to follow, and you may break things. TBH, if there's still enough space, I'd just leave it. More work to remove than the value of the storage.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

Rcayot
Posts: 24
Joined: Sun Jan 26, 2020 8:24 pm

Re: uninstalling software and recovering memory

Mon Dec 07, 2020 7:47 pm

OK, I ran a gphoto2 command that used to work, and not it does not. I also ran the Add/Remove software from the Debian Desktop. I queried gphoto2, saw three packages come up, and removed them.

Didn't get back much if any room on SD card though.

Roger

User avatar
scruss
Posts: 3859
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: uninstalling software and recovering memory

Mon Dec 07, 2020 10:27 pm

No, you're not. They're not huge packages. Deleting the gphoto source tree might be the biggest return
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

Return to “Troubleshooting”