Question

Unable to install Nginx on Ubuntu 21.10

I run sudo apt install nginx but I get

Reading package lists… Done Building dependency tree… Done Reading state information… Done E: Unable to locate package nginx


Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

alexdo
Site Moderator
Site Moderator badge
August 16, 2022

Hello @biglightcyanmantaray

Nginx is available in Ubuntu’s default repositories, it is possible to install it from these repositories using the apt packaging system.

You can make sure that you’ve enabled all Ubuntu repositories

  1. sudo add-apt-repository main
  2. sudo add-apt-repository universe
  3. sudo add-apt-repository restricted
  4. sudo add-apt-repository multiverse

and then execute the install command one more time.

However, if you’re still facing issues get back here on this thread and we’ll look into it.

Regards

KFSys
Site Moderator
Site Moderator badge
August 16, 2022

Hi @biglightcyanmantaray,

Before trying to install Nginx, update your Droplet like so:

  1. apt update
  2. apt upgrade

then try again. By doing an update you’ll update your apt cache which should help with the problem.

Hope that helps!