orion
orion

Reputation: 534

How to cleanly uninstall ansible

Running debian jessie

I installed Ansible using the following procedure:

apt-get update
sudo apt-get install python-yaml python-pip python-jinja2 python-paramiko pip
git clone https://github.com/ansible/ansible.git
cd ansible
git submodule update --init --recursive
sudo make install 

Is there a way to cleanly uninstall Ansible that does not involve sifting through my directory tree and deleting?

The aim is to reinstall Ansible version 1.9 instead of the latest 2.1.0

Upvotes: 6

Views: 69196

Answers (6)

Ravikiran Thota
Ravikiran Thota

Reputation: 1

After removing ansible using dnf remove ansible uninstall python and reinstall ansible it will show the newer version.

Upvotes: -1

user11724121
user11724121

Reputation:

As I see you cloned ansible from git. Try to remove ansible folder, but first, go to cloned folder and write

make uninstall

then

cd ..
rm -r ansible_folder

and dependent folders, files for example '/etc/ansible' folder.

Upvotes: 1

Ripunjay Godhani
Ripunjay Godhani

Reputation: 244

if you have installed on redhat centos based systems you can do below to uninstall ansible cleanly and similar command for ubuntu debian based systems

rpm -qa | grep ansible | xargs rpm -e

rpm -qa | grep -i epel | xargs rpm -e

else yum remove ansible

Upvotes: 2

hamx0r
hamx0r

Reputation: 4278

I had built ansible 2.1.1 from source then wanted to downgrade to 2.1.0 using yum. The trick i learned was to go to /lib/python2.7/site-packages and deleting the ansible-2.1.1.0-py2.7.egg-info directory. In my case, using yum properly added files to /etc/ansible and /usr/bin, but as long as the old (newer version number) egg was there, then ansible --version continued to show the newer version number.

Upvotes: 0

shaps
shaps

Reputation: 1179

There is a directory list in the source code repo telling you which directories ( and files ) are created. This is used to build the .deb package, but you can easily use it the other way around:

packaging/debian/ansible.dirs

Upvotes: 2

tink
tink

Reputation: 15205

Your best bet is to install checkinstall, run the install again under checkinstalls control, and then use dpkg to remove things.

https://wiki.debian.org/CheckInstall

Upvotes: 2

Related Questions