RPM pre/post/pre-un/post-un and behavior of $1
Amol P
apuranik.2010 at gmail.com
Tue Aug 17 03:28:55 UTC 2010
Thanks for the reply.
regarding $1=3, we are using --force in observation #3 and #4, but there we
won't find any $1=3?
On 16 August 2010 15:02, Panu Matilainen <pmatilai at laiskiainen.org> wrote:
> On Mon, 16 Aug 2010, Amol P wrote:
>
> Hi all,
>> Please have a look of RPM installation output when carried out for two
>> diff version one after the another. The Installed version is obtained by
>> "rpm -qa | grep mypkg" to check the version which got installed after any
>> rpm -i/-U comand.
>>
>>
>> --------------------------------------------------------------------------------
>> ----------
>> #1 rpm -Uvh mypkg-2010.05.1.18.noarch.rpm
>> -PRE-IN:$1=1
>> -POST-IN:1=1
>> -Installed Version: mypkg-2010.05.1.18.noarch
>>
>> --------------------------------------------------------------------------------
>> ----------
>> #2 rpm -Uvh mypkg-2010.05.2.2.noarch.rpm
>> - PRE-IN:$1=2
>> - POST-IN:$1=2
>> - PRE-UN:$1=1
>> - POST-UN:$1=1
>> - Installed Version: mypkg-2010.05.2.2.noarch
>>
>> --------------------------------------------------------------------------------
>> ----------
>> #3 rpm -Uvh mypkg-2010.05.2.2.noarch.rpm --force
>> - PRE-IN:$1=2
>> - POST-IN:$1=2
>> - Installed Version: mypkg-2010.05.2.2.noarch
>>
>> --------------------------------------------------------------------------------
>> ----------
>> #4 rpm -ivh mypkg-2010.05.1.18.noarch.rpm --force
>> - PRE-IN:$1=2
>> - POST-IN:$1=2
>> - Installed Version: mypkg-2010.05.1.18.noarch, mypkg-2010.05.2.2.noarch
>>
>> --------------------------------------------------------------------------------
>> ----------
>> #5 rpm -ivh mypkg-2010.05.2.2.noarch.rpm --force
>> - PRE-IN:$1=3
>> - POST-IN:$1=3
>> - Installed Version: mypkg-2010.05.1.18.noarch, mypkg-2010.05.2.2.noarch
>>
>> --------------------------------------------------------------------------------
>> ----------
>>
>> In observation #4, why both versions are in RPM database. Any other way
>> by which we can remove the higher version package when we are trying to
>> install/update the lower version package
>>
>
> Because you're installing, not upgrading. Rpm permits several versions of a
> single package to be installed simultaneously if you install instead of
> upgrading (typically used for the kernel package).
>
>
> In observation #5, a new player comes in $1=3. Is it new feature or
>> some strange.
>>
>
> It's basically an artifact of using --force.
>
>
> Also, how to remove the newer package & its installed stuff, when I am
>> trying to install/update a LOWER version package forcefully. Is it
>> possible or some tweaking required?
>>
>
> If you're using rpm cli to do the job, you can use --oldpackage to tell rpm
> to downgrade:
>
> [root at dhcp102 noarch]# rpm -Uvh foo-0.2-1.noarch.rpm
> Preparing... ###########################################
> [100%]
> 1:foo ###########################################
> [100%]
> [root at dhcp102 noarch]# rpm -q foo
> foo-0.2-1.noarch
> [root at dhcp102 noarch]# rpm -Uvh --oldpackage foo-0.1-1.noarch.rpm
> Preparing... ###########################################
> [100%]
> 1:foo ###########################################
> [100%]
> [root at dhcp102 noarch]# rpm -q foo
> foo-0.1-1.noarch
>
> The more generic answer though: use an epoch to override the normal version
> comparsion, making the older package "win" the version comparison, so
> regular update without special cli-switches will work.
>
> - Panu -
> _______________________________________________
> Rpm-list mailing list
> Rpm-list at lists.rpm.org
> http://lists.rpm.org/mailman/listinfo/rpm-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-list/attachments/20100817/6c4e19a9/attachment.html>
More information about the Rpm-list
mailing list