First, update your system’s package list by entering the following command:
sudo apt update
Next, upgrade all your installed packages to their latest versions with the following command:
sudo apt-get upgrade
The commands you just ran will update the operating system (OS) on your Pi-hole, but will not update the Pi-hole software. You need to run the commands below to update the Pi-hole software.
If you are running your Pi-hole as a truly self-contained DNS resolver via Unbound, make sure to update your /etc/dnsmasq.d/01-pihole.conf file
The command below will show you the version your Pi-hole is running
sudo pihole -v
The command below will upgrade your Pi-hole to the latest version
sudo pihole -up
Generally speaking, doing this regularly will keep your installation up to date for the particular major Raspberry Pi OS release you are using (e.g. Stretch). It will not update from one major release to another, for example, Stretch to Buster.
Use the following command to reset your password
pihole -a -p
Install Pi-hole – https://github.com/pi-hole/pi-hole/#one-step-automated-install