"No nginx package available" error CentOS 6.5

I am trying to install nginx on CentOS 6.5, then I added these lines to the /etc/yum.repos.d/nginx.repo file enter image description here

Then install nginx with:
enter image description here

And I have a message error: no nginx package How can I fix this? I would appreciate any help you can give me in working on this issue!

+6
source share
6 answers

nginx is not part of the CentOS core repository.

But you can install EPEL repositiry to get nginx:

yum install epel-release

and then

yum install nginx

+19
source

Your repo url has an error. You must manually replace $ releaseverver with "5" (for 5.x) or "6" (for 6.x), depending on your OS version. Similarly, you should also edit $ basearch. After that, run the following command

yum clean all

yum install nginx

An alternative is to install the epel repository and install nginx there.

yum install epel-release

yum clean all

yum install nginx

+4
source

This should work well for oraclelinux7

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm yum -y install nginx 

Dockerfile to install nginx on oraclelinux:

 FROM oraclelinux:7-slim RUN rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm RUN yum -y install nginx && yum clean all && rm -rf /var/cache/yum EXPOSE 80 ENTRYPOINT ["nginx", "-g", "daemon off;"] 
+3
source

Despite the fact that otherwise the advice regarding manually setting the $releasever and $basearch in the repo file will not hurt on its own (at least as long as you stick to the software version referenced by the values ​​you set), this is not is strictly necessary.

I also have the exact content that you posted in a file called /etc/yum.repos.d/nginx.repo that functions correctly without explicitly setting the above values.

My recommendation would be to perform yum update before trying to install (maybe when you tried to install, yum did not request all repo urls from the files in /etc/yum.repos.d/ for the latest versions of their database). Also make sure that your created file ends with .repo , as otherwise it will be ignored by yum.

Otherwise, check the SElinux security contexts for the files in this directory - or simply do it manually and manually restore them by running restorecon -Rv '/etc/yum.repos.d' and check the permissions of the repository files manually, which must be root : root and show 644 as file permissions. To change them manually, run chmod 644 /etc/yum.repos.d/nginx.repo and chown root:root /etc/yum.repos.d/nginx.repo

I hope that part of the above will solve your problems!

0
source

Try disabling plugins for yum:

 vim /etc/yum.conf 

set plugins = 0 and reinstall epel-release:

 yum remove epel-release yum install epel-release yum install nginx 

it works for me, good luck!

0
source

Install nginx first! Run the following commands to first add the EPEL repository (optional packages for Enterprise Linux), and then install nginx.

 yum install epel-release yum install nginx 
-1
source

Source: https://habr.com/ru/post/978981/


All Articles