Yum installs wrong version of package with range requirement - centos

I have a semi-complicated setup with multiple repositories that have the same package in it (with a separate team managing the actual repositories).
During our install we are attempting to install a version that satisfies some range by doing: yum install "my-package < 3.0.0"
That was working fine until last week, installing the largest version that was < 3.0.0 (which was 2.5). However, suddenly it started installing version 2.1.0. Is there a way to check why it started that?
When I do yum --showduplicates list my-package it gets the following, so it seems like it should be available:
Installed Packages
my-package.x86_64 2.1.0-1 #codex-released
Available Packages
my-package.x86_64 0.12.0-1 codex-released
my-package.x86_64 1.0.0-1 codex-released
my-package.x86_64 2.1.0-1 codex-released
my-package.x86_64 2.2.0-1 codex-released
my-package.x86_64 2.3.0-1 codex-released
my-package.x86_64 2.4.0-1 codex-testing
my-package.x86_64 2.4.1-1 codex-released
my-package.x86_64 2.4.2-1 codex-testing
my-package.x86_64 2.5.0-1 codex-testing
my-package.x86_64 2.5.1-1 artifactory-testing
my-package.x86_64 3.0.0-1 artifactory-testing
my-package.x86_64 3.0.0-1 codex-testing
Is there any way to find out why it's not installing that higher version?

I guess that it is because of Epoch. Some tools does not display it at all. Compare:
$ rpm -q nmap
nmap-7.60-7.fc27.x86_64
And you can see it only if you ask for more details:
$ rpm -q --qf "%{epoch}:%{version} %{name}\n" nmap
2:7.60 nmap
$ rpm -qi nmap |grep Epoch
Epoch : 2
But the epoch override the version. See:
$ rpmdev-vercmp 3.0.0 1:2.1.0
3.0.0 < 1:2.1.0

Related

Cannot install Icinga Web 2 on CentOS 8

I have installed Icinga2 on my server, which is running CentOS 8. However, I run into problems when I try and install Icinga Web 2.
When I try and run the command yum -y install icingaweb2 icingacli, CentOS cannot find the packages. The following output is given:
Last metadata expiration check: 0:01:04 ago on Sat 16 Nov 2019 23:22:22 NZDT.
No match for argument: icingaweb2
No match for argument: icingacli
Error: Unable to find a match
It also cannot find the packages centos-release-scl and icingaweb2-selinux.
I've added the Icinga repositories to CentOS manually, including EPEL relase, and they are showing in the yum.repos.d folder. But every time I try and install Icinga Web 2, whether with yum or dnf, I get the same error. I've tried dnf makecache and yum makecache and have updated the packages, but nothing seems to work.
What is going on here?
For install icinga via package management you should add this repo: https://packages.icinga.com/epel/

Listing installed packages with yum and rpm mismatch

How can I efficiently list installed and available packages on Cent OS?
I have already tried yum list installed, which is supposed to output the list of all installed while rpm -qa produces a different result in size.
Which one should I trust? Or am I omitting something?
My understanding is: rpm -qa is better to know what is installed (RPM packages, right! ). Whereas yum is better to know what could be installed and find required dependencies. It is usually fine to use yum for both purposes.
I tested on a CentOS 7 system. They have almost identical list, except that rpm also reports some gpg-pubkey pseudo packages (try rpm -qa gpg-pubkey\*).
If you want to compare the lists on your system, first get the rpm's list:
$ rpm -q -a --qf '%{NAME}\t%{ARCH}\t%{VERSION}\t%{RELEASE}\n' | sort > /tmp/rpm-qa.lst
Then extract YUM's list (using repoquery which is part of package yum-utils:
$ repoquery -q -a --installed --qf '%{NAME}\t%{ARCH}\t%{VERSION}\t%{RELEASE}' | sort > /tmp/repo-qa.lst
Then compare:
$ diff -u0 /tmp/rpm-qa.lst /tmp/repo-qa.lst
--- /tmp/rpm-qa.lst 2015-03-08 16:07:38.297325253 +0100
+++ /tmp/repo-qa.lst 2015-03-08 16:07:43.281438369 +0100
## -143,1 +142,0 ##
-gpg-pubkey (none) 352c64e5 52ae6884
(See also question https://unix.stackexchange.com/q/190203/16640)
Both commands works in the same way only difference is 'yum list installed' output maybe bigger than 'rpm -qa' because yum will show package dependencies also in its output.
While installing a package using rpm, we need to manually install the dependencies whereas yum will do that automatically. So in this case if you want to list the packages only use, 'rpm -qa' or if you need to list all the packages and dependencies associated with it use 'yum list installed'

Cannot update kernel-devel in CentOS 6.5

First of all I want to note that I am booting CentOS from a flash drive (if it matters).
Now I am trying to install Nvidia drivers for my GPU but the problem is that I must update kernel-devel first. I did the following:
yum update
yum install kernel-devel kernel-headers gcc make
yum -y upgrade kernel kernel-devel
After that I checked which kernel I am using:
uname -r
Which gave me this: 2.6.32-431.el6.x86_64
Then I did: rpm -q kernel-devel , with the following result: kernel-devel-2.6.32-504.el6.x86_64
I tried to upgrade again, but it said "No Packages marked for Update
"
When I tried to install the kernel again, it said that I already have installed the latest version:
Package kernel-devel-2.6.32-504.el6.x86_64 already installed and latest version
Package kernel-headers-2.6.32-504.el6.x86_64 already installed and latest version
Package gcc-4.4.7-11.el6.x86_64 already installed and latest version
Package 1:make-3.81-20.el6.x86_64 already installed and latest version
Nothing to do
I am confused and I don't know how to make the lates kernel active, so I can install my Nvidia drivers.
Usually which kernel to use is selected via grub at boot time. If you have both installed its most likely that grub is still starting the older kernel.
You can look at /etc/grub.conf to make sure "default" is set to what you would expect. Default is 0 keyed off the "Title" entry.
Did you reboot? most of the time the latest kernel is set to default in grub.conf and a reboot is all you need.
Also https://serverfault.com/a/623755 might be the answer.

how to upgrade libvirt?

I'm trying to install openstack on RHEL 6.2. Following installation guide from openstack.org, I'm using the command:
yum install openstack-nova openstack-glance
After resolved many dependencies, I got the final error:
Error: Package: openstack-nova-compute-2012.2.2-1.el6.noarch (epel)
Requires: libvirt >= 0.9.6
Installed: libvirt-0.9.4-23.el6.x86_64 (#anaconda-RedHatEnterpriseLinux-201111171049.x86_64/6.2)
libvirt = 0.9.4-23.el6
I installed libvirt 0.9.4 from the RHEL 6.2 DVD, but it seems I have to upgrade libvirt 0.9.6. How to do the upgrade? Or where can I download libvirt 0.9.6 rpm? Or can I use yum to upgrade libvirt?
You could try searching for the RHEL6 or CentOS 6 rpms from
http://rpm.pbone.net/index.php3?stat=3&limit=1&srodzaj=1&dl=40&search=libvirt&dist[]=74&dist[]=79&dist[]=0&field[]=1&field[]=2
Also, it looks like libvirt has got a lot of dependencies, so after downloading the appropriate libvirt-0.9.xxx.rpm, you could try
yum localinstall libvirt-0.9.xxx.rpm
if even after that you have some dependencies missing, you might want to download them manually like the libvirt rpm itself, managing which can soon start to become a nightmare!

libjansi issue when trying to install Scala on Ubuntu 10.04

when i do
apt-get install scala
The following packages have unmet dependencies. scala: Depends:
libjansi-java but it is not installable E: Broken packages
Though when I do apt-cache show scala I get
Architecture: all Version: 2.7.7.dfsg-4ubuntu1 Depends: scala-library
(= 2.7.7.dfsg-4ubuntu1), openjdk-6-jre | java6-runtime Filename:
pool/universe/s/scala/scala_2.7.7.dfsg-4ubuntu1_all.deb
That seems a very very old Scala included in the default repository.
Follow these instructions to install the Typesafe Stack with all the goodies. This is the official distribution of Scala and related tools.
You could try:
sudo apt-get -f install
without any package names
scala : Depends: libjansi-java but it is not installed
If you recently installed Scala and Java Background Processing is running wait for some time 10-20 mints and use
sudo apt-get update
and after this time interval you can try to install whatever you wanted this dependency issue resolve automatically. its works