1

I am very new to Linux. I followed a seemingly long guide that explains how to establish a LAMP-based Drupal-dev environment via the Ubuntu terminal. This installation guide includes many commands, that also makes uses of symbolic links, mv's of files, etc, and I seem to did a few mistakes in the way.

Can I undo every action I did in the terminal in the last 24 hours somehow? It seems this is my last option before formatting the Virtual machine (an action I would be very glad not to take)...

I just want to start all over again with another guide...

  • i think you will have to figure it out every "reverse" command to the one you ran, and have the original version of each modified file. That said, if it was only a lamp installation, (knowing nothing about the tutorial ) my last attempt will be uninstalling everything lamp-related, apache, mysql, php and other packages installed by `apt-get install`. I also recommend you, after you have a clean vm installation, clone it, rename it to something like 'ubuntuServerBase', and keep it as base to clone into other tests/installations. – bistoco Dec 28 '15 at 00:50
  • There is a file names .bash_history in your home folder (it's hidden). It shows every command executed in bash since you started the session. It may be useful to revert your actions. – Eduardo Cola Dec 28 '15 at 01:00

1 Answers1

2

You can't directly undo a command. Unfortunately, Linux does not support this feature.

You can use the command history to list all the previous commands you used.

You have to find the reverse command for all of them (e.g. if you invoked a command sudo apt-get install you have to invoke a sudo apt-get purge).

Unfortunately, not all command have a simple reverse command (e.g. if you run a sudo apt-get upgrade you should find out all the updated packages and downgrade them).

My suggestion is to find out a way to clean the actual situation, for instance, you can try to delete all the packages that you installed. If you want to be sure that you're in a completely clean situation, you have to format the VM.