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!
sudo apt update
and check for any errors/issues, thensudo 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:32sudo apt update
andsudo 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:25sudo 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 ofapt 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 theapt update
output, butapt-cache
is a little more focused on your question.. – guiverc Aug 16 '20 at 11:30apt update
, it's completely different from my new server. – andrew josephus Aug 16 '20 at 16:22sudo 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 theapt-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