How to install rpm unattended dependencies

I created two RPM packages

  • proj1-1.0-1.x86_64.rpm
  • libtest1-1.0-1.x86_64.rpm

proj1 depends on the libtest1.so file libtest1.so and it displays correctly in RPM packages, as shown 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) 

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 to ensure that libtest1-1.0-1.x86_64.rpm installed automatically during proj1-1.0-1.x86_64.rpm installation?

I tried the --aid option with rpm -i as described here , but this did not work for me.

Is there another way?

Thanks for any help.

+113
linux installation package rpm yum
Dec 14 '12 at 10:30
source share
11 answers

Create a (local) repository and use yum so that it resolves you dependencies.

The CentOS wiki has a nice page with instructions on this. CentOS wiki HowTos / CreateLocalRepos .




Summarized and minimized (not perfect, but fast):

  • Create a directory for the local repository, for example. /home/user/repo .
  • Move the RPM to this directory.
  • Correct ownership and file system rights:

     # chown -R root.root /home/user/repo 
  • Install the createrepo package if it is not already installed and run

     # createrepo /home/user/repo # chmod -R o-w+r /home/user/repo 
  • Create a repository configuration file, for example. /etc/yum.repos.d/myrepo.repo containing

     [local] name=My Awesome Repo baseurl=file:///home/user/repo enabled=1 gpgcheck=0 
  • Install the package using

     # yum install packagename 
+86
Dec 14 '12 at 11:24
source share

The provided @gertvdijk link shows a quick way to achieve the desired results without setting up a local repository:

 $ yum --nogpgcheck localinstall packagename.arch.rpm 

Just change packagename.arch.rpm to the name of the RPM file you want to install.

Edit Just a clarification, this will automatically install all the dependencies that are already available through the YUM system repositories.

If you have dependencies that satisfy other RPM files that are not in the system repositories, this method will not work unless each RPM along with packagename.arch.rpm also indicated on the command line.

+163
May 6 '13 at 20:32
source share

For dnf users, just use dnf install *.rpm , localinstall no longer required.

+25
Aug 20 '15 at 18:05
source share

For me, she only worked with

 # yum install ffmpeg-2.6.4-1.fc22.x86_64.rpm 

And automatically requested permission to download dependencies. Below example I am using Fedora 22

 [root@localhost lukas]# yum install ffmpeg-2.6.4-1.fc22.x86_64.rpm Yum command has been deprecated, redirecting to '/usr/bin/dnf install ffmpeg-2.6.4-1.fc22.x86_64.rpm'. See 'man dnf' and 'man yum2dnf' for more information. To transfer transaction metadata from yum to DNF, run: 'dnf install python-dnf-plugins-extras-migrate && dnf-2 migrate' Last metadata expiration check performed 0:28:24 ago on Fri Sep 25 12:43:44 2015. Dependencies resolved. ==================================================================================================================== Package Arch Version Repository Size ==================================================================================================================== Installing: SDL x86_64 1.2.15-17.fc22 fedora 214 k ffmpeg x86_64 2.6.4-1.fc22 @commandline 1.5 M ffmpeg-libs x86_64 2.6.4-1.fc22 rpmfusion-free-updates 5.0 M fribidi x86_64 0.19.6-3.fc22 fedora 69 k lame-libs x86_64 3.99.5-5.fc22 rpmfusion-free 345 k libass x86_64 0.12.1-1.fc22 updates 85 k libavdevice x86_64 2.6.4-1.fc22 rpmfusion-free-updates 75 k libdc1394 x86_64 2.2.2-3.fc22 fedora 124 k libva x86_64 1.5.1-1.fc22 fedora 79 k openal-soft x86_64 1.16.0-5.fc22 fedora 292 k opencv-core x86_64 2.4.11-5.fc22 updates 1.9 M openjpeg-libs x86_64 1.5.1-14.fc22 fedora 89 k schroedinger x86_64 1.0.11-7.fc22 fedora 315 k soxr x86_64 0.1.2-1.fc22 updates 83 k x264-libs x86_64 0.142-12.20141221git6a301b6.fc22 rpmfusion-free 587 k x265-libs x86_64 1.6-1.fc22 rpmfusion-free 486 k xvidcore x86_64 1.3.2-6.fc22 rpmfusion-free 264 k Transaction Summary ==================================================================================================================== Install 17 Packages Total size: 11 M Total download size: 9.9 M Installed size: 35 M Is this ok [y/N]: y 
+14
Sep 25 '15 at 18:18
source share

I found a simpler solution. If you have all the RPMs in one directory, all you have to do is

 $ sudo rpm -i *.rpm 

rpm seems to correctly determine their installation order and install RPM.

+6
Oct 25 '13 at 5:52
source share

Matthew’s response caused a lot of emotion, because he still lacks small details. The general team will be:

 # yum --nogpgcheck localinstall <package1_file_name> ... <packageN_file_name> 

The above package_file_name may include a local absolute or relative path or be a URL (possibly even a URI).

Yum will look for dependencies among all the package files specified on the command line, and if it cannot find the dependencies, it will also use any configured and included yum repositories.

Neither the current working directory, nor the path to any of the package_file_name will be found, unless any of these directories has been previously configured as the included yum repository.

So in the case of OP, the yum command is:

 # cd <path with pkg files>; yum --nogpgcheck localinstall ./proj1-1.0-1.x86_64.rpm ./libtest1-1.0-1.x86_64.rpm 

will do, like rpm :

 # cd <path with pkg files>; rpm -i proj1-1.0-1.x86_64.rpm libtest1-1.0-1.x86_64.rpm 

The difference between these yum and rpm will only be visible if one of the packages listed has additional dependencies on packages NOT listed on the command line.

In this case, rpm will simply refuse to continue, while yum will use any configured and enabled yum repositories to look for dependencies and may possibly succeed.

The current working directory will NOT be found in any case, except when it was previously configured as the included yum repository.

+2
Jan 30 '18 at 8:54
source share

I came across this and worked for me on yum localinstall enterPkgNameHere.rpm from inside the directory where the .rpm file is located.

Note: replace enterPkgNameHere.rpm with the name of your .rpm file.

0
Feb 05 '16 at 1:26
source share

Just run the following command.

 sudo dnf install *package.rpm 

Enter your password and you're done.

0
Mar 30 '18 at 3:06
source share

In the case of openSUSE Leap 15, I get a 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 find out what the dependencies are:

 > 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 the 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 am not sure if this is the best practice, but it solved my problem.

0
Jun 09 '18 at 6:33
source share

Step 1: copy all rpm pkg to the specified locations

Step 2: if createrepo is not already installed, since it will not be installed by default, install it.

 [root@pavangildamysql1 8.0.11_rhel7]# yum install createrepo 

Step 3: create a metadata repository and give below permission

 [root@pavangildamysql1 8.0.11_rhel7]# chown -R root.root /scratch/PVN/8.0.11_rhel7 [root@pavangildamysql1 8.0.11_rhel7]# createrepo /scratch/PVN/8.0.11_rhel7 Spawning worker 0 with 3 pkgs Spawning worker 1 with 3 pkgs Spawning worker 2 with 3 pkgs Spawning worker 3 with 2 pkgs Workers Finished Saving Primary metadata Saving file lists metadata Saving other metadata Generating sqlite DBs Sqlite DBs complete [root@pavangildamysql1 8.0.11_rhel7]# chmod -R o-w+r /scratch/PVN/8.0.11_rhel7 

Step 4: Create a repository file with the following contents in /etc/yum.repos.d/mysql.repo

 [local] name=My Awesome Repo baseurl=file:///scratch/PVN/8.0.11_rhel7 enabled=1 gpgcheck=0 

Step 5 Run this command to install

 [root@pavangildamysql1 local]# yum --nogpgcheck localinstall mysql-commercial-server-8.0.11-1.1.el7.x86_64.rpm 
0
Jun 12 '18 at 15:31
source share

The process of creating RPM from the source file: 1) download the source file with the extension .gz. 2) install rpm-build and rpmdevtools from yum install. (The rpmbuild folder will be generated ... SPECS, SOURCES, RPMS .. folders must be generated inside the rpmbuild folder). 3) copy the .gz source code to the SOURCES folder. (Rpmbuild / SOURCES) 4) Unzip the tarball using the following command. go to the SOURCES folder: rpmbuild / SOURCES where the tar file is located. command: for example, tar -xvzf httpd-2.22.tar.gz The httpd-2.22 folder will be generated in the same way. Check if apr and apr-util are in the httpd-2.22 / srclib folder. If apr and apr-util do not exist, download the latest version from the apache website, unzip it and place it in the httpd-2.22 / srclib folder. Also make sure pcre is installed on your system.

5) go to the extracted folder and enter the following command: ./ configure --prefix = / usr / local / apache2 --with-enabled-apr --enable-proxy --enable-proxy-balancer --with-mpm = worker --enable-mods-static = all 6) execute the command below after successful completion of the configuration: make 7) after successful execution, execute the command make: checkinstall in the same folder. (if you do not have checkinstall software, download the latest version from the site). There is also an error in checkinstall software that can be fixed as follows: find checkinstallrc and then replace TRANSLATE = 1 with TRANSLATE = 0 using the vim command. Also check the package exception: EXCLUDE = "/ selinux" 8) checkinstall will ask for an option (enter R if you want tp build rpm for the source file) 9) The finished .rpm file will be embedded in the RPMS folder inside the rpmbuild / RPMS file ... Total best ....

Regards, Prerana

-2
Mar 21 '16 at 12:45
source share



All Articles