Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uninstall, doesn't really uninstall. #2136

Open
3 tasks done
deathmarine opened this issue Apr 20, 2018 · 19 comments
Open
3 tasks done

Uninstall, doesn't really uninstall. #2136

deathmarine opened this issue Apr 20, 2018 · 19 comments
Labels
Bug: Confirmed Verified as a bug to be resolved Investigating Open issue or bug, under investigation triage: Issue User Filled out Issue Template

Comments

@deathmarine
Copy link

In raising this issue, I confirm the following: {please fill the checkboxes, e.g: [X]}

How familiar are you with the the source code relevant to this issue?:
10 it is a script...
https://github.com/pi-hole/pi-hole/blob/master/automated%20install/uninstall.sh


Expected behaviour:
Uninstall pihole (cleanly) I care about my dependencies. I run seafile and zoneminder on this pi, besides that's what the apt is for.

Actual behaviour:

pi@raspberrypi:/$ pihole uninstall
[sudo] password for pi:
  [?] Are you sure you would like to remove Pi-hole? [y/N] y
  [✓] Root user check
  [i] Be sure to confirm if any dependencies should not be removed
  [i] The following dependencies may have been added by the Pi-hole install:
    apt-utils dialog debconf dhcpcd5 git iproute2 whiptail bc cron curl dnsmasq dnsutils iputils-ping lsof netcat sudo unzmmon php-cgi php-sqlite3
  [?] Do you wish to go through each dependency for removal? (Choosing No will leave all dependencies installed) [Y/n] n
  [✓] Removed Web Interface
  [✓] Removed /etc/cron.d/pihole
pi@raspberrypi:/$

Check for user account

pi@raspberrypi:/$ cut -d: -f1 /etc/passwd | grep pihole
pihole
pi@raspberrypi:/$ sudo userdel pihole
userdel: user pihole is currently used by process 15684

FTL still running, SIGKILL sent

pi@raspberrypi:/$ pihole uninstall
  [?] Are you sure you would like to remove Pi-hole? [y/N] y
  [✓] Root user check
  [i] Be sure to confirm if any dependencies should not be removed
  [i] The following dependencies may have been added by the Pi-hole install:
    apt-utils dialog debconf dhcpcd5 git iproute2 whiptail bc cron curl dnsmasq dnsutils iputils-ping lsof netcat sudo unzmmon php-cgi php-sqlite3
  [?] Do you wish to go through each dependency for removal? (Choosing No will leave all dependencies installed) [Y/n] n
  [✓] Removed Web Interface
pi@raspberrypi:/$ cd /etc
pi@raspberrypi:/etc$ ls -la | grep pihole
drwxr-xr-x   2  999    999   4096 Apr 20 10:03 pihole
drwxr-xr-x   9 root root     4096 Apr 20 09:22 .pihole

At this point I'm manually removing all the remaining artifacts.
After removing the services, init.d and /usr/bin

pi@raspberrypi:/$ sudo find -name "*pihole*"
./etc/bash_completion.d/pihole
./etc/rc4.d/S02pihole-FTL
./etc/rc3.d/S02pihole-FTL
./etc/dnsmasq.d/01-pihole.conf
./etc/rc5.d/S02pihole-FTL
./etc/init.d/pihole-FTL
./etc/rc1.d/K01pihole-FTL
./etc/rc2.d/S02pihole-FTL
./etc/rc0.d/K01pihole-FTL
./etc/rc6.d/K01pihole-FTL
./etc/sudoers.d/pihole
./local/bin/pihole
./opt/pihole
./opt/pihole/piholeLogFlush.sh
./opt/pihole/piholeDebug.sh
./opt/pihole/piholeCheckout.sh
./var/cache/lighttpd/compress/pihole
./var/log/pihole
./var/log/pihole.log.2.gz
./var/log/pihole.log.5.gz
./var/log/pihole.log.4.gz
./var/log/pihole-FTL.log.3.gz
./var/log/pihole.log.1
./var/log/pihole.log
./var/log/pihole.log.3.gz
./var/log/pihole-FTL.log.1
./var/log/pihole-FTL.log
./var/log/pihole-FTL.log.2.gz
./sys/fs/cgroup/devices/system.slice/pihole-FTL.service
./sys/fs/cgroup/systemd/system.slice/pihole-FTL.service
./run/pihole
./run/pihole-FTL.port
./run/pihole-FTL.pid
find: ‘./run/user/1000/gvfs’: Permission denied
./run/systemd/generator.late/pihole-FTL.service
./run/systemd/generator.late/graphical.target.wants/pihole-FTL.service
./run/systemd/generator.late/multi-user.target.wants/pihole-FTL.service

Steps to reproduce:

update / bash curl
uninstall

Debug token provided by uploading pihole -d log:

I'll pass...

Troubleshooting undertaken, and/or other relevant information:

A friend of mine had an issue and lost sudo privileged on his pihole after running the update. We noticed the only user with sudo privledges was pihole. Tried uninstalling and it failes instantly. Went through his journal and didn't see any weird logins. Assuming his pi was compromised, for whatever reason, I checked mine. I updated just fine and decide to uninstall it and the user account, leading to a ton of artifacts. I went through the script and manually removed each of the remaining locations. It looks like the script is just bouncing out if it can't kill the service.
I would prefer to not reinstall at this time. I may install on another pi however I'll update if any definitive information is found.

Nice template btw.

@dschaper dschaper added triage: Issue User Filled out Issue Template Investigating Open issue or bug, under investigation labels Apr 20, 2018
@dschaper
Copy link
Member

Thanks, the uninstaller needs a lot of work, the apt based packages are easy to remove as you know, but the custom scripting does need a lot more work and we need to make sure we get the sudoers.d remnants along with the sysv init scripts completely cleared.

@AzureMarker AzureMarker added the Bug: Confirmed Verified as a bug to be resolved label Apr 27, 2018
@luckyhandler
Copy link

Could you provide information in the meantime how to uninstall manually?

@c0n4w0w
Copy link

c0n4w0w commented Dec 25, 2018

Yes please, I'm currently experiencing the same issue.

@matdombrock
Copy link

This is currently affecting my system as well. I would love some manual uninstall instructions!

@ghost
Copy link

ghost commented Jan 13, 2019

same here

root@raspberrypi:/# sudo find -name "*pihole*"
./var/log/pihole-FTL.log
./var/log/pihole.log.3.gz
./var/log/pihole-FTL.log.2.gz
./var/log/pihole-FTL.log.1
./var/log/pihole-FTL.log.3.gz
./var/log/pihole.log.5.gz
./var/log/pihole_updateGravity.log
./var/log/pihole.log
./var/log/pihole.log.4.gz
./var/log/pihole.log.1
./var/log/pihole
./var/log/pihole.log.2.gz
./etc/rc4.d/S01pihole-FTL
./etc/rc2.d/S01pihole-FTL
./etc/rc3.d/S01pihole-FTL
./etc/init.d/pihole-FTL
./etc/rc6.d/K01pihole-FTL
./etc/.pihole
./etc/.pihole/manpages/pihole-FTL.conf.5
./etc/.pihole/manpages/pihole.8
./etc/.pihole/manpages/pihole-FTL.8
./etc/.pihole/advanced/Scripts/piholeLogFlush.sh
./etc/.pihole/advanced/Scripts/piholeCheckout.sh
./etc/.pihole/advanced/Scripts/piholeDebug.sh
./etc/.pihole/advanced/01-pihole.conf
./etc/.pihole/advanced/Templates/pihole.sudo
./etc/.pihole/advanced/Templates/pihole.cron
./etc/.pihole/advanced/Templates/pihole-FTL.service
./etc/.pihole/advanced/bash-completion/pihole
./etc/.pihole/pihole
./etc/rc0.d/K01pihole-FTL
./etc/pihole
./etc/pihole/pihole-FTL.db
./etc/pihole/pihole-FTL.conf
./etc/rc5.d/S01pihole-FTL
./etc/bash_completion.d/pihole
./etc/rc1.d/K01pihole-FTL
./opt/pihole
./opt/pihole/piholeLogFlush.sh
./opt/pihole/piholeCheckout.sh
./opt/pihole/piholeDebug.sh
./run/pihole
./run/pihole-FTL.port
./run/pihole-FTL.pid
./run/resolvconf/interface/lo.piholeFTL
./run/systemd/generator.late/pihole-FTL.service
./run/systemd/generator.late/graphical.target.wants/pihole-FTL.service
./run/systemd/generator.late/multi-user.target.wants/pihole-FTL.service
./sys/fs/cgroup/devices/system.slice/pihole-FTL.service
./sys/fs/cgroup/systemd/system.slice/pihole-FTL.service
./usr/local/bin/pihole
./usr/local/share/man/man8/pihole.8
./usr/local/share/man/man8/pihole-FTL.8
./usr/local/share/man/man5/pihole-FTL.conf.5
./usr/bin/pihole-FTL

@AzureMarker
Copy link
Contributor

The main directories to remove are:

/etc/.pihole
/etc/pihole
/opt/pihole
/var/www/html/admin

But the uninstall script is the source of truth in what should get uninstalled:
https://github.com/pi-hole/pi-hole/blob/master/automated%20install/uninstall.sh

@kellygold
Copy link

This is still an issue 👎

@dschaper
Copy link
Member

We welcome any Pull Requests to help resolve open issues.

@kaysond
Copy link

kaysond commented Mar 5, 2019

Any idea why it fails? I experienced this as well, and dug through the script a little. It seems like it should work, but like others mine just stops in the middle.

@fritterhoff
Copy link

I had the same problem. In my case it was caused by the block checking for lighttpd. I did not install it. Maybe that causes the problem. I removed the code block and the uninstaller ran through.

@fritterhoff
Copy link

fritterhoff commented Mar 10, 2019

I've "debugged" the installation process a bit. The problem seems to be the function
package_check

package_check() {
dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed"
}

Due to including the script file basic-install.sh here:

source "${PI_HOLE_FILES_DIR}/automated install/basic-install.sh"

which has an set -e

the uninstallation process terminates here. I would suggest using set +e and set -e inside the package_check method as a workaround.

package_check() { 
     set +e
     dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed" 
     set -e 
} 

@rsnitsch
Copy link

I had the same problem. In my case it was caused by the block checking for lighttpd. I did not install it. Maybe that causes the problem. I removed the code block and the uninstaller ran through.

I can confirm this. I had the same issue.

Note: The first time the message "The following dependencies may have been added by the Pi-hole install: (...) Do you wish to go through each dependency for removal?" appeared, I cancelled the uninstaller and removed some of the packages on my own. I wanted to make sure that these packages are removed, even when I select "No". (It says: "Choosing No will leave all dependencies installed")

This probably caused the issue in my case.

@kaysond
Copy link

kaysond commented Mar 14, 2019

@flori-uni
Any idea why that command fails? As long as the package exists, even if its not installed, it should terminate with exit 0. I think.

@DeviousPenguin
Copy link

It seems less files are left over now.

I only have

/var/cache/lighttpd/compress/pihole
find: ‘/proc/919/task/919/net’: Invalid argument
find: ‘/proc/919/net’: Invalid argument
find: ‘/run/user/1000/gvfs’: Permission denied
/etc/rc5.d/S01pihole-FTL
/etc/rc3.d/S01pihole-FTL
/etc/rc6.d/K01pihole-FTL
/etc/rc0.d/K01pihole-FTL
/etc/rc4.d/S01pihole-FTL
/etc/rc2.d/S01pihole-FTL
/etc/rc1.d/K01pihole-FTL

I'm guessing it's safe to just delete these files?

@AzureMarker
Copy link
Contributor

Yes, none of those files are created by us directly.

@DeviousPenguin
Copy link

Thanks, I've removed them now. :)

@pralor-bot
Copy link

This issue has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/why-do-speed-tests-no-longer-work/34795/13

@groeneveld
Copy link

I just installed and uninstalled pihole. During installation it added the dnstools package but dnstools isn't listed after "The following dependencies may have been added by the Pi-hole install:" during uninstall.

@dschaper
Copy link
Member

Thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Confirmed Verified as a bug to be resolved Investigating Open issue or bug, under investigation triage: Issue User Filled out Issue Template
Projects
None yet
Development

No branches or pull requests