How do you uninstall processing from RPi4?

I have a issue where it appears Processing somehow got installed twice and I need to uninstall it and reinstall it. When I create a sketch that tries to import processing.io (so I can get acess to GPIO) I get an error message saying that there are duplicate libraries installed. It gives me a path to the additional library and I tried just deleting those files but it still complains. I’m rather new to linux and Pi bash commands and just not sure how to uninstall Processing. I tried the following, “sudo apt-get --purge remove processing” but it says it’s unable to locate processing. Not sure what else processing is named. And if there are 2 installations, not sure how I can tell the system to remove both versions. Appreciate any help. Thanks.

Depends how you installed it. Officially there is no support for processing on the RaspberryPi4, and future support will likely be for 64 bit. Currently I am successfully running Sam Pottingers development version of Processing4 on Manajaro ARM [64 bit] see here, and wiki entry. See original processing for pi here. If you tell me how you installed processing, I can give specific advice. The problem with duplicate libraries is most likely a processing thing, and how libraries get loaded (libraries are stored in ~/sketchbook/libraries) and nothing to do with a duplicate installation of processing. If the processing ide detects libraries requiring/providing duplicate jars/resources it throws a wobbly. This a case of convenience over usability.

I installed 3.5.3 using ‘curl https://processing.org/download/install-arm.sh | sudo sh’ (from this link https://pi.processing.org/download/) and I also was playing around with some other methods of installation earlier and I think that’s how I got the other version installed (somehow). Again, just learning my around the Linux environment. Other than this library issue (which I believe was caused by my problem), Processing appears to be working fine.

This is the bash script that installed processing for you

#!/bin/sh

# This script installs the latest version of Processing for ARM into /usr/local/lib
# Run it like this: "curl https://processing.org/download/install-arm.sh | sudo sh"

# check if on a 64-bit operating system
case "$(file $(which file))" in
  *aarch64*) FLAVOR="arm64"; TAR="$(curl -sL https://api.github.com/repos/processing/processing/releases | grep -oh -m 1 'https.*linux-arm64.tgz')" ;;
  *)       FLAVOR="armv6hf"; TAR="$(curl -sL https://api.github.com/repos/processing/processing/releases | grep -oh -m 1 'https.*linux-armv6hf.tgz')" ;;
esac

echo ""
echo "Downloading $TAR..."
curl -L $TAR > processing-linux-$FLAVOR-latest.tgz

echo "Installing in /usr/local..."
tar fx processing-linux-$FLAVOR-latest.tgz -C /usr/local/lib
rm -f processing-linux-$FLAVOR-latest.tgz

# this returns the highest version installed
VER="$(basename $(ls -dvr /usr/local/lib/processing-* | head -1))"

# symlink target might be a directory, replace
rm -rf /usr/local/lib/processing
ln -s $VER /usr/local/lib/processing

# this assumes that /usr/local/bin is in $PATH
ln -sf ../lib/processing/processing /usr/local/bin/processing
ln -sf ../lib/processing/processing-java /usr/local/bin/processing-java

# this assumes that the desktop manager picks up .desktop files in /usr/local/share/applications
mkdir -p /usr/local/share/applications
curl -sL https://raw.githubusercontent.com/processing/processing/master/build/linux/processing.desktop > /usr/local/share/applications/processing.desktop
sed -i "s/@version@/$VER/" /usr/local/share/applications/processing.desktop
sed -i 's|/opt/processing|/usr/local/lib/processing|' /usr/local/share/applications/processing.desktop

# silence validation errors
desktop-file-install /usr/local/share/applications/processing.desktop >/dev/null 2>&1

echo "Done! You can start Processing by running processing in the terminal, or through the applications menu (might require a restart)."
echo ""
~         

It tells you that you that you installed processing in /usr/local so if you open a terminal and type

which processing
# output should be /usr/local/bin
# and there should be symbolic link /usr/local/bin/processing

So in terminal type

ls -al /usr/local/bin/processing
# will tell you what the link points to

You can delete symbolic links with the rm command if you need to delete directories then use the -r flag eg rm -r ~/sketchbook will remove the sketchbook directory in your home folder (use this command with care it is dangerous, especially when you use pattern matching).

Thanks for the info. When I do ‘which processing’, I get ‘/usr/local/bin/processing’ only. Not quite sure I understand what a symbolic link is. Again, all I want to do is totally uninstall processing (both instances in my case). I did delete the second library before I posted this question, which the error message said was in home/pi/sketchbook/libraries/io. It said the first library was in the normal pi location (whatever that is).

I think my best path out at this point is to just uninstall everything so I’m at a fresh start and then I can reinstall Processing using the curl method and hopefully that will get me in a position to move forward. Again, except for this library problem, that seemed to work fine.

But back to my root question, how do I uninstall it?

You seem to be using the RaspbianPI OS distro (32bit) in which case the default home is /home/pi if you have created a different user eg tux then that users home is /home/tux. Anyway if you think you must do a clean uninstall would mean:-

rm -rf ~/.processing # removes config files
rm -rf ~/sketchbook # removes examples and any installed libraries
sudo rm -rf /usr/local/share/applications.desktop
ls /usr/share/lib/processing # check if present
sudo rm -rf /usr/share/lib/processing
ls -al /usr/share/processing # check if present, might be broken symbolic link
sudo rm /usr/share/processing
sudo rm /usr/local/bin/processing

There might be other links to remove eg /usr/local/bin/processing-java etc

Thanks. Isn’t there some type of ‘–purge remove’ command that will take care of removing all of these files and cleaning up all the associated links? Just seems like there should be something easier than having to manually locate each of these folders and remove these files and folders. And will this free up the path links? And remove the entries in the Programming GUI which now has 2 entries for Processing, one named Processing and another named Processing IDE. This is all leaving me with a bit of a sour taste for Linux at this point.

I didn’t do anything more than I already had but for some reason it’s now working. I can now successfully run the ‘import processing.io.*;’ statement in my sketch without the duplicate library error occurring and the GPIO bits are working . Really not sure why it is now working. I do still have the 2 entries in the Programming GUI dropdown for Processing. Any idea how I can get rid of the Processing IDE one (which is the one I originally installed)?

At this stage of your linux experience, and using a debian distro (such as RaspberryPI OS) you should stick to package install-able applications (ie packaged as ***.deb), and specifically those provided / available from the OS provider. But this is kind of restrictive and as far as I’m aware processing is not available as a debian package, so you are at the mercy of the install script provided. Debian do provide a convenient tool for managing symbolic links update-alternatives which allows you to manage symbolic links, pity that the processing install script does not use it.

It could be as simple as deleting the menu entry for the launcher.
Click on Raspberry to show menu hit preferences button, followed by Main Menu Editor click Applications/Programming edit/deletes as reqd.