Pi-hole on bullseye install fails, unable to locate package idn2

Newly imaged with Raspberry Pi imager

sudo apt update and upgrade went fine with about 8 updates.

Pi-hole install fails with

E: Unable to locate package idn2
E: Package 'jq' has no installation candidate
E: Package 'lighttpd' has no installation candidate
E: Package 'php-common' has no installation candidate
E: Package 'php-cgi' has no installation candidate
E: Package 'php-sqlite3' has no installation candidate
E: Package 'php-xml' has no installation candidate
E: Package 'php-intl' has no installation candidate
E: Package 'php-json' has no installation candidate

I'm using all the default settings for pi-hole installer.

nslookup raspbian.raspberrypi.org indicates everything looks fine.

I uncommented repositories in /etc/apt/sources.list and /etc/apt/sources.list.d/raspi.list then re-run sudo apt update

I've re-imaged twice with same result.
My router was just factory reset and doesn't do anything special yet.

What do these commands show?

lsb_release -a

uname -a

cat /etc/apt/sources.list.d/raspi.list

sudo apt update

What command or commands are you using to do the Pi-hole install?

lsb_release -a gives

No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye

uname -a
Linux pihole 5.15.61-v7+ #1579 SMP Fri Aug 26 11:10:59 BST 2022 armv7l GNU/Linux

cat /etc/apt/sources.list.d/raspi.list

deb http://archive.raspberrypi.org/debian/ bullseye main
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
deb-src http://archive.raspberrypi.org/debian/ bullseye main

sudo apt update

Hit:1 http://raspbian.raspberrypi.org/raspbian bullseye InRelease
Hit:2 http://archive.raspberrypi.org/debian bullseye InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.

For installing pi hole I followed
https://github.com/pi-hole/pi-hole/#one-step-automated-install
First trying
curl -sSL https://install.pi-hole.net | bash
than downloading and installing using

wget -O basic-install.sh https://install.pi-hole.net
sudo bash basic-install.sh

Used defaults for both installs, and both fail the same way.

Not sure if this is important, but:

n@pihole:/etc/apt $ apt-cache madison idn2
   libidn2 |    2.3.0-5 | http://raspbian.raspberrypi.org/raspbian bullseye/main Sources
 libidn2-0 |    2.0.2-5 | http://raspbian.raspberrypi.org/raspbian bullseye/main Sources
n@pihole:/etc/apt $ apt-cache showpkg idn2
N: Unable to locate package idn2

What do you see in /etc/apt/sources.list?

I uncommented the last line in both of these:
sources.list:

deb http://raspbian.raspberrypi.org/raspbian/ bullseye main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
deb-src http://raspbian.raspberrypi.org/raspbian/ bullseye main contrib non-free rpi

sources.list.d/raspi.list:

deb http://archive.raspberrypi.org/debian/ bullseye main
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
deb-src http://archive.raspberrypi.org/debian/ bullseye main

Looks like the expected values.

Note:

I uncommented the last line in both of these:

You only need to uncomment those lines (starting with deb-src) if you need to get the source code, to compile your own versions.

Can you try to install any of these packages manually?

What happens if you try: sudo apt install jq ?
or sudo apt install idn2 ?

(If you receive an error, post the complete output here)

Also post output for below pls:

sudo grep . -R /etc/apt/preferences.*

We observed APT pinning for the jq package before but dont have a definitive answer yet why:

1 Like
 sudo apt install jq 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package jq is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'jq' has no installation candidate
 sudo apt install idn2
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package idn2

sudo grep . -R /etc/apt/preferences.* returns nothing. There are no files in /etc/apt/preferences.d/

1 Like

UPDATE: did another apt update/upgrade and libexpat1-dev,rpi-eeprom and libexpat1 were upgraded. Tried installing idn2 manually and it worked.

Did sudo bash basic-install.sh and it the installation seems to have worked. Must have been something in one of those packages.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.