Yum doesn't show all installed packages - linux

I have logstash installed on one of my CentOS 7 hosts. When I run the sudo yum list installed command, it is not on the list. When I try to install logstash, yum offers me a fresh install. What could be the reason for this behavior?

Probably logstash was installed manually then, and not by yum/rpm. You can check this by asking rpm (which is used by yum under the hood):
rpm -qf /path/to/logstash-binary
translation: to which package does /path/to/logstash-binary belong. Then you'll know if it belongs to an rpm package. If not, that means the binary was installed in some other way (unzipping, ...). rpm (and hence yum) has no knowledge of any files not installed by an rpm package.

Related

RPM package requirements in a special order

I am facing the problem, that I need to install two other RPM's in a special order before installing myRPM.
In detail in my RPM I install some config files for sudo and ldap. So, I need these packages to be installed first Requires(pre). Although the pre required package sudo has a required file in /usr/bin/.
This file will be installed with the ldap package.
So, I need the ldap package to be installed first, then sudo and at least myRPM.
My spec file has:
Requires(pre): myldap_rpm sudo
But yum is not going to install the package because sudo needs ldap first. Yum seems to check the dependencies of the pre-required sudo package before installing myldap_rpm
Is there any chance to resolve this???
Thanks a lot in advance for sharing your ideas and knowledge.
requires(pre) is a scriptlet dependency. This means that dependency (eg sudo) is only required to run the %pre script. When your package is installed sudo can then safely be uninstalled. This is not what you want here.
Afaik you cannot change the dependencies of other packages. You can tell what your package depends on, and those dependencies will be installed before your package, but you cannot insert a myldap_rpm dependency to sudo.
Probably you don't need to reinstall sudo though, probably it would suffice to run some kind of "reload" or "configuration" step after the installation of myldap_rpm.

from where rpm query search and from where yum list search

I did rpm -qa and didn't found the package but when when I did yum list I found the package. why so and which command is useful in finding the installed packages in Linux?
I personally don't use yum or rpm to handle package management on my machine (running Debian 10 currently with XFCE) but I use the command apt list --installed to check my installed packages. Then you can grep for whatever specific stuff you are looking for.
You could also check out this article. It's well written and has a lot of good info.
https://itsfoss.com/list-installed-packages-ubuntu/

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.

xz compression install on centos

Any installation or update using yum command I ended up error: Error: xz compression not available. On website I read that Python library is missing. When you try to install a library (sudo yum update pyliblzma) again failed with error. Do not know how? Thanks.
This problem comes if you installed a wrong epel release on your machine. If so, then you need to remove the epel release by
yum remove epel-release
Sometimes that is not enough, you need to remove the cache as well by:
rm -rf /var/cache/yum/x86_64/6/epel
Then you can install the epel-release again
yum -y install epel-release
You need install the EPEL repository by downloading the appropriate RPM package for your system and installing it. For example, for CentOS and Red Hat Enterprise Linux 6.x:
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo rpm -Uvh epel-release-6*.rpm
If you get a File Not Found error message when trying to download the package, the version number might have changed. You can access the latest version of the RPM installer from the Fedora EPEL wiki page. The wiki page also includes additional instructions for Red Hat Network subscribers who are installing the EPEL repository.
Finally, install the Python library:
yum install pyliblzma
This works perfecly in my CentOS 6.x.
I've found a solution on this page of stackexchange, working in CentOS 6.X:
https://unix.stackexchange.com/a/314756
sudo rpm -e epel-release-7-5.noarch
wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo rpm -ivh epel-release-6-8.noarch.rpm
sudo yum clean all
sudo rpmdb -v --rebuilddb
sudo yum -y install libselinux-python
I was also suffering from this issue..
If you are installing packages but it is already available on your system.
Remove existing packages and then try to install new.
It will work properly...
I was able to solve this problem by installing pyliblzma using rpm instead of yum as yum is not working.
Find pyliblzma rpm package according to your architecture and install it using the command.
rpm -Uvh pyliblzma-version-release.architecture.rpm
I used the following command to install pyliblzma for my 64 bit Redhat 6.8 machine. Please check URL in the command and make changes accordingly.
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/pyliblzma-0.5.3-3.el6.x86_64.rpm
In my case the issue was caused by missing modules in python's site-packages directory. Here's what I did:
$ rpm -Va
to get a list of all files belonging to all rpms that do not verify. I got a bunch of messages about missing modules:
missing /usr/lib64/python2.7/site-packages/...
Luckily, I had an identical CentOS version elsewhere with all these packages present, so I just copied them over and ran
$ rpmdb -v --rebuilddb
to rebuild rpm database.

Installing RPM Dependencies

I am trying to install dbus-1.1.2-12.el5.i386 but I get the error
" dbus-libs = 1.1.2-12.el5 is needed by dbus-1.1.2-12.el5.i386" :-(
So I downloaded "dbus-libs-1.1.2-12.el5.i386.rpm" in the same directory and ran the
command rpm -ivh dbus-1.1.2-12.el5.i386 again, but I still got the same error. On searching on Forums I found that RPM takes care of dependecies if they are present in the same Directory. but it does not work with -ivh option ??
Steve B is correct:
yum install dbus-libs
yum install dbus
yum will also allow you to do "whatprovides" for a package:
yum whatprovides dbus-libs
This will show you if you have another version of dbus-libs "installed" on your system, it spools out what repos provide the package and is any are provided (installed) locally.
Also helpful is:
rpm -q dbus
which will show any packages that are locally install as will:
rpm -q dbus-libs
or
rpm -qa | grep 'dbus'
You may find that you already have an eariler version of dbus installed, which case:
yum -y update dbus
Hope this helps.
http://www.of-networks.co.uk
You need to install the dependant RPMs before installing dbus. You should also know that this is the hard way, these days RPM-based distributions usually have a dependancy managment system so that you don't need to do this by hand. e.g. on Redhat/Fedora/Centos you can just type "yum install mypackagename".

Resources