I have a minimal CentOS server with no access to the internet. Let's call it server A.

My target it to build a shell script file to install a specific version of a local RPM file for an application. Let's say the target application is Apache. The problem is that each RPM has dependencies.

On a different server where there is an access to the internet, which I call it server B, I download the package:

wget http://repo.okay.com.mx/centos/7/x86_64/release/httpd-2.4.35-5.el7.x86_64.rpm

Then move it to server A and try installing it:

rpm -i httpd-2.4.35-5.el7.x86_64.rpm

yum install dependency screenshot:
yum install dependency screenshot

It has several requirement:

rpm -qpR httpd-2.4.35-5.el7.x86_64.rpm

browse dependencies screenshot:
browse dependencies screenshot

I cannot understand some of the requirements:

1- What is /etc/mime.types? I do not have such a file. Where can I get it from?

2- Some packages are mentioned multiple times such as


What does it mean?

3- Some packages have multiple variations. Which of them should I install? libc.so

4- It seems the list is sorted alphabetically. What is the order of installation?

5- The dnf repoquery command also provides a different list. Which one should I follow?

dnf repoquery screenshot:
dnf repoquery screenshot

6- Isn't there a more automatic way to perform what I am looking for?

  • Please do not post images, copy the text and post it. Commented Aug 24, 2022 at 7:41

2 Answers 2

# Install Yumdownloader using the following command as root user.

yum install yum-utils

# Once installed, run the following command to download a package, for example httpd.
# To download packages with all dependencies, use --resolve option:

mkdir httpd && cd httpd && yumdownloader --resolve httpd

# it will download httpd with all dependencies into working dir.

tested on centos 7 inside docker:

[root@187dddae557b httpd]# ls
apr-1.4.8-7.el7.x86_64.rpm                   httpd-2.4.6-97.el7.centos.5.x86_64.rpm
apr-util-1.5.2-6.el7.x86_64.rpm              httpd-tools-2.4.6-97.el7.centos.5.x86_64.rpm
centos-logos-70.0.6-3.el7.centos.noarch.rpm  mailcap-2.1.41-2.el7.noarch.rpm
  • What if the target is a local rpm file? For example, I need to install mysql server? I cannot even run yumdownloader --enablerepo=mysql80-community --resolve mysql-community-server.
    – mercury
    Commented Aug 29, 2022 at 9:40
  • Another solution I found is yum install --downloadonly but it does not specify the order of installation.
    – mercury
    Commented Aug 29, 2022 at 9:52
  • @mercury a little confuse about you comment, just run yum -y install /mysoft/*.rpm should install normally. Commented Aug 30, 2022 at 8:27
  1. in such case will be much easier to create local repo, accessible by the host in question.
  2. dnf provide bigger list because it show ALL the dependencies, not only missing.
  3. if you want to use this way just download with dnf the required packages and install them.
  4. with rpm you see dependent package, for example apr15, download it, transfer it, install it and try again to install the main package. When you see only filename you can try with yum provides /etc/mime.types to get the package name.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .