在Ubuntu 14.04,我安装了类似下面grafana:
dpkg -i grafana_4.1.2-1486989747_amd64.deb
我想卸载它。
我试过了:
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
不过还是同时重新安装旧模板是存在的。
虽然重新安装:
dpkg -i grafana_4.1.2-1486989747_amd64.deb
Selecting previously unselected package grafana.
(Reading database ... 68772 files and directories currently installed.)
.................
......................
卸载只是grafana:
sudo apt-get remove grafana
卸载grafana及其依赖关系:
sudo apt-get remove --auto-remove grafana
更多细节请参考:http://installion.co.uk/ubuntu/xenial/universe/g/grafana/uninstall/index.html
我有同样的问题。您需要使用您所引用的命令“下,找到grafana”并删除返回的每个实例。您可以使用Python脚本我写了下面粘贴。我不能保证它的最好的方式来写,但它能够完成任务。这完全删除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')