0

I am new to Linux and Ubuntu, a few months ago I installed ubunutu WSL for Windows 10 and OpenFOAM 7, to learn for University. I've left it for a while but want to take a look at it again. I believe when I installed the application, I was running as root, which I now understand is a bad place to install the files. I would like to know how I can remove and uninstall everything associated with OpenFoam 7, and restore everything to how it was before, if that is possible.

I plan to restart studying OpenFOAM, but will make sure I am more comfortable with Linux programming first.

The instructions I followed are found here: https://openfoam.org/download/windows-10/

Any help would be muchly appreciated

Thanks

Josh

  • Thanks for your reply! I have now added the instructions I followed – aslkh435 Jun 03 '20 at 14:26
  • I don't understand the problem. deb packages must be installed by root anyway. Locations and permissions are set by the package, regardless of which admin user gave the install command. If you are saying that something installed to the wrong place or with the wrong permission, please provide an example. – user535733 Jun 03 '20 at 14:50
  • When I type in the command line my username is root@.... I don't know how to change it from this to my own username, and if the files should be in a directory in my own username. I understand these probably seem like silly questions, I am just not familiar with Linux at all, and I know I will have to learn more about Linux before I can start using OpenFOAM – aslkh435 Jun 03 '20 at 15:02
  • See https://superuser.com/questions/1266881/how-to-change-the-default-user-name-in-wsl – user535733 Jun 03 '20 at 15:09

1 Answers1

1

The OpenFOAM 7 documentation says to install this way. If this is what you did...

sudo sh -c "wget -O - http://dl.openfoam.org/gpg.key | apt-key add -"
sudo add-apt-repository http://dl.openfoam.org/ubuntu
sudo apt-get update
sudo apt-get install openfoam7

...then this is how you uninstall:

sudo apt remove openfoam7 
sudo apt autoremove

Since you intend to return to OpenFOAM, this leaves the PPA in place, and uses 'remove' instead of 'purge' to preserve settings in /etc.

(OPTIONAL) If you want to remove the PPA entirely:

sudo add-apt-repository --remove http://dl.openfoam.org/ubuntu
sudo apt update         // Always run update after changing your sources
user535733
  • 62,253
  • Thankyou very much for your reply! I will try this. I wanted to check, will this remove everything associated with OpenFOAM? I have also downloaded the xming installer as well as some tutorials. I am only asking this as when I have tried to look at the different directories, the only one I see is OpenFoam, so I just find it difficult to see which files are there. – aslkh435 Jun 03 '20 at 14:55
  • Happily, folks have asked and answered these common new-user questions before. See https://unix.stackexchange.com/questions/118880/should-i-use-apt-get-remove-or-apt-get-purge and https://askubuntu.com/questions/32507/how-do-i-get-a-list-of-installed-files-from-a-package – user535733 Jun 03 '20 at 15:06
  • I believe I have managed to completely remove OpenFOAM off of my Laptop, thankyou very much for your help, I appreciate you taking your time to help me! Hopefully if I do decide to try it again, I will have a much clearer idea of what I am doing. Cheers again – aslkh435 Jun 03 '20 at 15:53