NGINX is giving error when i try to install - linux

I am trying to install nginx in
Amazon Linux AMI
but when i try to run command
sudo yum install nginx
error is below
Loaded plugins: langpacks, priorities, update-motd
Resolving Dependencies
--> Running transaction check
---> Package nginx.x86_64 0:1.14.0-1.el6.ngx will be installed
--> Processing Dependency: libpcre.so.0()(64bit) for package: nginx-1.14.0-1.el6.ngx.x86_64
--> Finished Dependency Resolution
Error: Package: nginx-1.14.0-1.el6.ngx.x86_64 (nginx)
Requires: libpcre.so.0()(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

I had this exact same problem. Check if you have a file like /etc/yum.repos.d/nginx.repo.
The Nginx install instructions tell us to create such a file and that it should look like this:
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/rhel/$releasever/$basearch/
gpgcheck=0
enabled=1
Those instructions also tell us
Due to differences between how CentOS, RHEL, and Scientific Linux populate the $releasever variable, it is necessary to manually replace $releasever with either 5 (for 5.x) or 6 (for 6.x), depending upon your OS version.
So you need to replace $releasever with the appropriate version of your OS. But when using Amazon Linux AMI (or, in my case, the Azure version), it's not easy to tell what this is.
I found that sudo yum install nginx only worked when I replaced $releasever with 7. When I used 6 instead, I got the exact error as you. Hope this helps!

First run $ sudo yum update -y and after that try to install, if still facing same issue then try with $ sudo yum install nginx --skip-broken

Related

Problem with moby packages when installing docker-ce on CentOS 7

I have a docker image for CentOS 7 which installs docker-ce via the recommended instructions.
i.e.
RUN yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
RUN yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
RUN yum update -y
RUN yum install -y docker-ce docker-ce-cli containerd.io
Recently this stopped working and now fails as follows:
--> Processing Conflict: moby-containerd-1.3.6+azure-1.x86_64 conflicts containerd
--> Processing Conflict: moby-runc-1.0.0~rc10+azure-2.x86_64 conflicts runc
--> Finished Dependency Resolution
Error: moby-containerd conflicts with containerd.io-1.2.13-3.2.el7.x86_64
Error: moby-runc conflicts with containerd.io-1.2.13-3.2.el7.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
The command '/bin/sh -c yum install -y docker-ce docker-ce-cli containerd.io' returned a non-zero code: 1
If the install command is replaced with:
yum install -y docker
I get a different error to do with an unsigned package:
Package runc is obsoleted by moby-runc, trying to install moby-runc-1.0.0~rc10+azure-2.x86_64 instead
...
Package moby-runc-1.0.0~rc10+azure-2.x86_64.rpm is not signed
I tried forcing use of a few old versions as below to no avail e.g.
RUN yum install -y docker-1.13.1-102.git7f2769b.el7.centos
Why is this happening? How can I fix it? And how can I prevent similar problems in the future?
Update: A critical missing piece of information from this question is the use of Azure. I had the following as aspnetcore is required to publish packages in an Azure devops pipeline:
RUN rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
RUN yum update -y && yum install aspnetcore-runtime-3.1 -y
my repo's needed to be updated --- the following resolved me:
curl https://packages.microsoft.com/config/rhel/7/prod.repo > ./microsoft-prod.repo
sudo cp ./microsoft-prod.repo /etc/yum.repos.d/
yum update -y
https://learn.microsoft.com/en-us/windows-server/administration/linux-package-repository-for-microsoft-software
The Answer from user8475213 worked for me. But I had to run after these commands also:
yum clean metadata
Caveat: Usually disclaimers apply. This is only what I think, I may be mistaken. Please comment / suggest edits if so.
How can I fix it?
This was actually a problem with the baseurl of a repo not the docker-ce repo (though I did originally file a bug report there (see issue #11198).
The moby packages come from "packages-microsoft-com-prod".
It seems the baseurl has changed.
The correct one is now:
baseurl=https://packages.microsoft.com/rhel/7/prod/
installed via:
RUN curl https://packages.microsoft.com/config/rhel/7/prod.repo >/etc/yum.repos.d/microsoft-prod.repo
The one with the dodgy packages is:
baseurl=https://packages.microsoft.com/centos/7/prod/
Installed via:
RUN rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
The moby packages exist only in the CentOS repo which is possibly defunct, as Microsoft themselves have changed installation documentation in various places.
There was also a workaround. You can exclude the 'moby' packages until they are really ready as in:
RUN yum install -y docker --exclude=moby-\*
Why is this happening?
I think this is caused by overly aggressive promotion of moby replacements for docker-ce functionality.
It is hopefully a transient state while they are working things out.
That the package moby-runc-1.0.0~rc10+azure-2.x86_64.rpm is not signed suggests a problem with the build process used. This package ought only to be available to beta testers. Certainly not in a repository marked "stable".
How can I prevent similar problems in the future?
Contrary to popular myths, using docker does not completely isolate you from changes in the environment. The repositories used by your docker files are themselves part of the environment. If that environment changes, as in this case, then your reproducible build may cease to be reproducible. The only real way to avoid that is to host your own repositories which comes at a high price. Usually external repositories are stable enough that this is not an issue.
You should consider specifying specific versions of packages to install in your dockerfile to avoid getting unexpected upgrades. However, that will not help you in cases like this where a package is obsoleted and replaced.
Related problem in RHEL 8
Seems that azure depends on packages from the container-tools module, and Docker conflicts with these packages.
# dnf remove #container-tools

Can't install condor on CentOS

I have been trying to install condor on my centos virtual machine but keep getting the following errors:
--> Finished Dependency Resolution
Error: Package: condor-classads-8.5.5-1.el6.x86_64 (htcondor-development)
Requires: libpcre.so.0()(64bit)
Error: Package: condor-8.5.5-1.el6.x86_64 (htcondor-development)
Requires: ecryptfs-utils
Error: Package: condor-8.5.5-1.el6.x86_64 (htcondor-development)
Requires: libpcre.so.0()(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
I looked around online and tried all the suggestions but nothing's worked. I did the next logical thing and tried to install those packages but doing yum install ecryptfs-utils gave me "Nothing to do," message. Same with libpcre.so.0() I'm a beginner with Linux so I don't know what I'm doing wrong here. Help appreciated.
I had the same issue, and this was happening because yum was trying to install different version of condor. I was running centos 6.6, but yum was trying to install centos 7 (rhel 7) version. The reason for this was, by mistake, I initially downloaded and setup the rhel7 repo details of condor, and results got cached.
The solution is to clear yum cache (yum clean all), download the correct condor repo for your CentOS version/arch (use rpm -q centos-release to find this out), and then install (yum install condor-all).
Get condor from the official location. It has all the binaries it needs.

How to resolve dependencies while installing application on linux (CentOS 7.1)

When I tried install deluge on my CentOS 7.1 I was facing dependecy problems due to some el6 which are not meant for CentOS 7.1. So, I found this page:
https://gist.github.com/dasgoll/111f6f3364e2ab97bc08
His instructions:
Centos 7.1
yum -y install wget wget hxxp://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
rpm -ivh nux-dextop-release-0-5.el7.nux.noarch.rpm
yum -y install deluge-web
systemctl start deluge-web
systemctl stop firewalld
browse http://192.168.3.101:8112
check it
yum install deluge-console
And my question is: Why he installed "nux-dextop-release-0-5.el7.nux.noarch.rpm" from li.nux.ro (if I'm not wrong it's a repository, correct me if I'm)? Because I had this dependency problem earlier when I tried installing deluge. But when I used his instructions it resolved all the dependencies automatically for me. So does this rpm file he installed on the first place was for resolving dependencies? If not then how can one work around with dependencies while installing a piece of software/application. Than You in advance.
P.S. I asked the same question in comments there too. But I'm uncertain of receiving reply there (no offence for the guy/girl - dasgoll).
Third party package repos will often use a *-release package to contain both a yum repo definition and a rpm signing public key so that end users can install packages directly from the repo using yum instead of having to find and then download them one by one.

Error Installing phpmyadmin on CentOS

I get the this error when i try yo install phpmyadmin on CentOS 6.5 VPS using this.
COMMAND :
sudo yum install phpmyadmin
ERROR :
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.solarvps.com
* epel: epel.mirror.constant.com
* extras: mirror.wiredtree.com
* rpmforge: repoforge.mirror.constant.com
* updates: mirrors.lga7.us.voxel.net
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package phpmyadmin.noarch 0:2.11.11.3-2.el6.rf will be installed
--> Processing Dependency: php-mbstring >= 4.1.0 for package: phpmyadmin-2.11.11.3-2.el6.rf.noarch
--> Running transaction check
---> Package php-mbstring.x86_64 0:5.3.3-27.el6_5 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.3-27.el6_5 for package: php-mbstring-5.3.3-27.el6_5.x86_64
--> Finished Dependency Resolution
Error: Package: php-mbstring-5.3.3-27.el6_5.x86_64 (updates)
Requires: php-common(x86-64) = 5.3.3-27.el6_5
Installed: php-common-5.4.30-1.el6.remi.x86_64 (#remi)
php-common(x86-64) = 5.4.30-1.el6.remi
Available: php-common-5.3.3-26.el6.x86_64 (base)
php-common(x86-64) = 5.3.3-26.el6
Available: php-common-5.3.3-27.el6_5.x86_64 (updates)
php-common(x86-64) = 5.3.3-27.el6_5
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
Somebody please Help. Thanx in advance
You've installed a more recent PHP version (5.4.30-1) from another source (#remi) than the officials (base) repository provides. Now you're trying to install the phpMyAdmin package, which depends on php-mbstring. php-mbstring is the actual problem here -- it's being automatically installed because phpmyadmin depends on it, but the version you're attempting to install isn't compatible with the rest of your PHP installation.
The solution is easy, though, since remi also provides phpmyadmin (quite a bit more recent version than you're attempting to install, too!). Just install phpmyadmin and php-common from the remi repository like you installed PHP. There are some instructions at http://blog.famillecollet.com/pages/Config-en if you forgot, but you managed to install the upgraded PHP already so you should be able to get the remi phpmyadmin installed pretty easily.
OR....
Download phpMyAdmin from http://www.phpmyadmin.net and uncompress it to your web root and forget about the package. php-mbstring isn't strictly required to run the application anyway, so you don't even need to worry about that part as long as you meet the other requirements.
You installed php5.4 from remi repository.
phpmyadmin needs php to work; but you are installing phpmyadmin from the official repository and that phpmyadmin version needs php5.3.
I guess you don't want to go back to php5.3, so just run this command:
yum --enablerepo=remi install phpmyadmin
If you didn't add remi repositories to you CentOS, you will have to previously run:
sudo rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

Unable to yum install anything on RHEL

I am on a new RHEL system.
I seem to be unable to be able to install anything package via yum install.
yum install nmap
The current repos in
ls /etc/yum.repos.d/
google-chrome.repo redhat.repo rhel-source.repo
What could be going wrong ?
OUTPUT OF YUM INSTALL:
$ sudo yum install nmap
[sudo] password for user:
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Setting up Install Process
No package nmap available.
Error: Nothing to do
Red Hat doesn't use the /etc/yum.repos.d directory for official packages so the answer won't be in there. It will use the subscription plugin placed in /etc/yum/pluginconf.d.
You mentioned that the RHEL host is new. You will need to make sure your subscription is valid or yum will fail silently.
You can use the subscription-manager list command to gain info regarding subscriptions.
Centos has done it for you.
Create a repo file in /etc/yum.repos.d as
vi /etc/yum.repos.d/myrepo.repo
Then paste this in this file:
[centos]
name=CentOS-7
baseurl=http://ftp.heanet.ie/pub/centos/7/os/x86_64/
enabled=1
gpgcheck=1
gpgkey=http://ftp.heanet.ie/pub/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7
Saving it with wq! now run
yum repolist
Check if you can install any package (say nmap)
yum install nmap -y
Enjoy!!!
Try "searching" for the correct package name in the reps by using yum list
yum list nmap
I guess the correct package name and install command is:
yum install nmap.x86_64
You can also do a "yum search somename"
In my case, I was trying to install OpenJDK using yum; sudo yum install -y java-1.8.0-openjdk-devel but received an error message stating that a dependency was unavailable:
---> Package java-1.8.0-openjdk-headless.x86_64 1:1.8.0.201.b09-1.el6_10 will be installed
--> Processing Dependency: pcsc-lite-devel(x86-64) for package: 1:java-1.8.0-openjdk-headless-1.8.0.201.b09-1.el6_10.x86_64
--> Finished Dependency Resolution
Error: Package: 1:java-1.8.0-openjdk-headless-1.8.0.201.b09-1.el6_10.x86_64 (rhel-6-server-rpms)
Requires: pcsc-lite-devel(x86-64)
**********************************************************************
yum can be configured to try to resolve such errors by temporarily enabling
disabled repos and searching for missing dependencies.
To enable this functionality please set 'notify_only=0' in /etc/yum/pluginconf.d/search-disabled-repos.conf
**********************************************************************
I resolved this by following the suggestion please set 'notify_only=0' in /etc/yum/pluginconf.d/search-disabled-repos.conf and then ran the yum command again. This time yum loaded a bunch of [previously disabled] repos and searched through them, finally reporting success and this message:
*******************************************************************
Dependency resolving was successful thanks to enabling these repositories:
rhel-6-server-optional-rpms
*******************************************************************
So there was no ignored *-devel repo, but still doing this worked. For clearance, the explicitly ignored repos are: ignored_repos=*debug-rpms *source-rpms *beta-rpms
..so that worked, but I'm still no wiser on the mechanics of this..
If you have OS image in your lab or any location you can try this for some RPMS
vim /etc/yum.repos.d/rhel.repo
[rhel]
name=rhel
baseurl=http://172.25.5.25/osimages/rhel7.2_64bit
enabled=1
gpgcheck=0
Then do yum clean all
baseurl is the location where your OS image is available. No subscription is needed, it is reusing your OS image
Try installing using:
yum install nmap-frontend
It worked for me on Red Hat Enterprise Linux Server release 7.7 (Maipo)
You can use the following line to test:
nmap 25 gmail-smtp-in.l.google.com

Resources