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.
For dnf users just use
dnf install *.rpm
,localinstall
is no longer needed.For me worked just with
And automatically asked authorization to dowload the depedencies. Below the example, i am using fedora 22
Matthew's answer awoke many emotions, because of the fact that it still lacks a minor detail. The general command would be:
The
package_file_name
above can include local absolute or relative path, or be a URL (possibly even an URI).Yum would search for dependencies among all package files given on the command line AND IF IT FAILS to find the dependencies there, it will also use any configured and enabled yum repositories.
Neither the current working directory, nor the paths of any of
package_file_name
will be searched, except when any of these directories has been previously configured as an enabledyum
repository.So in the OP's case the
yum
command:would do, as would do the
rpm
:The differencve between these
yum
andrpm
invocations would only be visible if one of the packages listed to be installed had further dependencies on packages NOT listed on the command line.In such a case
rpm
will just refuse to continue, whileyum
would use any configured and enabled yum repositories to search for dependencies, and may possibly succeed.The current working directory will NOT be searched in any case, except when it has been previously configured as an enabled
yum
repository.Process of generating RPM from source file:
tar -xvzf httpd-2.22.tar.gz
httpd-2.22 folder will be generated in the same path. Check if apr and apr-util and there in httpd-2.22/srclib folder. If apr and apr-util doesn't exist download latest version from apache site,untar it and put it inside httpd-2.22/srclib folder. Also make sure you have pcre install in your system../configure --prefix=/usr/local/apache2 --with-included-apr --enable-proxy --enable-proxy-balancer --with-mpm=worker --enable-mods-static=all
make
I found a simpler solution. If you have all the RPMs in the same directory, all you need to do is,
rpm
seems to figure out the correct order to install these and installs the RPMs.Step1: copy all the rpm pkg in given locations
Step2: if createrepo is not already installed, as it will not be by default, install it.
Step3: create repository metedata and give below permission
Step4: Create repository file with following contents at /etc/yum.repos.d/mysql.repo
Step5 Run this command to install