Categories
Raspberry Pi

How to update Pi-hole easily

Here you will learn how to update Pi-hole to the latest version from command line. You are here because you might see there is a new version showing in the footer of Pi-hole’s admin interface. But how do I update Pi-hole?

In rare cases, if you haven’t installed Pi-hole, you can install it in the following 1 command:

curl -sSL https://install.pi-hole.net | bash

Step 1 — SSH into Raspberry Pi to update Pi-hole

You might already know this, you can use ssh <ip/host> to ssh into your Raspberry Pi (4 or 3 maybe). If you installed Pi-hole on Ubuntu or CentOS, you can ignore this step.

On most linux systems, you can use Alt-Ctrl-t to open a terminal and type the following command:

ssh <ip/host>

Once you are on your Raspberry Pi, you will see your bash prompt, actually the username/host, is changed like below:

ssh into raspberry pi to upgrade pi hole
vh@varhowto-com:~$ ssh rpi
Linux rpi 4.19.118-v7l+ #1311 SMP Mon Apr 27 14:26:42 BST 2020 armv7l
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Web console: https://rpi:9090/ or https://192.168.0.130:9090/
Last login: Sat Aug 22 14:53:14 2020 from 192.168.2.103
pi@rpi:~ $

Step 2 — Check Pi-hole version for update

Next, make sure you need to update Pi-hole. Simply run the following command:

pihole -v

You will see similar output as shown in the following screenshot. Here my current Pi-hole version is 4.4 and the latest is 5.1.2. BTW, AdminLTE and FTL are Pi-hole’s components so will be updated as well.

checking pi hole version

pi@rpi:~ $ pihole -v
  Pi-hole version is v4.4 (Latest: v5.1.2)
  AdminLTE version is v4.3.3 (Latest: v5.1.1)
  FTL version is v4.3.1 (Latest: v5.2)

Step 3 — Update Pi-hole

Updating Pi-hole is a fully automated process and is a piece of cake — super easy.

Run the pihole command with -up, which means update Pi-hole, not bring Pi-hole up…

pihole -up

You will see similar output like below. It will take a while to update Pi-hole.

finished updating pi hole
pi@rpi:~ $ pihole -up
[i] Checking for updates…
[i] Pi-hole Core: update available
[i] Web Interface: update available
[i] FTL: update available
[i] Pi-hole core files out of date, updating local repo.
[✓] Check for existing repository in /etc/.pihole
[✓] Update repo in /etc/.pihole
[i] If you had made any changes in '/etc/.pihole/', they have been stashed using 'git stash'
[i] Pi-hole Web Admin files out of date, updating local repo.
[✓] Check for existing repository in /var/www/html/admin
[✓] 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] FTL out of date, it will be updated by the installer.
[✓] Root user check
.;;,. .ccccc:,. :cccclll:. ..,, :ccccclll. ;ooodc 'ccll:;ll .oooodc .;cll.;;looo:. .. ','. .',,,,,,'. .',,,,,,,,,,. .',,,,,,,,,,,,.... ....''',,,,,,,'....... ......... .... ......... .......... .......... .......... .......... ......... .... ......... ........,,,,,,,'...... ....',,,,,,,,,,,,. .',,,,,,,,,'. .',,,,,,'. ..'''.
[✓] Update local cache of available packages
[i] Existing PHP installation detected : PHP version 7.3.14-1~deb10u1
[i] Performing unattended setup, no whiptail dialogs will be displayed
[✓] Disk space check
[✓] Checking apt-get for upgraded packages… 273 updates available
[i] It is recommended to update your OS after installing the Pi-hole!
[i] Installer Dependency checks…
[✓] Checking for dhcpcd5
[✓] Checking for git
[✓] Checking for iproute2
[✓] Checking for whiptail
[✓] Checking for dnsutils
[✓] Supported OS detected
[i] SELinux not detected
[i] Performing reconfiguration, skipping download of local repos
[✓] Resetting repository within /etc/.pihole…
[✓] Resetting repository within /var/www/html/admin…
[i] Main Dependency checks…
[✓] Checking for cron
[✓] Checking for curl
[✓] Checking for iputils-ping
[✓] Checking for lsof
[✓] Checking for netcat
[✓] Checking for psmisc
[✓] Checking for sudo
[✓] Checking for unzip
[✓] Checking for wget
[✓] Checking for idn2
[✓] Checking for sqlite3
[✓] Checking for libcap2-bin
[✓] Checking for dns-root-data
[✓] Checking for libcap2
[i] Checking for lighttpd (will be installed)
[✓] Checking for php7.3-common
[i] Checking for php7.3-cgi (will be installed)
[✓] Checking for php7.3-sqlite3
[✓] Checking for php7.3-xml
[✓] Checking for php7.3-intl
[i] Processing apt-get install(s) for: lighttpd php7.3-cgi, please wait…
Selecting previously unselected package libfam0:armhf.
(Reading database … 150676 files and directories currently installed.)
Preparing to unpack …/00-libfam0_2.7.0-17.3_armhf.deb …
Unpacking libfam0:armhf (2.7.0-17.3) …
Selecting previously unselected package lighttpd.
Preparing to unpack …/01-lighttpd_1.4.53-4_armhf.deb …
Unpacking lighttpd (1.4.53-4) …
Preparing to unpack …/02-php7.3-zip_7.3.19-1~deb10u1_armhf.deb …
Unpacking php7.3-zip (7.3.19-1~deb10u1) over (7.3.14-1~deb10u1) …
Preparing to unpack …/03-php7.3-xml_7.3.19-1~deb10u1_armhf.deb …
Unpacking php7.3-xml (7.3.19-1~deb10u1) over (7.3.14-1~deb10u1) …
Preparing to unpack …/04-php7.3-sqlite3_7.3.19-1~deb10u1_armhf.deb …
Unpacking php7.3-sqlite3 (7.3.19-1~deb10u1) over (7.3.14-1~deb10u1) …
Preparing to unpack …/05-php7.3-readline_7.3.19-1~deb10u1_armhf.deb …
Unpacking php7.3-readline (7.3.19-1~deb10u1) over (7.3.14-1~deb10u1) …
Preparing to unpack …/06-php7.3-opcache_7.3.19-1~deb10u1_armhf.deb …
Unpacking php7.3-opcache (7.3.19-1~deb10u1) over (7.3.14-1~deb10u1) …
Preparing to unpack …/07-php7.3-mysql_7.3.19-1~deb10u1_armhf.deb …
Unpacking php7.3-mysql (7.3.19-1~deb10u1) over (7.3.14-1~deb10u1) …
Preparing to unpack …/08-php7.3-mbstring_7.3.19-1~deb10u1_armhf.deb …
Unpacking php7.3-mbstring (7.3.19-1~deb10u1) over (7.3.14-1~deb10u1) …
Preparing to unpack …/09-php7.3-json_7.3.19-1~deb10u1_armhf.deb …
Unpacking php7.3-json (7.3.19-1~deb10u1) over (7.3.14-1~deb10u1) …
Preparing to unpack …/10-php7.3-intl_7.3.19-1~deb10u1_armhf.deb …
Unpacking php7.3-intl (7.3.19-1~deb10u1) over (7.3.14-1~deb10u1) …
Preparing to unpack …/11-php7.3-gd_7.3.19-1~deb10u1_armhf.deb …
Unpacking php7.3-gd (7.3.19-1~deb10u1) over (7.3.14-1~deb10u1) …
Preparing to unpack …/12-php7.3-fpm_7.3.19-1~deb10u1_armhf.deb …
Unpacking php7.3-fpm (7.3.19-1~deb10u1) over (7.3.14-1~deb10u1) …
Preparing to unpack …/13-php7.3-dev_7.3.19-1~deb10u1_armhf.deb …
Unpacking php7.3-dev (7.3.19-1~deb10u1) over (7.3.14-1~deb10u1) …
Preparing to unpack …/14-php7.3-curl_7.3.19-1~deb10u1_armhf.deb …
Unpacking php7.3-curl (7.3.19-1~deb10u1) over (7.3.14-1~deb10u1) …
Preparing to unpack …/15-php7.3-cli_7.3.19-1~deb10u1_armhf.deb …
Unpacking php7.3-cli (7.3.19-1~deb10u1) over (7.3.14-1~deb10u1) …
Preparing to unpack …/16-php7.3-common_7.3.19-1~deb10u1_armhf.deb …
Unpacking php7.3-common (7.3.19-1~deb10u1) over (7.3.14-1~deb10u1) …
Selecting previously unselected package php7.3-cgi.
Preparing to unpack …/17-php7.3-cgi_7.3.19-1~deb10u1_armhf.deb …
Unpacking php7.3-cgi (7.3.19-1~deb10u1) …
Setting up php7.3-common (7.3.19-1~deb10u1) …
Setting up php7.3-mysql (7.3.19-1~deb10u1) …
Setting up php7.3-intl (7.3.19-1~deb10u1) …
Setting up php7.3-xml (7.3.19-1~deb10u1) …
Setting up libfam0:armhf (2.7.0-17.3) …
Setting up php7.3-opcache (7.3.19-1~deb10u1) …
Setting up php7.3-zip (7.3.19-1~deb10u1) …
Setting up php7.3-curl (7.3.19-1~deb10u1) …
Setting up php7.3-gd (7.3.19-1~deb10u1) …
Setting up lighttpd (1.4.53-4) …
Setting up php7.3-sqlite3 (7.3.19-1~deb10u1) …
Setting up php7.3-mbstring (7.3.19-1~deb10u1) …
Setting up php7.3-json (7.3.19-1~deb10u1) …
Setting up php7.3-readline (7.3.19-1~deb10u1) …
Setting up php7.3-cli (7.3.19-1~deb10u1) …
Replacing config file /etc/php/7.3/cli/php.ini with new version
Setting up php7.3-cgi (7.3.19-1~deb10u1) …
update-alternatives: using /usr/bin/php-cgi7.3 to provide /usr/bin/php-cgi (php-cgi) in auto mode
update-alternatives: using /usr/lib/cgi-bin/php7.3 to provide /usr/lib/cgi-bin/php (php-cgi-bin) in auto mode
Replacing config file /etc/php/7.3/cgi/php.ini with new version
Setting up php7.3-fpm (7.3.19-1~deb10u1) …
Setting up php7.3-dev (7.3.19-1~deb10u1) …
Processing triggers for systemd (241-7~deb10u4+rpi1) …
Processing triggers for man-db (2.8.5-2) …
Processing triggers for libc-bin (2.28-10+rpi1) …
[✓] Enabling lighttpd service to start on reboot…
[✓] Checking for user 'pihole'
[i] FTL Checks…
[✓] Detected ARM-hf architecture (armv7+)
[i] Checking for existing FTL binary…
[✓] Downloading and Installing FTL
[✓] Installing scripts from /etc/.pihole
[i] Installing configs from /etc/.pihole…
[i] Existing dnsmasq.conf found… it is not a Pi-hole file, leaving alone!
[✓] Copying 01-pihole.conf to /etc/dnsmasq.d/01-pihole.conf
[i] Installing blocking page…
[✓] Creating directory for blocking page, and copying files
[i] Backing up index.lighttpd.html
No default index.lighttpd.html file found… not backing up
[✓] Installing sudoer file
[✓] Installing latest Cron script
[✓] Installing latest logrotate script
[i] Backing up /etc/dnsmasq.conf to /etc/dnsmasq.conf.old
[✓] man pages installed and database updated
[i] Testing if systemd-resolved is enabled
[i] Systemd-resolved is not enabled
[✓] Restarting lighttpd service…
[✓] Enabling lighttpd service to start on reboot…
[i] Restarting services…
[✓] Enabling pihole-FTL service to start on reboot…
[✓] Restarting pihole-FTL service…
[i] Creating new gravity database
[i] Migrating content of /etc/pihole/adlists.list into new database
[i] Migrating content of /etc/pihole/blacklist.txt into new database
[i] Migrating content of /etc/pihole/whitelist.txt into new database
[i] Migrating content of /etc/pihole/regex.list into new database
[✓] Deleting existing list cache
[i] Neutrino emissions detected…
[✓] Pulling blocklist source list into range
[✓] Preparing new gravity database
[i] Target: https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
[✓] Status: Retrieval successful
[i] Received 57260 domains
[i] Target: https://mirror1.malwaredomains.com/files/justdomains
[✓] Status: Retrieval successful
[i] Received 26854 domains
[i] Target: http://sysctl.org/cameleon/hosts
[✓] Status: Retrieval successful
[i] Received 20567 domains
[i] Target: https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt
[✓] Status: Retrieval successful
[i] Received 34 domains
[i] Target: https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt
[✓] Status: Retrieval successful
[i] Received 2701 domains
[i] Target: https://hosts-file.net/ad_servers.txt
[✗] Status: Not found
[✗] List download failed: no cached list available
[i] Target: https://raw.githubusercontent.com/privacy-protection-tools/anti-AD/master/anti-ad-domains.txt
[✓] Status: Retrieval successful
[i] Received 41581 domains
[✓] Storing downloaded domains in new gravity database
[✓] Building tree
[✓] Swapping databases
[i] Number of gravity domains: 148997 (132248 unique domains)
[i] Number of exact blacklisted domains: 2
[i] Number of regex blacklist filters: 0
[i] Number of exact whitelisted domains: 9
[i] Number of regex whitelist filters: 0
[✓] Flushing DNS cache
[✓] Cleaning up stray matter
[✓] DNS service is running
[✓] Pi-hole blocking is Enabled
[i] The install log is located at: /etc/pihole/install.log
Update Complete!
Current Pi-hole version is v5.1.2.
Current AdminLTE version is v5.1.1.
Current FTL version is v5.2.

You will see “Update Complete!” when it’s done; you do not need to reboot your Raspberry Pi or computer. Then you can open pihole admin http://pi.hole/admin/index.php and you will see in the footer that pi-hole is updated to v5.1.2 and the web interface is of v5.2.

checking pi hole web interface after upgrading

3 steps to update Pi-hole

It’s easy to update pi-hole and it only took 3 steps.

Total Time: 10 minutes

SSH into Raspberry Pi for Pi-hole update

ssh into raspberry pi to upgrade pi hole

Simply open an terminal run ssh <ip/host>

Check Pi-hole version

checking pi hole version

Simply run pihole -v. You should see there are latest versions.

Update Pi-hole using -up

finished updating pi hole

Simply run pihole -up.

+17

By VarHowto Editor

Welcome to VarHowto!

7 replies on “How to update Pi-hole easily”

Using ChromeOS [crosh]:
Ctrl-Alt-T to open terminal
type SHELL
type SSH [your pihole IP on your network, e.g. 192.168.0.44]
password [you should know when you first setup installed your pihone]
Then follow the instructions here in this blog post.

BTW there is a typo in step 2, in the gray highlight: AdminLET

0

Ensure you are logged in as ‘root’ or use “sudo” !!

Took me way longer than it should to realise this.

Not needed for the core enging or web interface but IS required for FTL!

+1

Leave a Reply

Your email address will not be published. Required fields are marked *