Issue
I have built two RPM packages
proj1-1.0-1.x86_64.rpm
libtest1-1.0-1.x86_64.rpm
proj1
depends on the file libtest1.so
being present and it is reflected correctly in the RPM packages as seen here:
user@my-pc:~$ rpm -qp --requires proj1-1.0-1.x86_64.rpm
libtest1.so()(64bit)
user@my-pc:~$ rpm -qp --provides libtest1-1.0-1.x86_64.rpm
libtest1.so()(64bit)
The installation of proj1
fails due to a missing dependency.
user@my-pc:~$ rpm -ivh proj1-1.0-1.x86_64.rpm
error: Failed dependencies:
libtest1.so()(64bit) is needed by proj1-1.0-1.x86_64.rpm
How do I ensure that libtest1-1.0-1.x86_64.rpm
is installed automatically during
the installation of proj1-1.0-1.x86_64.rpm
?
I did try the --aid
option with rpm -i
as described here but it didn't work for me.
Is there any other way?
Thanks for any help.
Solution
Create a (local) repository and use yum
to have it resolve the dependencies for you.
The CentOS wiki has a nice page providing a how-to on this. CentOS wiki HowTos/CreateLocalRepos.
Summarized and further minimized (not ideal, but quickest):
- Create a directory for you local repository, e.g.
/home/user/repo
. - Move the RPMs into that directory.
Fix some ownership and filesystem permissions:
# chown -R root.root /home/user/repo
Install the
createrepo
package if not installed yet, and run# createrepo /home/user/repo # chmod -R o-w+r /home/user/repo
Create a repository configuration file, e.g.
/etc/yum.repos.d/myrepo.repo
containing[local] name=My Awesome Repo baseurl=file:///home/user/repo enabled=1 gpgcheck=0
Install your package using
# yum install packagename
Answered By - gertvdijk