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.
The link @gertvdijk provided shows a quick way to achieve the desired results without configuring a local repository:
Just change
packagename.arch.rpm
to the RPM filename you want to install.Edit Just a clarification, this will automatically install all dependencies that are already available via system YUM repositories.
If you have dependencies satisfied by other RPMs that are not in the system's repositories, then this method will not work unless each RPM is also specified along with
packagename.arch.rpm
on the command line.In the case of openSUSE Leap 15, I'm receiving similar error:
I run this command to figure out what are the dependencies:
Then I run this command to install dependencies:
Then I run this to install the
rpm
file:I'm not sure if it is the best practice, however it solved my issue.
Simple just run the following command.
Enter your password and you are done.
I ran into this and what worked for me was to run
yum localinstall enterPkgNameHere.rpm
from inside the directory where the .rpm file is located.Note: replace the
enterPkgNameHere.rpm
with the name of your .rpm file.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):
/home/user/repo
.Fix some ownership and filesystem permissions:
Install the
createrepo
package if not installed yet, and runCreate a repository configuration file, e.g.
/etc/yum.repos.d/myrepo.repo
containingInstall your package using