I use this script
bash <(curl -s https://pterodactyl-installer.se)
from this website https://www.ghostcap.com/install-pterodactyl-panel/ and I want to just uninstall the entire script and every file it downloaded.
I use this script
bash <(curl -s https://pterodactyl-installer.se)
from this website https://www.ghostcap.com/install-pterodactyl-panel/ and I want to just uninstall the entire script and every file it downloaded.
The instructions on the script tell you to start with an operating system that is freshly installed, so if you want to go back to the point before you ran this script, you should reinstall the operating system.
As others have mentioned in comments, you can't uninstall a bash script. A bash script is simply a list of instructions and commands that run in your terminal.
If this were a simple script that only performed one or two actions, you could break it down and possibly undo these actions.
But in this case, this script executed dozens (hundreds?) of operations.
As a side note, I feel the publisher of this script did you a huge disservice by claiming that this script is "secure" and "great for people who are new to Linux". I couldn't disagree more. Running scripts or commands without knowing what they do is horribly careless. Blindly executing code opens you up to possibly malicious actions. Also, if you don't even know what the script does, you have no idea what you just did to your computer-- which is the exact situation you find yourself in right now. Nobody should ever blindly run a script without being able to read and understand exactly what the script does-- this applies to veteran Linux users just as much as it applies to people who are using Linux for the first time.
While I broadly agree with Nmath's answer, reading every single line of every single script or digging deep into every single package you apt install
(don't forget the transitive deps!) isn't practical for most of us.
What you do need to do is understand what happens (or can happen) when you run a script or a program that modifies your system like apt
:
Anything can happen. If you run it without sudo privs there are certain things it can't do, but it can still do a lot and if you run it with sudo
all bets are off.
Files can be permanently deleted. Code from the internet can be downloaded and executed. Directories can be created, configuration files edited. You will likely never be able to reverse an action like that.
So don't try to.
Use virtual machines, clone from known good states before running potentially destructive commands, and be ready to rollback. If you are doing this on a bare-metal server, be prepared to reinstall from scratch.
Note as I said in a comment on the other answer this is not fundamentally different from proprietary OSes: all of the same caveats apply and it's much harder (by design) to just re-install the OS over and over. At least Linux gives you options.
There's also a sliding scale of trust: popular apt packages are installed all day every day by people all over the world and problems are usually quickly discovered. A shell script somebody has on their homepage? Not so much, you may want to check that one a lil more carefully.
apt install
to install packages from the official Ubuntu repositories, and downloading and running a script from some site. First, apt install
can be easily reverted by apt remove
. The same can't be said for any script. Second, packages installed from the official repositories go through some sort of review and the package integrity is verified by the PGP key. There is no such process for a script.
– user68186
Apr 26 '22 at 16:39
apt install
might not be easily undone by apt remove
. Once you start trusting untrustworthy sources then your system is compromised.
– doneal24
Apr 26 '22 at 23:02
It appears that the github that the installer pulled install files from comes with an uninstaller. It appears that the uninstall script doesn't do everything yet (it will possibly still leave some things behind), but the plan seems to be that it will be fixed soon.
You can keep an eye out for updates to the uninstall.sh
script, and run it when it's ready.
Be aware that the uninstall script may break something else, especially if you have made other changes since installing the software originally. Just like the original script, it is code you may not understand, and you should be cautious when running it. It is a risk you have to decide if you are willing to take.
In general, you should not run software or scripts that you don't understand or trust, especially if you don't know how to uninstall it. Installing all the pieces yourself and keeping notes of what you did and how to undo it, being sure to understand each step, is of course ideal, but if you can't do that then at least be sure the software is one that you trust and can uninstall. Absent that, install it on a system that can easily be restored from a backup or reinstalled in case something goes wrong.
If the script follows the official installation guide from the pterodactyl.io website then you could follow the steps to uninstall on pterodox.
https://pterodox.com/guides/uninstall-pterodactyl.html#uninstall-panel
You could always scroll through the script with the 'vim' or 'less' command and compare it to official installation guide.
If you end up using the pterodox guide remember to perform the "optional" mysql part, dropping each user but root from mysql. If the script did not let you make a password or display a generated password for you to remember for mysql/mariadb. Then you might have to completely uninstall those in the same fashion the pterodox guide said to uninstall other dependencies ie. "apt purge"