Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uninstall foreman [closed]

I have installed The Foreman on Ubuntu Server 12.04, following the instructions here:

http://theforeman.org/manuals/1.2/quickstart_guide.html#Installation

I have now decided that it is not for me - but I cannot find any instructions on how to uninstall. The various commands like gem uninstall foreman fail as it seems it was installed as gems.

Any help would be greatly appreciated. Thanks, Cristiano

like image 666
cbianchi Avatar asked Jan 12 '23 12:01

cbianchi


2 Answers

I'm sure you figured something else out by now but if anyone else is stuck on this, here are the commands that worked for me:

sudo apt-get --purge remove foreman foreman-installer foreman-proxy
sudo rm -rf /var/lib/foreman /usr/share/foreman /usr/share/foreman-proxy/logs
sudo rm /etc/apache2/conf.d/foreman.conf

You may also want to uninstall puppet if you were not using it prior to installing foreman:

sudo apt-get remove --purge puppet puppetmaster puppet-common puppetmaster-common puppetlabs-release
sudo rm -rf /usr/lib/ruby/vendor_ruby/puppet /usr/share/puppet /var/lib/puppet /etc/puppet
sudo rm /etc/apache2/conf.d/puppet.conf

You can also run the following to remove any other dependencies that were installed and are no longer required:

sudo apt-get autoremove

Finally, restart apache now that the foreman and puppet configs have been removed:

sudo service apache2 restart

I might be missing a few things but that seemed to get rid of most of it for me.

like image 182
Kyle Avatar answered Jan 22 '23 10:01

Kyle


first, you should get the list about the packages binding with foreman-installer. Run the following command to get the list:

sudo dpkg -l |grep foreman

in my environment(ubuntu 12.04 and foreman 1.4), it returned with info including 'foreman', 'foreman-installer', 'foreman-postgresql', 'foreman-proxy' and 'ruby-foreman-api'.

then we can use apt-get to remove the above packages out:

sudo apt-get remove --purge foreman
sudo apt-get remove --purge foreman-proxy
sudo apt-get remove --purge ruby-foreman-api

it should removed all foreman related packages after the above commands. You can run dpkg -l |grep foreman to ensure all foreman related packages had been removed.

finally, you can remove other no longer required packages by sudo apt-get autoremove.

some logs and conf folders from foreman will be still remain in your OS, you may have to clean them manually.

like image 27
dalang Avatar answered Jan 22 '23 11:01

dalang