How to Install the Latest Version of Nginx on Ubuntu Bionic
Nginx.org maintains a repository for Ubuntu. We can use this repository to install the latest version of Nginx.
First off, let’s create a repository source file for Nginx with the following command.
|
|
Paste in the following two lines to the file:
deb [arch=amd64] http://nginx.org/packages/mainline/ubuntu/ bionic nginx
deb-src http://nginx.org/packages/mainline/ubuntu/ bionic nginx
In order to verify the integrity of packages downloaded from this repository, we need to import Nginx public key using the commands below.
You should see ‘OK’ so that we can move on.
Run the following command to update the repository info, remove the former version, finally install the latest version of nginx.
Beautiful, isn’t it? ;)
On CentOS 8:
Happy coding! 😎