Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

is there a way to ignore rpm version conflicts by keeping the latest version installed?

For example. I want to install gawk in AIX. I have all the required rpms in a folder

bash-4.2-11.aix5.1.ppc.rpm
gawk-4.0.2-1.aix5.1.ppc.rpm
gettext-0.10.40-8.aix5.2.ppc.rpm
info-4.13a-2.aix5.1.ppc.rpm
libsigsegv-2.10-1.aix5.2.ppc.rpm
readline-6.2-4.aix5.1.ppc.rpm

I try to install them with rpm giving rpm -ivh *.rpm so that rpm will automatically take care of the installation order.

But I get:

package bash-4.2-11 is already installed
package gettext-0.17-7 (which is newer than gettext-0.10.40-8) is already installed
package info-5.0-1 (which is newer than info-4.13a-2) is already installed
package readline-6.2-4 is already installed
file /opt/freeware/bin/msgcomm from install of gettext-0.10.40-8 conflicts with file from package gettext-0.17-7
file /opt/freeware/bin/msgfmt from install of gettext-0.10.40-8 conflicts with file from package gettext-0.17-7
file /opt/freeware/bin/msgmerge from install of gettext-0.10.40-8 conflicts with file from package gettext-0.17-7
file /opt/freeware/bin/msgunfmt from install of gettext-0.10.40-8 conflicts with file from package gettext-0.17-7
file /opt/freeware/bin/ngettext from install of gettext-0.10.40-8 conflicts with file from package gettext-0.17-7
file /opt/freeware/bin/xgettext from install of gettext-0.10.40-8 conflicts with file from package gettext-0.17-7
file /opt/freeware/lib/libintl.a from install of gettext-0.10.40-8 conflicts with file from package gettext-0.17-7
file /opt/freeware/bin/gettext from install of gettext-0.10.40-8 conflicts with file from package gettext-0.17-7
file /opt/freeware/bin/msgcmp from install of gettext-0.10.40-8 conflicts with file from package gettext-0.17-7
file /opt/freeware/share/locale/locale.alias from install of gettext-0.10.40-8 conflicts with file from package gettext-0.17-7
file /opt/freeware/info/info-stnd.info.gz from install of info-4.13a-2 conflicts with file from package info-5.0-1
file /opt/freeware/info/info.info.gz from install of info-4.13a-2 conflicts with file from package info-5.0-1
file /etc/X11/applnk/Utilities/info.desktop from install of info-4.13a-2 conflicts with file from package info-5.0-1
file /opt/freeware/man/man1/info.1 from install of info-4.13a-2 conflicts with file from package info-5.0-1
file /opt/freeware/man/man1/infokey.1 from install of info-4.13a-2 conflicts with file from package info-5.0-1
file /opt/freeware/man/man1/install-info.1 from install of info-4.13a-2 conflicts with file from package info-5.0-1
file /opt/freeware/man/man5/info.5 from install of info-4.13a-2 conflicts with file from package info-5.0-

So, is there a way to ignore the gettext and info conflict by just doing nothing? I don't want to use force and replace them with older versions.

I know that if I try to install the rpms manually one-by-one without installing the gettext and info rpms the installation of gawk will succeed.

I want to find a solution which doesn't involve me manually installing the rpms in the correct order.

edit: I have true -Uvh The problem with rpm -Uvh *.rpm is that instead of installing the new rpm binaries by resolving their dependencies with the ones that are already installed or in the folder, it just outputs:

package gettext-0.17-7 (which is newer than gettext-0.10.40-8) is already installed
package info-5.0-1 (which is newer than info-4.13a-2) is already installed
package readline-6.2-4 is already installed

and it stops without progressing to the other rpms that need to be installed. I believe this is not a normal behavior and I don't know if this has to do with a problem in rpm (I am using an old version - version 3).

share|improve this question
    
Have you tried RPM's "freshen" option? E.g. rpm -Fvh *.rpm –  Fred Clausen Jul 11 '13 at 17:25

3 Answers 3

Since you are updating existing packages, rather than exclusively installing packages, you need to use the update option -U instead of the install option -i. This will allow you to both install and update packages at once.

rpm -Uvh *.rpm
share|improve this answer
    
I have tried -Uvh but when an already installed version of an rpm dependency exists it does not progress to install the new rpms. (see my edit) –  Cobra Kai Dojo Jul 12 '13 at 12:34
    
@Haros Why are you trying to install older versions of packages you already have installed? Just skip them. –  Michael Hampton Jul 12 '13 at 17:21
    
I don't try, but by using *.rpm they are automatically taken as input. Of course I can delete them and rerun the command but I was hoping that rpm was smart enough to avoid this. –  Cobra Kai Dojo Jul 12 '13 at 17:33
    
RPM has very little dependency solving capability; this is generally handled at a higher level by a front end (such as yum). If you're using rpm itself, you get to handle this yourself. –  Michael Hampton Jul 12 '13 at 17:41

You don't specify, but it looks like you are using Michael Perzl's RPMs.

If this is the case, follow the instructions in the FAQ to:

  1. download all the dependencies
  2. use gettext-0.17 to avoid known errors when using gettext-0.10
  3. it is safer to use the latest versions available, so replace the existing packages with the new ones when installing using rpm -Uvh.
share|improve this answer
    
I indeed use Perzl's binaries. I did what he proposes in his faq with gettext but still when I use -Uvh it stops when it detects that there is an already installed version of an rpm or a newer version isntalled and it does not progress to install the new ones (see my edit). –  Cobra Kai Dojo Jul 12 '13 at 12:32
    
Add the --force flag –  dawud Jul 12 '13 at 12:42
    
but if I use *.rpm and there is an older version of an already installed rpm in the folder, with --force the older version will replace the new one already installed. –  Cobra Kai Dojo Jul 12 '13 at 13:02
    
Why would you ever want to install an older version at all? –  dawud Jul 12 '13 at 13:43
    
That's what I am saying. With --force if any old rpms exist in the directory it will isntall them and I don't want to do that. –  Cobra Kai Dojo Jul 12 '13 at 14:09

So,

I am posting here my partial answer because I think my main question may be a little bit misleading.

The rpm -Uvh *.rpm is the way to go. It updates packages that are already installed with a new version of the packages in a folder and it also installs new rpms that are not already installed in the system.

But! When you try to install rpms using rpm -Uvh *.rpm if a package in the folder is the same version or older than a package already installed then it doesn't continue with the execution. The command just outputs which packages are already installed and stops there without proceeding to the installation of the other rpms.

I consider this as a buggy behavior of the old rpm I am using (version 3). I don't know if this is considered normal and if it happens also in the latest version of rpm. Maybe you can provide more info on that.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.