How to update/upgrade Pi-hole with an OpenVPN on Ubuntu/Debian Linux server

Posted on in Categories , , last updated May 2, 2017

I installed an OpenVPN server with Pi-hole software to block block ads, reduced my 4G/3G/LTE traffic on the same Debian or Ubuntu Linux server. How do I upgrade my Pi-hole to the latest version using command line?

Updating Pi-hole is very easy. First you must update your operating system. The commands are as follows:

Update Debian/Ubuntu Linux server

Type the following apt-get command as follows:
$ sudo apt-get update
$ sudo apt-get upgrade
## reboot the server if a new kernel was installed on your server ##
$ sudo reboot

How do I update my Pi-hole?

Type the following command:
$ pihole -up
Sample outputs:

::: Checking for updates...
:::
::: Pi-hole version is v2.9.5 (Latest version is v3.0)
::: Web Admin version is v1.4.4.2 (Latest version is v3.0)
:::
::: Updating Everything
:::
::: Checking for existing repository...
:::    Checking /etc/.pihole is a repo... OK!
:::     Updating repo in /etc/.pihole... done!

        .;;,.
        .ccccc:,.
         :cccclll:.      ..,,
          :ccccclll.   ;ooodc
           'ccll:;ll .oooodc
             .;cll.;;looo:.
                 .. ','.
                .',,,,,,'.
              .',,,,,,,,,,.
            .',,,,,,,,,,,,....
          ....''',,,,,,,'.......
        .........  ....  .........
        ..........      ..........
        ..........      ..........
        .........  ....  .........
          ........,,,,,,,'......
            ....',,,,,,,,,,,,.
               .',,,,,,,,,'.
                .',,,,,,'.
                  ..'''.

:::
::: You are root.
::: --unattended passed to install script, no whiptail dialogs will be displayed
::: Verifying free disk space...
:::
::: Updating local cache of available packages... done!
:::
::: Checking apt-get for upgraded packages.... done!
:::
::: Your system is up to date! Continuing with Pi-hole installation...
:::    Checking for apt-utils... installed!
:::    Checking for debconf... installed!
:::    Checking for dhcpcd5... installed!
:::    Checking for git... installed!
:::    Checking for iproute2... installed!
:::    Checking for whiptail... installed!
:::
::: Checking for existing repository...
:::    Updating repo in /etc/.pihole... done!
 done!
:::
::: Checking for existing repository...
:::    Updating repo in /var/www/html/admin... done!
 done!
:::    Checking for bc... installed!
:::    Checking for cron... installed!
:::    Checking for curl... installed!
:::    Checking for dnsmasq... installed!
:::    Checking for dnsutils... installed!
:::    Checking for iputils-ping... installed!
:::    Checking for lsof... installed!
:::    Checking for netcat... installed!
:::    Checking for sudo... installed!
:::    Checking for unzip... installed!
:::    Checking for wget... installed!
:::    Checking for lighttpd... installed!
:::    Checking for php-common... installed!
:::    Checking for php-cgi... installed!
:::
::: Installing scripts from /etc/.pihole... done.
:::
::: Installing configs from /etc/.pihole...
:::    Existing dnsmasq.conf found... it is not a Pi-hole file, leaving alone!
:::    Copying 01-pihole.conf to /etc/dnsmasq.d/01-pihole.conf... done.
:::
::: Creating log file and changing owner to dnsmasq... already exists!
:::
::: Installing pihole custom index page...
:::     index.php missing, replacing...  done!
:::     Existing index.js detected, not overwriting
:::     blockingpage.css missing, replacing...  done!
:::
::: Installing sudoer file... done!
:::
::: Installing latest Cron script... done!
:::
::: Installing latest logrotate script... done!
:::
::: Downloading latest version of FTL...
:::  Detected x86_64 architecture
:::  Installing FTL... transferred... done.
Enter New Password (Blank for no password): 
Password Removed
::: Restarting services...
:::
::: Starting dnsmasq service... done.
:::
::: Enabling dnsmasq service to start on reboot... done.
:::
::: Starting lighttpd service... done.
:::
::: Enabling lighttpd service to start on reboot... done.
:::
::: Preparing to run gravity.sh to refresh hosts...
::: Cleaning up previous install (preserving whitelist/blacklist)
::: Running gravity.sh
:::
::: Neutrino emissions detected...
:::
::: Pulling source lists into range... done!
:::
::: Getting raw.githubusercontent.com list... done
:::   Status: Success (OK)
:::   List updated, transport successful!
::: Getting mirror1.malwaredomains.com list... done
:::   Status: Success (OK)
:::   List updated, transport successful!
::: Getting sysctl.org list... done
:::   Status: Success (OK)
:::   List updated, transport successful!
::: Getting zeustracker.abuse.ch list...
 done
:::   Status: Status 000
:::   Download failed and no cached list available (list will not be considered)
::: Getting s3.amazonaws.com list... done
:::   Status: Success (OK)
:::   List updated, transport successful!
::: Getting s3.amazonaws.com list... done
:::   Status: Success (OK)
:::   List updated, transport successful!
::: Getting hosts-file.net list... done
:::   Status: Success (OK)
:::   List updated, transport successful!
::: 
::: Aggregating list of domains... done!
::: Formatting list of domains to remove comments.... done!
::: 127786 domains being pulled in by gravity...
::: Removing duplicate domains.... done!
::: 104163 unique domains trapped in the event horizon.
:::
::: Adding adlist sources to the whitelist... done!
::: Whitelisting 6 domains... done!
::: Nothing to blacklist!
::: No wildcards used!
::: Formatting domains into a HOSTS file...::: No IP Values found! Please run 'pihole -r' and choose reconfigure to restore values
:::
::: Pi-hole version is now at v3.0
::: If you had made any changes in '/etc/.pihole', they have been stashed using 'git stash'
:::
::: Pi-hole version is now at v3.0
::: If you had made any changes in '/etc/.pihole', they have been stashed using 'git stash'

Test it

Visit admin url such as http://10.8.0.1/admin/, and you should see an updated pi-hole screen and version info at the bottom of page as follows:
Pi-hole Version v3.0 Web Interface Version v3.0 FTL Version v2.6
Sample outputs:

Fig.01: Pi-Hole admin/stats area updated with new version
Fig.01: Pi-Hole admin/stats area updated with new version

You can run the following command to see version info too:
$ pihole -v
Sample outputs:

::: Pi-hole version is v3.0 (Latest version is v3.0)
::: Web-Admin version is v3.0 (Latest version is v3.0)
This entry is 3 of 3 in the OpenVPN Tutorial series. Keep reading the rest of the series:
  1. How To Setup OpenVPN Server In 5 Minutes on Ubuntu Server
  2. Install Pi-hole with an OpenVPN to block ads
  3. How to update/upgrade Pi-hole with an OpenVPN

1 comment

Leave a Comment