Last active
July 29, 2023 09:51
-
-
Save muratgozel/e5536cd96a5a202d9533e3a6b85dcc8b to your computer and use it in GitHub Desktop.
setup nginx latest version on ubuntu.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt install curl gnupg2 ca-certificates lsb-release ubuntu-keyring | |
curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor | sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null | |
gpg --dry-run --quiet --no-keyring --import --import-options import-show /usr/share/keyrings/nginx-archive-keyring.gpg | |
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 | |
echo -e "Package: *\nPin: origin nginx.org\nPin: release o=nginx\nPin-Priority: 900\n" | sudo tee /etc/apt/preferences.d/99nginx | |
sudo apt update | |
sudo apt install nginx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment