Bug 125643 - "rpm -U *.rpm" fails to install new packages if any already installed
Summary: "rpm -U *.rpm" fails to install new packages if any already installed
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm
Version: 4.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-06-09 16:26 UTC by Robert Spearman
Modified: 2022-02-15 01:53 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2004-06-12 13:39:13 UTC
Embargoed:


Attachments (Terms of Use)

Description Robert Spearman 2004-06-09 16:26:23 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1)
Gecko/20030225

Description of problem:
You have a number of rpms in a directory that you want to make sure
are installed and up to date, so you call "rpm -U *.rpm"

However, this will only work if NONE of the rpms are already up to
date.  If any in the upgrade list are already up to date, packages
that aren't already installed are completely ignored!

Behavior should be to upgrade or install all packages as needed.



Version-Release number of selected component (if applicable):
rpm-4.2-0.69

How reproducible:
Always

Steps to Reproduce:
1. Get two rpms, one that is installed [RPM1] and up to date, and
another that isn't installed at all [RPM2].
2. Run "rpm -U [RPM1] [RPM2]"

    

Actual Results:  warning that RPM1 is installed is printed and RPM2 is
NOT installed


Expected Results:  warning that RPM1 is installed, RPM2 installed

Additional info:

Comment 1 Jeff Johnson 2004-06-09 21:22:07 UTC
Try --freshen (or -F) instead of --update (or -U).

Comment 2 Robert Spearman 2004-06-09 22:15:06 UTC
I need to upgrade AND/OR install new packages at the same time.

-freshen does not install new packages, so that won't work.




Comment 3 Jeff Johnson 2004-06-12 13:39:13 UTC
Then you will need to write a shell script to accomplish.

Here's a lightly tested example to get you started:
#!/bin/sh
                                                                     
          
for fn in *.rpm
do
    N="`rpm -qp --qf '%{name}' $fn 2> /dev/null`"
    if rpm -q $N >& /dev/null; then
        echo "$N is already installed,  use rpm -Fvh $fn"
    else
        echo "$N is not installed,      use rpm -Uvh $fn"
    fi
done


Comment 4 Hot Rabattecom 2022-02-15 01:53:40 UTC
The reason for the failure is looking forward to find out. Take a look at https://hotrabatte.com/


Note You need to log in before you can comment on or make changes to this bug.