12

In Ubuntu 14.04, I installed grafana like below:

dpkg -i grafana_4.1.2-1486989747_amd64.deb

I am trying to uninstall it.

I tried:

sudo apt-get remove --auto-remove grafana
sudo apt-get purge --auto-remove grafana
sudo apt-get autoclean
sudo apt-get autoremove
locate grafana and manually remove files and folder

But still while reinstall it old templates is there.

While reinstall:

dpkg -i grafana_4.1.2-1486989747_amd64.deb 
Selecting previously unselected package grafana.
(Reading database ... 68772 files and directories currently installed.)
 .................
 ......................
rajagopalx
  • 3,012
  • 9
  • 41
  • 52

3 Answers3

15

Uninstall just grafana:

sudo apt-get remove grafana

Uninstall grafana and its dependencies:

sudo apt-get remove --auto-remove grafana

For More details refer: http://installion.co.uk/ubuntu/xenial/universe/g/grafana/uninstall/index.html

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Anand Prakash
  • 199
  • 1
  • 4
0

I had this same issue. You need to use the commands you referenced, 'locate grafana' and remove every instance returned. You can use the python script I wrote as pasted below. I can't guarantee that its the best way to write but it gets the job done. This completely removes grafana.

import os
import time
import subprocess

print('------------------------------------')
print('...Removing Grafana...\n\n')
os.system("sudo apt-get remove --auto-remove grafana -y && sudo apt-get purge --auto-remove grafana -y")
time.sleep(1)
print('------------------------------------')
print('...Cleaning Up...\n\n')
os.system("sudo apt-get autoclean && sudo apt-get autoremove")
time.sleep(1)
print('------------------------------------')
print('...Checking Left-Overs...\n\n')
os.system("sudo updatedb")
time.sleep(1)

cmd = "sudo locate grafana"
openCmd = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
fromCmd, stderr = openCmd.communicate()
cmds = fromCmd.split('\n')
print('------------------------------------')
print('...Removing Left-Overs...\n\n')

for cmd in cmds[:-1]:
    print('----------')
    print('Removing: '+str(cmd))
    os.system('sudo rm -r '+ str(cmd))

print('------------------------------------')
print('All Done!\n\n')
SterlingB
  • 69
  • 8
0

Error found in python program below:

Traceback (most recent call last):
  File line 21, in <module>
    cmds = fromCmd.split('\n')
TypeError: a bytes-like object is required, not 'str'

Solved with

cmds = fromCmd.decode().split('\n')

See Cannot split, a bytes-like object is required, not 'str'

OrigamiEye
  • 864
  • 1
  • 12
  • 31
raspgraph
  • 1
  • 1