By default, the Nginx version on Ubuntu 20.04 LTS is outdated.
We can run following command to prove that:
lee@lee-VirtualBox:~$ sudo apt-cache policy nginx nginx: Installed: (none) Candidate: 1.18.0-0ubuntu1.2 Version table: 1.18.0-0ubuntu1.2 500 500 http://tw.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages 500 http://tw.archive.ubuntu.com/ubuntu focal-updates/main i386 Packages 500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages 500 http://security.ubuntu.com/ubuntu focal-security/main i386 Packages 1.17.10-0ubuntu1 500 500 http://tw.archive.ubuntu.com/ubuntu focal/main amd64 Packages 500 http://tw.archive.ubuntu.com/ubuntu focal/main i386 Packages
If we want to install the latest Nginx version, it can consider following steps:
sudo add-apt-repository ppa:ondrej/nginx -y
lee@lee-VirtualBox:~$ sudo add-apt-repository ppa:ondrej/nginx -y Hit:1 http://tw.archive.ubuntu.com/ubuntu focal InRelease Hit:2 https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/ InRelease Hit:3 https://download.docker.com/linux/ubuntu focal InRelease Hit:4 http://tw.archive.ubuntu.com/ubuntu focal-updates InRelease Hit:5 http://tw.archive.ubuntu.com/ubuntu focal-backports InRelease Hit:6 http://security.ubuntu.com/ubuntu focal-security InRelease Hit:7 http://ppa.launchpad.net/ansible/ansible/ubuntu focal InRelease Hit:8 http://ppa.launchpad.net/ondrej/nginx/ubuntu focal InRelease Hit:9 http://ppa.launchpad.net/ondrej/php/ubuntu focal InRelease Reading package lists... Done
sudo apt-cache policy nginx
lee@lee-VirtualBox:~$ sudo apt-cache policy nginx nginx: Installed: (none) Candidate: 1.20.1-2+ubuntu20.04.1+deb.sury.org+1 Version table: 1.20.1-2+ubuntu20.04.1+deb.sury.org+1 500 500 http://ppa.launchpad.net/ondrej/nginx/ubuntu focal/main amd64 Packages 500 http://ppa.launchpad.net/ondrej/nginx/ubuntu focal/main i386 Packages 1.18.0-0ubuntu1.2 500 500 http://tw.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages 500 http://tw.archive.ubuntu.com/ubuntu focal-updates/main i386 Packages 500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages 500 http://security.ubuntu.com/ubuntu focal-security/main i386 Packages 1.17.10-0ubuntu1 500 500 http://tw.archive.ubuntu.com/ubuntu focal/main amd64 Packages 500 http://tw.archive.ubuntu.com/ubuntu focal/main i386 Packages
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
By default, the Nginx version on Ubuntu 20.04 LTS is outdated.
We can run following command to prove that:
If we want to install the latest Nginx version, it can consider following steps:
sudo add-apt-repository ppa:ondrej/nginx -yto import this PPA repository.sudo apt-cache policy nginxcommand again and we can notice that we've the latest Nginx version can be installed.