RPM + cant find rpm after rpm install - linux

please advice why I cant find the rpm that I installed.
I am try to check by rpm -qa | grep test ( see the example in install the rpm: )
but seems that rpm isnt installed why?
build the RPM:
[root#linux /usr/src/redhat/SOURCES]# rpm -ba /usr/src/redhat/SPECS/my_spec.spec
Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/test.sh
Wrote: /root/rpmbuild/SRPMS/test.sh-6.2-2.src.rpm
install the rpm:
[root#linux /usr/src/redhat/RPMS/i386]# rpm -Uvh /root/rpmbuild/SRPMS/test.sh-6.2-2.src.rpm
1:test.sh ########################################### [100%]
[root#linux /usr/src/redhat/RPMS/i386]# rpm -qa | grep test
no results ?
the spec file:
Summary: An example tool. To show a simple rpm build of the tool.
Name: test.sh
Version: 6.2
Release: 2
Source:/root/test.sh
Group: Development/Debuggers
BuildRoot:/var/tmp/test.sh
License: OtherLicense
%description

You installed the source rpm instead of the actual rpm:
rpm -Uvh /root/rpmbuild/RPMS/test.sh-6.2-2.rpm

rpmbuild outputs two files:
A source RPM (SRPM), located in SRPMS/
A binary RPM, located in RPMS//
As Wes noted, you've installed the SRPM. You need to install the RPM, which is located in your RPMS/i386/ subdir. Don't rename the SRPM, you need to look for the file located in the RPM folder and install it:
rpm -Uvh RPMS/i386s/test.sh-6.2-2.i386.rpm

When you install src.rpm it ends up in
~/rpmbuild/SPEC
~/rpmbuild/SOURCES
If you want to rebuild and get binary rpm you should:
rpmbuild -ba test.sh-6.2-2.src.rpm
or even better
mock test.sh-6.2-2.src.rpm

Try:
rpm -q test.sh-6.2-2
or
rpm -q test.sh-6.2-2.src

Related

how to add custom path for rpm dependencies

I am trying to install some software that's required glib 2.14
so I installed it with this tutorial: How to upgrade glibc from version 2.12 to 2.14 on CentOS?
the problem is glib 2.14 path is /opt/glibc-2.14/lib/libc.so.6
so when I try to install software using rpm i still getting this error:
error: Failed dependencies:
libc.so.6(GLIBC_2.14)(64bit) is needed by xyz-4.6.6-1.x86_64
libc.so.6(GLIBC_2.15)(64bit) is needed by xyz-4.6.6-1.x86_64
libc.so.6(GLIBC_2.17)(64bit) is needed by xyz-4.6.6-1.x86_64
how can I add the custom path for rpm dependencies?
It would help a bit if you gave us the name of the package you are trying to install. You can't just provide a path, RPM checks if it's got any packages on record that provide these libraries, and there aren't any. Here are a couple methods you could use:
Use --nodeps
If you already know that you have everything that is required, using --nodeps is completely fine IMO.
Create virtual packages for the missing libraries (advanced)
You are missing the following libraries: libc.so.6(GLIBC_2.14)(64bit) libc.so.6(GLIBC_2.15)(64bit) libc.so.6(GLIBC_2.17)(64bit).
Here's an example .spec file to create a virtual package that claims to provide these libraries:
Name: libc-virtual-provides
Provides: libc.so.6(GLIBC_2.14)(64bit)
Provides: libc.so.6(GLIBC_2.15)(64bit)
Provides: libc.so.6(GLIBC_2.17)(64bit)
Version: 1.0
Release: 1
Summary: Virtual package providing libc 2.14, 2.15, 2.17
License: Public domain
%description
Virtual package providing libc 2.14, 2.15, 2.17
%prep
%files
%changelog
To create a virtual package from this SPEC file, first create some directories:
mkdir -p ~/rpmbuild/BUILD ~/rpmbuild/BUILDROOT ~/rpmbuild/RPMS ~/rpmbuild/SOURCES ~/rpmbuild/SPECS ~/rpmbuild/SRPMS
Then copy the SPEC file into ~/rpmbuild/SPECS, and build an RPM:
cp virtual-glibc-provides.spec ~/rpmbuild/SPECS
cd ~/rpmbuild/SPECS
rpmbuild -ba virtual-glibc-provides.spec
You'll get output like this:
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.6Jni5u
+ umask 022
+ cd /home/.../rpmbuild/BUILD
+ exit 0
Processing files: glib2.14-virtual-provides-2.14-1.x86_64
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/.../rpmbuild/BUILDROOT/glib2.14-virtual-provides-2.14-1.x86_64
Wrote: /home/.../rpmbuild/SRPMS/glib2.14-virtual-provides-2.14-1.src.rpm
Wrote: /home/.../rpmbuild/RPMS/x86_64/glib2.14-virtual-provides-2.14-1.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.YNj8gP
+ umask 022
+ cd /home/.../rpmbuild/BUILD
+ /bin/rm -rf /home/.../rpmbuild/BUILDROOT/glib2.14-virtual-provides-2.14-1.x86_64
+ exit 0
And you'll have your RPM under /home/.../rpmbuild/RPMS/, which you can then install using rpm -ivh ....rpm. You should then be able to install the other package without any problems.

How to compare installed rpm and latest rpm availble on repository?

I would like to find difference between installed xyz-1.0.rpm & latest available xyz-1.1.rpm on repository. Also would like to find out any file change happened in new rpm. How can I do that?
please help.
Thanks
check the changelog
You can check the changelog file:
make sure that you have the package yum-plugin-changelog
and then you can use this command to print the last (most recent) changelog message for the xyz package
# yum changelog 1 xyz | less
otherwise you can use rpm:
# rpm -q --changelog -p xyz-1.0.rpm | less
# rpm -q --changelog -p http://mirror.centos.org/centos/6/os/x86_64/Packages/xyz-1.1.rpm | less
compare the files list
to List Files inside the rpm:
Download xyz-1.1.rpm and list files in xyz-1.1.txt
# rpm -qlp xyz-1.1.rpm > xyz-1.1.txt
then list file of the installed package xyz-1.0.rpm
# rpm -ql xyz > xyz-1.0.txt
and finally:
# diff xyz-1.0.txt xyz-1.1.txt
;)
yum check-update
This command allows you to determine whether any updates are available for your installed packages. yum returns a list of all package updates from all repositories if any are available.
https://www.centos.org/docs/5/html/5.1/Deployment_Guide/s1-yum-useful-commands.html
You check the latest version of the as mentioned above using yum check-update and check the version of the installed rpm: rpm -qa | grep mypackage.
Next obtain the a copy of the current rpm and new rpm using yumdownloader (you may need to use sudo as some TLS certs may only be accessible to root) e.g:
sudo yumdownloader mypackage-current.version
sudo yumdownloader mypackage-latest.version
Then install pkgdiff: sudo yum install pkgdiff and run it to generate an HTML report on the differences:
pkgdiff mypackage-current.version mypackage-latest.version

how does rpm uninstall a rpm in Linux?

For which specific file rpm search first when any one fire command
rpm -e package_name
Check the package name using,
rpm -q package_name
you will find out which packages getting removed.

why does repoquery output wrong file list?

On my YUM server I have this RPM ...
redcricket#rpo-dev:/usr/RED/docs/yum/CEL6/RIE$ rpm -q --filesbypkg -p development/RPMS/ooo-audit-1.0-10.noarch.rpm
ooo-audit /apps/RED/red_apps/server/ooo-audit.pl
... and I have it installed on my system and rpm says this about that RPM ...
[redcricket#dev-006 src]$ rpm -q --filesbypkg ooo-audit
ooo-audit /apps/RED/red_apps/server/ooo-audit.pl
... but repoquery list the files on the old version of the RPM ...
[redcricket#dev-006 src]$ repoquery -l ooo-audit
/apps/RED/data/ooo-audit/exceptions.txt
/apps/RED/red_apps/server/ooo-audit.pl
... even after I do a "sudo yum clean all" ...
[redcricket#dev-006 src]$ sudo yum clean all
Loaded plugins: fastestmirror, merge-conf
Cleaning repos: ...
Cleaning up Everything
... see ...
[redcricket#dev-006 src]$ repoquery -l ooo-audit
/apps/RED/data/ooo-audit/exceptions.txt
/apps/RED/red_apps/server/ooo-audit.pl
here's the yum-utils I have installed ....
[redcricket#dev-006 src]$ rpm -q yum-utils
yum-utils-1.1.30-10.el6.noarch
... what's going on here?
The yum confs are correct. The RPM ooo-audit is only available on my YUM server, rpo-dev.
I have also updated the repodata on the YUM server. Should I report a bug or am I doing something wrong?
It sounds like the YUM repository data itself is incorrect, which is an independent database on the YUM server from the RPM database. Based on your username and the example path, I am assuming it is your own yum server and custom repo; you need to re-run makerepo or whatever command you used to import the RPMs into the YUM repo.
(I will even guess that an older version of the ooo-audit package had that other file in it when the repo was created.)

Installing the libs3 on linux

Could someone pls give me a detailed procedure to intsall libs3 on LINUX? Just the procedure will do.
Thanks in advance.
These are the instructions to install libs3 on centos on a 64 bit machine.
According to their README, you are supposed to build an rpm package out of their source code using 'rpmbuild -ta '
1.) So first, install rpmbuild if it isn't installed already. [My install location is the default one: ~/rpmbuild]
2.) Clone libs3.
git clone https://github.com/bji/libs3.git
3.) Rename folder as libs3-trunk [rpmbuild complained if its name wasn't that, so...], create a tar.gz, copy it to SOURCES folder inside rpmbuild directory.
mv libs3 libs3-trunk
tar -zcvf libs3-trunk.tar.gz libs3-trunk/
mv libs3-trunk.tar.gz ~/rpmbuild/SOURCES
cd ~/rpmbuild/SOURCES
4.) Build the rpm
rpmbuild -ta libs3-trunk.tar.gz
cd ../RPMS/x86_64
5.) Install dependency libs3-2-2.0-5.1.x86_64.rpm from
[http://rpm.pbone.net/index.php3/stat/4/idpl/21900926/dir/centos_6/com/libs3-2-2.0-5.1.x86_64.rpm.html] OR [ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/dalgaaf:/ceph:/extra/CentOS_CentOS-6/x86_64/libs3-2-2.0-5.1.x86_64.rpm]
6.) Install the rpm:
Execute following as sudo:
rpm -Uvh libs3-2-2.0-5.1.x86_64.rpm
rpm -Uvh --replacefiles libs3-trunk-1.x86_64.rpm
rpm -Uvh libs3-devel-trunk-1.x86_64.rpm
7.) Install libcurl-devel/libxml2-devel through yum if you get following error:
make: curl-config: Command not found
make: xml2-config: Command not found
sudo yum install libcurl-devel.x86_64
sudo yum install libxml2-devel.x86_64
For ubuntu versions >=14.04, libs3-dev is available as an Ubuntu package.
So you just need to run:
sudo apt-get install libs3-dev

Resources