Please help me, removed iproute2 now can't access Pi

Hi, I installed pihole and then removed it from the pi, however, when removing it, it suggested to remove some associated services, one of which, the iproute2. I pressed OK to remove it assuming it was just a pihole dependency (pardon my ignorance).

Turns out, I lost access to the pi completely (SSH), it’s a headless setup. I don’t have any attached monitor or whatsoever, I think I even have the HDMI output turned off in the settings of the pi.

I have physical access to the disk, what can I do? There should be a warning when removing the pihole regarding this for those that aren’t aware of the consequences. :frowning_face:

Thank you!

Don’t warry you are not the only one who tapped into this trap. Unfortunately, a downside of the official PiHole installer. We tried to convince PiHole guys to change this behavior but no luck so far. Uninstaller package manangement is sub-optimal. · Issue #3929 · pi-hole/pi-hole · GitHub

Do you remember what system you are running exactly? We could try to get monitor access back first and afterwards install missing packages manually.

I’m using the diet-pi. I already have access to the disk partition by setting up a SD card with another raspberry version (official) and mounted the HDD with the dietpi on there.

Now, I’m trying to find a way to get it back by installing the the iproute2 on the external (with dietpi) drive. Tried wget this one: http://ftp.debian.org/debian/pool/main/i/iproute2/iproute2_5.10.0-4_armhf.deb and then using dpkg and it installed but probably installed in the SD card instead of the SSD (which is where the dietpi is) because it’s still not working.

As stated above, let’s do this step by step. You can’t install packages on your HDD while running of SD card.

First point would be to get local access and disable the headless mode. For this you can connect your HDD to a Windows or MacOS computer. On the attached HDD, you should see the boot folder. There you would need to do 2 thinks:

Re-enabling HDMI requires a reboot. If you need emergency HDMI output, edit the following files on first partition
of the SDcard from external system:                                                                               
 - In config.txt, set "hdmi_ignore_hotplug=0" and comment/remove all (max_)framebuffer_(width/height) lines.      
 - In dietpi.txt, set "AUTO_SETUP_HEADLESS=1".

once this is working and you have local access, we can continue to install other packages. Please don’t install or download stuff you are not sure about.

I don’t have USB keyboards or mouses, unfortunately. Only bluetooth. Is there any way to do it without having to use HDMI? If not, what’s the next step after having HDMI access?

getting a keyboard attached. Otherwise, you are not able to execute/type commands to install missing packages.

Are you sure it is AUTO_SETUP_HEADLES=1? Because that says that disables HDMI. Shouldn’t it be 0?

Edit: also, having a keyboard, what are the next steps?

I copied the information from our configuration script. Might be a typo there. But indeed, it should be AUTO_SETUP_HEADLESS=0

Do you have local access to your system now? If yes we can continue.

Yes I have. What should I install now? (btw, the pihole uninstall probably failed IDK).

Edit: wow, looks like uninstalling pi-hole removed A LOT of useful stuff, now even the ping command doesn’t work. How come such famous software do this kind of things in a uninstall?! This “breaks” a device.

Yes it’s part of the network stack you removed.

Feel free to ask PiHole guys on the GitHub issue I linked above.

ok can you check following to verify missing packages. Once confirmed we will download them on a Windows/MacOS box.

  • DietPi version | cat /boot/dietpi/.version
  • Distro version | echo $G_DISTRO_NAME $G_RASPBIAN
  • Kernel version | uname -a
  • SBC model | echo $G_HW_MODEL_NAME or (EG: RPi3)
dpkg -l ifupdown iproute2 isc-dhcp-client

Here you have it (sorry for sharing this way, it’s because I can’t copy paste from it):

ok a 64bit system. Download following packages on a different computer. Store the files on an additional USB pen drive. You could store it on the HDD directly as well.

http://ftp.debian.org/debian/pool/main/i/ifupdown/ifupdown_0.8.36_arm64.deb
http://ftp.debian.org/debian/pool/main/i/iproute2/iproute2_5.10.0-4_arm64.deb
http://ftp.debian.org/debian/pool/main/i/isc-dhcp/isc-dhcp-client_4.4.1-2.3_arm64.deb

Once done connect the drive to the RPi4 and navigate into the directory you stored files on. Installation can be done as follow:

dpkg -i *.deb

Reboot the system. Usually this should get your network connection back.

Well… I got errors in all of them. Check the attachment please (I’m so pissed with pihole because of all of this struggle).

All fixed, I searched the missing packages (the deb files) and installed them as well. Then I was able to fix it. Thank you.

1 Like

yeah, that was correct procedure. A little bit of try and error to get all packages together. Good you are back online again.