0

I have a gitlab pipeline where I will be installing latest rpm everytime.

Some times, even if the target machine is changed manually, the rpm should be installed successfully.

But some how I am getting below error.

Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Ignored option -q, -v, -d or -e (probably due to merging: -yq != -y -q)
605133599.rpm                                                                                    | 124 kB  00:00:00
Examining /var/tmp/yum-root-RG0U7M/605133599.rpm: myproject-nightlye2e-1.x86_64
/var/tmp/yum-root-RG0U7M/605133599.rpm: does not update installed package.
Error: Nothing to do

So even if the machine is having not installed any version or older/latest/same version installed, when I ran below yum install with an rpm file, it should force install or update.

yum install -yq rpmfilepath

How to do that?

Please suggest.

2
  • First of all: Did you read and understand the error message? Ignored option -q, -v, -d or -e (probably due to merging: -yq != -y -q)
    – reichhart
    Aug 4, 2022 at 19:13
  • 2
    Second: Did you read and understand the second message? does not update installed package
    – reichhart
    Aug 4, 2022 at 19:14

2 Answers 2

0

If you satisfy all the package prerequisites you can run command like:

rpm -U package.rpm

to force install the package even if it is installed.

5
  • a) He is using yum. b) "Satisfying prerequisites" and after that running rpm doesn't make sense. For this we have yum/dnf. c) Your answer does not address his issues or explain what he is doing wrong.
    – reichhart
    Aug 4, 2022 at 19:42
  • @reichhart, do you know yum is based on rpm? It make, I talk about required prerequisites. I give solution, for the rest there are manuals. Aug 5, 2022 at 4:04
  • Why do you think that I wrote that using rpm after "satisfying prerequisites" doesn't make sense? I understood "prerequisites" as dependant packages. A single RPM command is not a generic solution because if in future new package versions will require additional dependant packages which are not installed then your command will fail. Hence better use yum. BTW - I create RPM packages since mid 90s and run different public yum repos for more than 15 years.
    – reichhart
    Aug 5, 2022 at 7:18
  • 1
    BTW - -F does not force. It does "freshen" and hence won't install the package if there is no older version.
    – reichhart
    Aug 5, 2022 at 10:58
  • @reichhart, correct. Will update my answer Aug 5, 2022 at 11:45
-1

Do not merge options when using yum. Simply use this command:

yum install -y rpmfilepath >/dev/null

The reason why I am using >/dev/null amd not -q here is that it won't suppress messages about installed dependencies. Example:

# yum install -y -q rpmfilepath 

Installed:
  glibc-2.31-6.fc32.i686   libgcc-10.3.1-1.fc32.i686   rpmfilepath                                                        

If it is really required (e.g. in case of downgrades) then you can afterwards simply run

# rpm -U --force rpmfilepath

yum would have installed the dependencies and after that you can --force (=--replacepkgs --replacefiles --oldpackage) the installation with rpm.

3
  • the first message is just warning to use -y instead of -yq. But the installation is not getting updated, I need to force update exiting installation
    – Kalel
    Aug 5, 2022 at 10:00
  • any command to update the package even if new/old/same version installed.
    – Kalel
    Aug 5, 2022 at 10:01
  • There is no force in yum like it is in rpm. The question is: Why would you want to "force" the installation of a package which is already installed? What do you want to achieve?
    – reichhart
    Aug 5, 2022 at 10:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .