I have built two RPM packages
proj1-1.0-1.x86_64.rpm
libtest1-1.0-1.x86_64.rpm
proj1
depends on
I found a simpler solution. If you have all the RPMs in the same directory, all you need to do is,
$ sudo rpm -i *.rpm
rpm
seems to figure out the correct order to install these and installs the RPMs.
Matthew's answer awoke many emotions, because of the fact that it still lacks a minor detail. The general command would be:
# yum --nogpgcheck localinstall <package1_file_name> ... <packageN_file_name>
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 enabled yum
repository.
So in the OP's case the yum
command:
# cd <path with pkg files>; yum --nogpgcheck localinstall ./proj1-1.0-1.x86_64.rpm ./libtest1-1.0-1.x86_64.rpm
would do, as would do the rpm
:
# cd <path with pkg files>; rpm -i proj1-1.0-1.x86_64.rpm libtest1-1.0-1.x86_64.rpm
The differencve between these yum
and rpm
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, while yum
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.
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:
# 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
For dnf users just use dnf install *.rpm
, localinstall
is no longer needed.
In the case of openSUSE Leap 15, I'm receiving similar error:
> sudo rpm -i opera-stable_53.0.2907.68_amd64.rpm
[sudo] password for root:
warning: opera-stable_53.0.2907.68_amd64.rpm: Header V4 RSA/SHA512 Signature, key ID a5c7ff72: NOKEY
error: Failed dependencies:
at is needed by opera-stable-53.0.2907.68-0.x86_64
I run this command to figure out what are the dependencies:
> sudo zypper install opera-stable_53.0.2907.68_amd64.rpm
Loading repository data...
Reading installed packages...
Resolving package dependencies...
The following 4 NEW packages are going to be installed:
at libfl2 libHX28 opera-stable
4 new packages to install.
Overall download size: 50.3 MiB. Already cached: 0 B. After the operation, additional 176.9 MiB will be used.
Continue? [y/n/...? shows all options] (y): n
Then I run this command to install dependencies:
> sudo zypper in at
Loading repository data...
Reading installed packages...
Resolving package dependencies...
The following 3 NEW packages are going to be installed:
at libfl2 libHX28
3 new packages to install.
Overall download size: 208.6 KiB. Already cached: 0 B. After the operation, additional 600.4 KiB will be used.
Continue? [y/n/...? shows all options] (y): y
Then I run this to install the rpm
file:
> sudo rpm -i opera-stable_53.0.2907.68_amd64.rpm
I'm not sure if it is the best practice, however it solved my issue.
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.