0

I am a newcomer to setting up servers and can't seem to install nginx on my Ubuntu 18.04.3 (LTS) x64 server from Digitalocean. I've tried reading other entries but none of the solutions seem to work for me. I have tried uninstalling and reinstalling but always get this same response.

sudo apt-get install nginx
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies: nginx : Depends: nginx-core (< 1.14.0-0ubuntu1.7.1~) but it is not going to be installed or nginx-full (< 1.14.0-0ubuntu1.7.1~) but it is not going to be installed or nginx-light (< 1.14.0-0ubuntu1.7.1~) but it is not going to be installed or nginx-extras (< 1.14.0-0ubuntu1.7.1~) but it is not going to be installed Depends: nginx-core (>= 1.14.0-0ubuntu1.7) but it is not going to be installed or nginx-full (>= 1.14.0-0ubuntu1.7) but it is not going to be installed or nginx-light (>= 1.14.0-0ubuntu1.7) but it is not going to be installed or nginx-extras (>= 1.14.0-0ubuntu1.7) but it is not going to be installed E: Unable to correct problems, you have held broken packages.

Any help would be greatly appreciated!

  • If your system was up-to-date it should report you're running 18.04.5 (not 18.04.3), so check what you're running, and upgrade. I'd sudo apt update and check for any errors/issues, then sudo apt full-upgrade to install upgraded packages again noting messages. You've likely ignored issues from prior package issues stopping you (held packages). https://packages.ubuntu.com/search?keywords=nginx-core&searchon=names&suite=all§ion=all – guiverc Aug 16 '20 at 08:32
  • Hey thanks for the advice! I went ahead and did the sudo apt update and sudo apt full-upgrade and confirmed that my Ubuntu version is now Ubuntu 18.04.5 LTS. I am having a little trouble figuring out what issues I ignored could you give me an example? Thank you, really appreciate it! – andrew josephus Aug 16 '20 at 11:25
  • Usually you use sudo apt -f install to try and --fix-broken any packages. I'd suggest looking at your sources, eg. apt-cache policy nginx nginx-core and comparing with the expected result in my prior comment. I can't read the output of apt update (what I meant with errors/issues in the messages that scroll as it runs). I'd also likely check your used mirror is up-to-date and an official one etc (details that show in the apt update output, but apt-cache is a little more focused on your question.. – guiverc Aug 16 '20 at 11:30
  • Hey I tried to figure out what went wrong but I think this is quite a high level process for me. I created a new server and managed to install nginx with no problems. I figure that I must have messed with something I shouldn't have when setting up the server. Thank you for your help anyways! I might come back to this if I ever get my knowledge high enough. If you want I can show you the response my faulty server gave me for apt update, it's completely different from my new server. – andrew josephus Aug 16 '20 at 16:22
  • My references to sudo apt update & check for errors/issue was telling you to look for anything that didn't belong, wrong release or non-ubuntu, or other 3rd party that can product package issues.. Yeah many of us can scan & instantly detect wrong detail in the output, for newbies alas not so. Likewise to peruse the apt-cache again the same (comparing the results for the apt-cache to what you should have got as per my first comment's link for a single package), then repeat for other packages etc.. On your actual system you don't need packages.ubuntu.com as commands give answers faster – guiverc Aug 16 '20 at 22:10
  • Thank you for trying to guide me! It's nice to see such a friendly community especially to newcomers on this platform. I'll definitely refer back to your comments when I get more knowledge! – andrew josephus Aug 17 '20 at 08:13
  • 1

0 Answers0