How To Fix GPG Error BADSIG

On this page you will see how to fix a BADSIG GPG error when updating the repository. A BADSIG GPG Error looks like the following example:
Reading package lists... Error!
W: GPG error: stable Release: The following signatures were invalid: BADSIG A040830F7FAC5991 Google, Inc. Linux Package Signing Key <>
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/
E: The package lists or status file could not be parsed or opened.

To fix this you need to do the following:
  • Open a terminal

  • Type the following command:
    sudo -i

  • Type your password and press Enter

  • Then type the following Terminal commands:
    apt-get clean
    cd /var/lib/apt
    mv lists lists.old
    mkdir -p lists/partial
    apt-get clean
    apt-get update

  • After the last command you will see that the error has been fixed!