curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \ | sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null Use code with caution. 3. Define the Repository Source
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] http://nginx.org/packages/ubuntu $(lsb_release -cs) nginx" \ | sudo tee /etc/apt/sources.list.d/nginx.list Use code with caution. 4. Configure Pin Priority (Optional but Recommended) download nginx deb
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] http://nginx.org/packages/debian $(lsb_release -cs) nginx" \ | sudo tee /etc/apt/sources.list.d/nginx.list Use code with caution. curl https://nginx
Authenticate your package downloads by piping the authentic NGINX signing key straight into your system local keyring: download nginx deb
sudo apt update sudo apt install curl gnupg2 ca-certificates lsb-release debian-archive-keyring -y Use code with caution. 2. Import the GPG Verification Key