View Full Version : Rpm
anishnath
10th May 2011, 09:40 AM
i'm having a spec file task is to build the rpm package with the appripriate version number, the problem what i'm facling is while the building up the source code if the version number changes rpm -U is not upgarding instead of installing it as a new one.
For ex: rpm -qa | grep test
test-4.2-01.i386
rpm -Uvvh test-4.2-02.i386
rpm -qa | grep test
it shows the both
test-4.2-01.i386
test-4.2-02.i386
aesir
10th May 2011, 10:08 AM
how do you set the version number?
please post the output of "rpm -qi test-4.2 test-4.1" and the spec file
anishnath
10th May 2011, 10:18 AM
in the spec file i'm specifyin the version number
%define version 4.2
%define release 01
Version: %{version}
Release: %{release}
Summary: Test
Name: test
License: test
Group: Applications/System
Distribution: test 4.2
Vendor: test
Prefix: /opt/test
Prefix: /var/test
# turn off auto dependancy checking
AutoReqProv: no
%description
RPM build Example
%prep
%build
%install
%clean
.......
.................................................. .
---------- Post added at 09:18 AM ---------- Previous post was at 09:18 AM ----------
In general if we perform rpm -U the earlier version will be deleted and new one get updated ?
aesir
10th May 2011, 10:33 AM
in the spec file i'm specifyin the version number
%define version 4.2
%define release 01
Version: %{version}
Release: %{release}
Summary: Test
Name: test
License: test
Group: Applications/System
Distribution: test 4.2
Vendor: test
Prefix: /opt/test
Prefix: /var/test
# turn off auto dependancy checking
AutoReqProv: no
%description
RPM build Example
%prep
%build
%install
%clean
.......
.................................................. .
---------- Post added at 09:18 AM ---------- Previous post was at 09:18 AM ----------
In general if we perform rpm -U the earlier version will be deleted and new one get updated ?
yes with rpm -U the earlier version is deleted. For same reason rpm sees the packages as different, look at the output of rpm -qi for the differences between the two packages. The spec seams ok to me
anishnath
10th May 2011, 10:38 AM
[root@aninath-lnx bacc]# rpm -qi test-4.2-02.i386
Name : test Relocations: /opt/test /var/test
Version : 4.2 Vendor: test
Release : 02 Build Date: Tue 10 May 2011 01:24:40 AM PDT
Install Date: Tue 10 May 2011 01:46:16 AM PDT Build Host: aninath-lnx
Group : Applications/System Source RPM: test-4.2-02.src.rpm
Size : 48513857 License: test
Signature : (none)
Summary : Test
Description :RPMbuild Example
[root@aninath-lnx bacc]# rpm -qi test-4.2-01.i386
Name : test Relocations: /opt/test /var/test
Version : 4.2 Vendor: test
Release : 01 Build Date: Tue 10 May 2011 01:21:06 AM PDT
Install Date: Tue 10 May 2011 01:44:38 AM PDT Build Host: aninath-lnx
Group : Applications/System Source RPM: test-4.2-01.src.rpm
Size : 48505407 License: test
Signature : (none)
Summary : Test
Description :RPMbuild Example
aesir
10th May 2011, 10:50 AM
I don't know, I don't see the reason why it is not working
anishnath
10th May 2011, 11:23 AM
rpm -Uvvh install/Linux/obj_lnx/rpm/RPMS/i386/test-4.2-02.i386.rpm
D: ============== install/Linux/obj_lnx/rpm/RPMS/i386/test-4.2-02.i386.rpm
D: Expected size: 29871144 = lead(96)+sigs(180)+pad(4)+data(29870864)
D: Actual size: 29871144
D: install/Linux/obj_lnx/rpm/RPMS/i386/test-4.2-02.i386.rpm: Header SHA1 digest: OK (e8733af0f93adf2be178d4c556778e17ba2bdc23)
D: opening db environment /var/lib/rpm/Packages joinenv
D: opening db index /var/lib/rpm/Packages rdonly mode=0x0
D: locked db index /var/lib/rpm/Packages
D: opening db index /var/lib/rpm/Name rdonly mode=0x0
D: read h# 1387 Header SHA1 digest: OK (89a61ccfa0d8c34224cc8f0bf2ab6c1d5bc4cb38)
D: added binary package [0]
D: found 0 source and 1 binary packages
D: ========== +++ test-4.2-02 i386/linux 0x0
D: opening db index /var/lib/rpm/Depends create mode=0x0
D: opening db index /var/lib/rpm/Basenames rdonly mode=0x0
D: opening db index /var/lib/rpm/Pubkeys rdonly mode=0x0
D: read h# 1107 Header sanity check: OK
D: ========== DSA pubkey id 53268101 37017186 (h#1107)
D: read h# 62 Header V3 DSA signature: OK, key ID 37017186
D: Requires: /bin/sh YES (db files)
D: Requires: /bin/sh YES (cached)
D: Requires: /bin/sh YES (cached)
D: Requires: rpmlib(PayloadFilesHavePrefix) <= 4.0-1 YES (rpmlib provides)
D: Requires: rpmlib(CompressedFileNames) <= 3.0.4-1 YES (rpmlib provides)
D: opening db index /var/lib/rpm/Conflictname rdonly mode=0x0
D: ========== --- test-4.2-01 i386/linux 0x0
D: opening db index /var/lib/rpm/Requirename rdonly mode=0x0
D: closed db index /var/lib/rpm/Depends
D: ========== tsorting packages (order, #predecessors, #succesors, tree, depth, breadth)
D: 0 0 0 1 1 0 -test-4.2-01.i386
D: ========== successors only (0 bytes)
D: 1 0 0 0 1 1 +test-4.2-02.i386
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.