snapd return status code 400: Bad request

Solution 1:

Run this command in terminal

sudo rm -r /var/lib/apt/lists/*

And Then

sudo apt update 

I think your /var/lib/apt/lists/ files are corrupted So You Can delete them to regenerate them.

Solution 2:

This error is usually caused by trying to install software that is packaged as a "classic snap" rather than a normal snap or a deb package. Classic snaps cannot be installed using the Ubuntu Software application due to the way they are packaged (why they even show up in Ubuntu Software is a mystery to me). You can install them using the snap command-line tool. First, search for the app (i.e. for slack):

snap search slack

The notes column will say classic for classic snaps. These are the kind that must be installed using the command line:

sudo snap install slack

this will warn you about the security risks of a classic snap and advise you to append --classic if you understand them:

sudo snap install slack --classic

Sources:

  • When I try to install vscode, snapd shows error code 400

  • https://itsfoss.com/snapd-error-ubuntu/