Netcat on dietpi

Pardon the noob question, but if I have pihole on a Raspbian (dietpi) system, do I need to build netcat-openbsd specially for my system now that it's an explicit dependency? There is "no installation candidate" in apt. Thanks in advance for your help.

Are you referring to Install netcat-openbsd as dependency explicitly by MichaIng · Pull Request #4532 · pi-hole/pi-hole · GitHub?

I think if everything is working for you right now, then you don't need to change anything. Is the status on the web interface is properly displayed?

Raspbian ships netcat-openbsd. Do you face the same error when running this from console?

apt update
apt install netcat-openbsd

Yes, unfortunately, I do. I'm starting to believe that it's a problem with dietpi, though. Since my original post, I uninstalled git from the dietpi software manager (without realizing that it was needed for pihole), and when I retried the pihole update I got the same error with respect to the (re)installation of git. Maybe dietpi isn't correctly reporting the OS type to the pihole updater?

I believe your APT is falsely configured. Does apt update show anything about loading lists from Raspbian? Can you show it's output and:

cat /etc/apt/sources.list

Pi-hole checks whether the apt-get command is available to know which distro family it is, which works well on DietPi. Nothing else is relevant. Note that the DietPi image you use (ARMv6 for RPi) is Raspbian under the hood.

apt update seems to hit the correct repos:

dietpi@Pi2:~$ sudo apt update
Hit:1 http://raspbian.raspberrypi.org/raspbian bullseye InRelease
Hit:2 https://archive.raspberrypi.org/debian bullseye InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.

and the sources list looks fine to me, too:

dietpi@Pi2:~$ cat /etc/apt/sources.list
deb http://raspbian.raspberrypi.org/raspbian/ bullseye main contrib non-free

That looks good. What does the following show?

apt policy netcat-openbsd
dietpi@Pi2:~$ apt policy netcat-openbsd
netcat-openbsd:
  Installed: (none)
  Candidate: (none)
  Version table:
     1.217-3 -1
         -1 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf Packages

APT pinning is blocking this package, can you show:

for i in /etc/apt/preferences{,.d/*}
do
[[ -f $i ]] || continue
echo "$i:"
cat "$i"
done
1 Like
/etc/apt/preferences.d/dietpi-wireguard:
Package: *
Pin: release n=bullseye
Pin-Priority: -1

Package: wireguard wireguard-dkms wireguard-tools
Pin: release n=bullseye
Pin-Priority: 100

You didn't follow DietPi's guide when distro-upgrading from Buster to Bullseye, did you? :wink:

When installing WireGuard on Buster systems, we placed APT pins to install (only) WireGuard form Bullseye, since Raspbian has no backports (compared to Debian) from where we could have pulled it. So only the WireGuard packages are allowed to be installed from this list. Your system hence is still nearly entirely Buster while you removed the Buster APT lists. If you really want to upgrade to Bullseye, you need to remove these pins. At best follow our upgrade guide (which includes the step to remove all obsolete/conflicting APT pins): DietPi – How to upgrade to “Bullseye” – DietPi Blog

While you may have thought you are on Bullseye already, note that this time it will be the real upgrade, hence a lot of packages are upgraded and there is no guarantee that everything will work afterwards without some manual post fixes. But we tried to cover all known such cases in the guide.

Alternatively you could re-add the Buster list, but I'm not sure if it may cause conflicts mid/long term as you use Bullseye packages from the Raspberry Pi repository already (note the difference between archive.raspberrypi.org=RPi specific packages vs raspbian.raspberrypi.org=Raspbian ARMv6hf distro packages).

3 Likes

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