Pihole -up skip package update?

Is there a way for Pihole -up to skip updating packages and just update pihole?

I might be wrong as it has been a while since I've looked, but I think that the update script only advises you if package updates are available rather than actually updating them

1 Like

That is correct. Updates are checked, but not installed.

Thinking about this: Should we do this? apt update can run ages on the lowest-end devices such as the Zero W. It is clear that Pi-hole may need to install dependencies but should we really care about the up-to-dateness of OS-provided packages?

Yeah, maybe we should only run the apt update on a fresh install?

:+1:

Hmm, maybe not.

We still need to detect if we need to install new dependencies (or fix if dependencies have been manually removed.

In update.sh we have:

# Install packages used by this installation script (necessary if users have removed e.g. git from their systems)
package_manager_detect
install_dependent_packages "${INSTALLER_DEPS[@]}"

which will, in turn, run apt update (or Fedora/CentOS equivalent)

herein we have

update_package_cache || exit 1

but we don't really have to. We can also just do this when we detect that at least one dependency has to be installed.

This is something I run in to as well and it is kind of annoying.

NanoPi Neo 512M on an actual uSD card.

root@pi:~# time pihole -up
  [✓] Update local cache of available packages
  [i] Existing PHP installation detected : PHP version 7.4.33
  [✓] Checking for git
  [✓] Checking for iproute2
  [✓] Checking for dialog
  [✓] Checking for ca-certificates

  [i] Checking for updates...
  [i] Pi-hole Core:     up to date
  [i] Web Interface:    update available
  [i] FTL:              up to date

  [i] Pi-hole Web Admin files out of date, updating local repo.
  [✓] Check for existing repository in /var/www/html/admin
  [i] Update repo in /var/www/html/admin...HEAD is now at be05b0f v5.21 (#2860)
  [✓] Update repo in /var/www/html/admin

  [i] If you had made any changes in '/var/www/html/admin/', they have been stashed using 'git stash'
  [i] Local version file information updated.


real    3m30.917s
user    3m3.722s
sys     0m13.566s

At the least we should look at checking if there are Pi-hole component updates first, as it is now we check for apt updates no matter what.

root@pi:~# pihole -up
  [✓] Update local cache of available packages
  [i] Existing PHP installation detected : PHP version 7.4.33
  [✓] Checking for git
  [✓] Checking for iproute2
  [✓] Checking for dialog
  [✓] Checking for ca-certificates

  [i] Checking for updates...
  [i] Pi-hole Core:     up to date
  [i] Web Interface:    up to date
  [i] FTL:              up to date

  [✓] Everything is up to date!

But I don't know of a light way to check if there are apt packages to be updated without running apt update and that's the big time (and resource) investment. We could check for the existence of /etc/.pihole to determine if this is a new install or an update. I don't think anyone would have that directory pre-existing. Is that directory going to exist with v6?

Do we need to know if the packages installed are the latest or need updates?

The only thing that is sensitive to that is php, afaik.

What this all started with is checking for kernel updates because back then kernel updates could vastly affect Pi-hole. That's why there is the notice that you should reboot. I don't think we need to do that anymore?

The problem I recently encounted was I have a daily cron to update, but a package was showing 404 so it didn’t do update on pihole.

Thats not recommended and almost a guarantee to go belly up at one point when you're not around to be able to fix it.
You're suppose to read the release notes first!

Easiest is to get an account on Github and subscribe for email notifications on a particular repo when updates are released.
I'm receiving notifications for below:

Watch --> Custom --> Releases

1 Like

There are RSS feeds for every repository as well.

1 Like

I’m only doing it during v6 development due to the increase in updates.

I will open a PR towards development-v6 where PHP is gone.

I agree.

2 Likes

I'm happy it's skipping as I'm currently running the Beta 6 on Debian Unstable/Sid.

What's the status with this one?