How to ignore conflicts in rpm installs - linux

I have a bunch of rpm files in a folder. I am trying to install them using:
rpm -ivh *.rpm so rpm can take care of the correct installation order.
On some of these rpms I have a newer version installed in my system so I get for example:
package info-5.0-1 (which is newer than info-4.13a-2) is already installed
/opt/freeware/man/man1/infokey.1 from install of info-4.13a-2 conflicts with file from package info-5.0-1
Is there a way to ignore the old .rpm file and resolve the dependency with the new version that is already installed? I thought of the --force option. But how --force resolves the conflicts? Overwrites them with the older version or just ignores them leaving the new version?
Any thoughts are welcome.

The --force option will reinstall already installed packages or overwrite already installed files from other packages. You don't want this normally.
If you tell rpm to install all RPMs from some directory, then it does exactly this. rpm will not ignore RPMs listed for installation. You must manually remove the unneeded RPMs from the list (or directory). It will always overwrite the files with the "latest RPM installed" whichever order you do it in.
You can remove the old RPM and rpm will resolve the dependency with the newer version of the installed RPM. But this will only work, if none of the to be installed RPMs depends exactly on the old version.
If you really need different versions of the same RPM, then the RPM must be relocatable. You can then tell rpm to install the specific RPM to a different directory. If the files are not conflicting, then you can just install different versions with rpm -i (zypper in can not install different versions of the same RPM). I am packaging for example ruby gems as relocatable RPMs at work. So I can have different versions of the same gem installed.
I don't know on which files your RPMs are conflicting, but if all of them are "just" man pages, then you probably can simply overwrite the new ones with the old ones with rpm -i --replacefiles. The only problem with this would be, that it could confuse somebody who is reading the old man page and thinks it is for the actual version. Another problem would be the rpm --verify command. It will complain for the new package if the old one has overwritten some files.
Is this possibly a duplicate of https://serverfault.com/questions/522525/rpm-ignore-conflicts?

From the context, the conflict was caused by the version of the package.
Let's take a look the manual about rpm:
--force
Same as using --replacepkgs, --replacefiles, and --oldpackage.
--oldpackage
Allow an upgrade to replace a newer package with an older one.
So, you can execute the command rpm -Uvh info-4.13a-2.rpm --force to solve your issue.

Try Freshen command:
rpm -Fvh *.rpm

Related

Yum doesn't show all installed packages

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.

Linux Installation libX11-devel

I am trying to build QT4 (porting from Redhat 5 to 7 with an upgraded gcc compiler) in RedHat 7 and I was getting an error saying X11/Xlib.h can't be found. Anyways, after doing some research most people said to install libX11-devel to get those x11 libraries. Since I am using an offline machine I can't do "apt-get" type commands and have to manually install RPMs. So, I went to my RH-7 installation DVD and got "libX11-devel-1.6.3-3.el7.x86-64" (I have 64 bit OS) and tried to install using "yum install libX11-devel-1.6.3-3.el7.x86_64" and I am getting dependencies errors. It's saying
...Requires: pkgconfig(kbproto)
...Required: pkgconfig(xcb)
...Requires: pkgconfig(xproto)
...Requires: pkgconfig(xcb) >= 1.1.92
So, here are my questions.
1) when it says "pkgconfig(kbproto)", is it saying find the "kbproto....RPM" and do a "yum install". In my dvd I only have "xorg-x11-proto-devel-7.7.13.el7.noarch.rpm". Do I have to somehow find "xorg-x11-proto......x86_64.rpm" since it's a 64 bit machine?
2) Is there a difference between "yum install" and pkgconfig "install"? Are there any other installation variants in Linux?
3)For an offline machine, Is there anyway I can get all the dependencies and install everything at once ?
4) Why is it saying "xcb" requires twice. If I just get a xcb...rpm version above 1.1.92 can I just install it once?
Before actually answering the questions, I am going to suggest to see if you can get the latest version of the packages. The packages on the installation DVD may be really out of date and contain known vulernabilities, and other bugs. Can you use yumdownloader - in an online environment - to download the latest version onto a separate DVD and use that as the installation source? See https://access.redhat.com/solutions/10154 for more information.
To answer the questions themselves:
Requires: foo can refer to a package foo or a "feature" foo. pkgconfig(kbproto) is a "feature" (or virtual requires). You can use yum/rpm to see what provides this. On my Fedora box, for example, rpm -q --provides xorg-x11-proto-devel shows that this package indeed provides pkgconfig(kbproto).
As for x86_64 vs noarch, it doesn't matter. noarch packages work everywhere. Other packages are restricted to the platform. So x86_64 only works on intel/amd x86 64-bit machines. Installing noarch should be fine in your case. If you only had a i686 package, though, that wouldn't be sufficient. You would have to find a x86_64 or noarch package.
Yes, there's a big difference between yum and pkg-config. They do completely different things. One is a system tool for installing RPM packages. The other is a tool for developers for using the right headers and compiler flags. If your concern is finding/installing RPMs, do not use pkg-config directly.
Do you have access to an online machine that can access the RHEL 7 yum repositories? On that machine, do something like this:
mkdir rhel7-packages
cd rhel7-packages
yum provides '*/X11/Xlib.h' # make a note of the package that provides this file. it's libX11-devel on Fedora here
yumdownloader --resolve libX11-devel # download libX11-devel and all dependencies not installed on the system
Then copy/install the RPMs on the machine without internet access.
It's probably printing out xcb twice because it's two different requirements. The unversioned requirement will be satisfied if you install any verison of xcb. The versioned requirement will only be satisfied if you install 1.1.92. If you install 1.1.92, it will satisified both the requirements.
1.
You have to resolve the dependency on the system where you are building your package. This means you need to have those dependencies installed, inclusing libX11-devel. To do that, download the RPMs manually from EL7 repos to local disk and run this:
$ mkdir -p /tmp/libX11_dep_rpms && cd /tmp/libX11_dep_rpms
# Download all dependencies from here. All your packages should be available here:
# http://mirror.centos.org/centos-7/7/os/x86_64/Packages/
# Then install
$ yum localinstall *.rpm
# After this you should be able to build your qt4 package, provided all dependencies are resolved. Otherwise, repeat the procedure for all dependencies
# If you can't download packages, then you need to create a FULL DVD ISO that will contain all packages.
2.
pkgconfig ensures that a requirement is coming from a particular build that provides a particular version of the library. Here are some detail.
3.
Get the Everything ISO from EL7.
4.
This has to do with the pkgconfig and library versions.

how to backup a installed rpm package in redhat?

I was install a package by rpm command in redhat, but the package is failure now.
I want create a new package from installed package.
what can I do?
This command would help you in that,
rpm -Fvh –repackage rpm-file-name.rpm
Here rpm-file-name.rpm is an existing package in Linux which will be repackage by using above option.
From man page of rpm;
–repackage Re-package the files before erasing.
–replacefiles Install the packages even if they replace files from
other, already installed, packages.
–replacepkgs Install the packages even if some of them are already
installed on this system.
rpmrebuild is built for re-creating RPM package files from already installed packages. There are options which allow you to tailor the packaging, but the most simple invocation just produces an RPM file from an installed package. Example: rpmrebuild coreutils

Disable yum transaction check for file conflict

How do I disable yum transaction check for a file ?
Transaction check error:
file /usr/local/xenco/backend/current from install of xenco-rr-1.9.6-104.x86_64 conflicts with file from package xenco-server-1.9.6-104.x86_64
Replacing files from another RPM package is bad idea in most cases and I strongly advise against what you're trying to do. That said, apply following at your own risk.
Yum does not provide an option to install conflicting files, I think. However, that does not prevent you from installing a RPM package with rpm(1) which does provide an option to override existing files from another package, namely --replacefiles.
So, first get the RPM of the package you want to install on a local filesystem (/usr/local/xenco... makes me suspect that is the case already). Next install the RPM with rpm -i --replacefiles <your_rpm_file>.
This method worked for me, when I faced similar issue
Simply get the existing package with below command
rpm -qa | grep xenco
Remove those conflicting package with
yum remove packageNameFromTheList
what i always do is remove the package that is on the right hand side. In your case it would be -
yum remove xenco-server-1.9.6-104.x86_64
yum remove <> can work with any package error, i have encountered many such transactions errors when working on vm on cloud, i always remove the package that causes conflicts and always has worked for me.
My two cents:
yum erase ${old_package}
yum install ${new_package_with_same_files}
The exclusion of --replacefiles is intentional. Yum is a package manager, let it manage the packages.
(This answer adds a yum-only solution to the accepted answer.)

How to specify dependency location in rpm?

While installing Mono using RPM, GLIBC_2.16 is listed as a dependency. Since I'm having an older version of glibc, and didn't want to corrupt my kernel, i installed the newer glibc from sources in my home folder.
I now want the RPM to refer to this newer glibc lib directory in my home folder while installing mono. What is the RPM option for mentioning dependency locations for a package?
I am currently using the following RPM command:
sudo rpm -ivh mono-core-3.2.3-0.x86_64.rpm
I get the following error messages:
libc.so.6(GLIBC_2.14)(64bit) is needed by mono-core-3.2.3-0.x86_64
libc.so.6(GLIBC_2.15)(64bit) is needed by mono-core-3.2.3-0.x86_64
libc.so.6(GLIBC_2.16)(64bit) is needed by mono-core-3.2.3-0.x86_64
My newer glibc path is:
~/Desktop/glibc/glibc1/lib
What option should i include in rpm to reference this path while installing mono?
Thanks
I guess there is no way to install the package without --nodeps unless you install the proper version of glibc in your system.
If your goal is to run mono command completely, it may work fine by the following steps.
Installing the package by adding the --nodeps option to rpm command to ignore any dependencies.
Running mono-related commands with LD_LIBRARY_PATH set to /your/alternative/path/to/glibc.
However, I think that the best solution is to build the mono's source on your machine.

Resources