Downloading an RPM package including all of its dependencies on Fedora

There are times when you need to fully download an RPM and all of its dependencies.


However,

If you have already downloaded the RPM re-downloading the RPM and all its dependencies can be very difficult.

I have found the following is a way to use an alternate installation ‘root’ directory so that you can ensure you are not using your system RPM database, and you can download all of the dependencies for the package.

In the following example I

  1. Create an “/installroot” directory
  2. Create a directory called /data/repo/terminator to store the downloaded RPM and its dependencies
  3. Download the ‘terminator’ package for fedora 34
# mkdir /installroot
# mkdir /data/repo/terminator
# dnf -y install --installroot=/instroot --downloaddir=/data/repo/terminator --downloadonly --noautoremove --releasever=34 terminator

The results will look like the following!

# ls /data/repo/terminator/
acl-2.3.1-1.fc34.x86_64.rpm
adwaita-cursor-theme-40.1.1-1.fc34.noarch.rpm
adwaita-icon-theme-40.1.1-1.fc34.noarch.rpm
alsa-lib-1.2.6.1-3.fc34.x86_64.rpm
alternatives-1.15-2.fc34.x86_64.rpm
atk-2.36.0-3.fc34.x86_64.rpm
at-spi2-atk-2.38.0-2.fc34.x86_64.rpm
at-spi2-core-2.40.3-1.fc34.x86_64.rpm
audit-libs-3.0.6-1.fc34.x86_64.rpm
avahi-libs-0.8-14.fc34.x86_64.rpm
basesystem-11-11.fc34.noarch.rpm
bash-5.1.0-2.fc34.x86_64.rpm
bzip2-libs-1.0.8-6.fc34.x86_64.rpm
ca-certificates-2021.2.52-1.0.fc34.noarch.rpm
cairo-1.17.4-3.fc34.x86_64.rpm
cairo-gobject-1.17.4-3.fc34.x86_64.rpm
colord-libs-1.4.5-2.fc34.x86_64.rpm
coreutils-8.32-32.fc34.x86_64.rpm
coreutils-common-8.32-32.fc34.x86_64.rpm
cpio-2.13-10.fc34.x86_64.rpm
cracklib-2.9.6-27.fc34.x86_64.rpm
crypto-policies-20210213-1.git5c710c0.fc34.noarch.rpm
crypto-policies-scripts-20210213-1.git5c710c0.fc34.noarch.rpm
cryptsetup-libs-2.3.7-1.fc34.x86_64.rpm
cups-libs-2.3.3op2-17.fc34.x86_64.rpm
curl-7.76.1-12.fc34.x86_64.rpm
cyrus-sasl-lib-2.1.27-9.fc34.x86_64.rpm
dbus-1.12.20-3.fc34.x86_64.rpm
dbus-broker-29-2.fc34.x86_64.rpm
dbus-common-1.12.20-3.fc34.noarch.rpm
dbus-libs-1.12.20-3.fc34.x86_64.rpm
dconf-0.40.0-3.fc34.x86_64.rpm
dejavu-sans-fonts-2.37-16.fc34.noarch.rpm
device-mapper-1.02.175-1.fc34.x86_64.rpm
device-mapper-libs-1.02.175-1.fc34.x86_64.rpm
diffutils-3.7-8.fc34.x86_64.rpm
dracut-055-6.fc34.x86_64.rpm
elfutils-debuginfod-client-0.186-1.fc34.x86_64.rpm
elfutils-default-yama-scope-0.186-1.fc34.noarch.rpm
elfutils-libelf-0.186-1.fc34.x86_64.rpm
elfutils-libs-0.186-1.fc34.x86_64.rpm
expat-2.4.7-1.fc34.x86_64.rpm
fedora-gpg-keys-34-2.noarch.rpm
fedora-release-34-39.noarch.rpm
fedora-release-common-34-39.noarch.rpm
fedora-release-identity-basic-34-39.noarch.rpm
fedora-repos-34-2.noarch.rpm
file-5.39-7.fc34.x86_64.rpm
file-libs-5.39-7.fc34.x86_64.rpm
filesystem-3.14-5.fc34.x86_64.rpm
findutils-4.8.0-2.fc34.x86_64.rpm
flac-libs-1.3.3-7.fc34.x86_64.rpm
fontconfig-2.13.94-5.fc34.x86_64.rpm
fonts-filesystem-2.0.5-5.fc34.noarch.rpm
freetype-2.10.4-3.fc34.x86_64.rpm
fribidi-1.0.11-3.fc34.x86_64.rpm
fuse-libs-2.9.9-11.fc34.x86_64.rpm
gawk-5.1.0-3.fc34.x86_64.rpm
gawk-all-langpacks-5.1.0-3.fc34.x86_64.rpm
gdbm-libs-1.19-2.fc34.x86_64.rpm
gdk-pixbuf2-2.42.6-1.fc34.x86_64.rpm
gdk-pixbuf2-modules-2.42.6-1.fc34.x86_64.rpm
gettext-0.21-4.fc34.x86_64.rpm
gettext-libs-0.21-4.fc34.x86_64.rpm
glib2-2.68.4-1.fc34.x86_64.rpm
glibc-2.33-21.fc34.x86_64.rpm
glibc-common-2.33-21.fc34.x86_64.rpm
glibc-doc-2.33-21.fc34.noarch.rpm
glibc-minimal-langpack-2.33-21.fc34.x86_64.rpm
gmp-6.2.0-6.fc34.x86_64.rpm
gnutls-3.7.4-1.fc34.x86_64.rpm
gobject-introspection-1.68.0-4.fc34.x86_64.rpm
graphite2-1.3.14-7.fc34.x86_64.rpm
grep-3.6-2.fc34.x86_64.rpm
grub2-common-2.06-9.fc34.noarch.rpm
grub2-tools-2.06-9.fc34.x86_64.rpm
grub2-tools-minimal-2.06-9.fc34.x86_64.rpm
grubby-8.40-51.fc34.x86_64.rpm
gsm-1.0.19-5.fc34.x86_64.rpm
gstreamer1-1.19.1-2.1.18.4.fc34.x86_64.rpm
gtk3-3.24.30-1.fc34.x86_64.rpm
gtk-update-icon-cache-3.24.30-1.fc34.x86_64.rpm
gzip-1.10-5.fc34.x86_64.rpm
harfbuzz-2.7.4-3.fc34.x86_64.rpm
hicolor-icon-theme-0.17-10.fc34.noarch.rpm
iptables-legacy-libs-1.8.7-8.fc34.x86_64.rpm
jbigkit-libs-2.1-21.fc34.x86_64.rpm
json-c-0.14-8.fc34.x86_64.rpm
kbd-2.4.0-2.fc34.x86_64.rpm
kbd-misc-2.4.0-2.fc34.noarch.rpm
keybinder3-0.3.2-11.fc34.x86_64.rpm
keyutils-libs-1.6.1-2.fc34.x86_64.rpm
kmod-29-2.fc34.x86_64.rpm
kmod-libs-29-2.fc34.x86_64.rpm
kpartx-0.8.5-4.fc34.x86_64.rpm
krb5-libs-1.19.2-5.fc34.x86_64.rpm
langpacks-core-font-en-3.0-14.fc34.noarch.rpm
lcms2-2.12-1.fc34.x86_64.rpm
libacl-2.3.1-1.fc34.x86_64.rpm
libarchive-3.5.2-2.fc34.x86_64.rpm
libargon2-20171227-6.fc34.x86_64.rpm
libasyncns-0.8-20.fc34.x86_64.rpm
libattr-2.5.1-1.fc34.x86_64.rpm
libblkid-2.36.2-1.fc34.x86_64.rpm
libbpf-0.4.0-1.fc34.x86_64.rpm
libbrotli-1.0.9-4.fc34.x86_64.rpm
libcanberra-0.30-24.fc34.x86_64.rpm
libcanberra-gtk3-0.30-24.fc34.x86_64.rpm
libcap-2.48-2.fc34.x86_64.rpm
libcap-ng-0.8.2-4.fc34.x86_64.rpm
libcbor-0.7.0-3.fc34.x86_64.rpm
libcloudproviders-0.3.1-3.fc34.x86_64.rpm
libcom_err-1.45.6-5.fc34.x86_64.rpm
libcurl-7.76.1-12.fc34.x86_64.rpm
libdatrie-0.2.13-1.fc34.x86_64.rpm
libdb-5.3.28-49.fc34.x86_64.rpm
libeconf-0.4.0-1.fc34.x86_64.rpm
libepoxy-1.5.9-1.fc34.x86_64.rpm
libevent-2.1.12-3.fc34.x86_64.rpm
libfdisk-2.36.2-1.fc34.x86_64.rpm
libffi-3.1-28.fc34.x86_64.rpm
libfido2-1.6.0-2.fc34.x86_64.rpm
libgcc-11.3.1-2.fc34.x86_64.rpm
libgcrypt-1.9.3-3.fc34.x86_64.rpm
libgomp-11.3.1-2.fc34.x86_64.rpm
libgpg-error-1.42-1.fc34.x86_64.rpm
libgusb-0.3.8-1.fc34.x86_64.rpm
libibverbs-37.2-2.fc34.x86_64.rpm
libICE-1.0.10-6.fc34.x86_64.rpm
libicu-67.1-7.fc34.x86_64.rpm
libidn2-2.3.2-1.fc34.x86_64.rpm
libjpeg-turbo-2.0.90-3.fc34.x86_64.rpm
libkcapi-1.2.1-1.fc34.x86_64.rpm
libkcapi-hmaccalc-1.2.1-1.fc34.x86_64.rpm
libmount-2.36.2-1.fc34.x86_64.rpm
libnghttp2-1.43.0-2.fc34.x86_64.rpm
libnl3-3.5.0-6.fc34.x86_64.rpm
libnsl2-1.3.0-2.fc34.x86_64.rpm
libogg-1.3.4-4.fc34.x86_64.rpm
libpcap-1.10.1-1.fc34.x86_64.rpm
libpng-1.6.37-10.fc34.x86_64.rpm
libpsl-0.21.1-3.fc34.x86_64.rpm
libpwquality-1.4.4-6.fc34.x86_64.rpm
libseccomp-2.5.3-1.fc34.x86_64.rpm
libselinux-3.2-1.fc34.x86_64.rpm
libsemanage-3.2-1.fc34.x86_64.rpm
libsepol-3.2-2.fc34.x86_64.rpm
libsigsegv-2.13-2.fc34.x86_64.rpm
libSM-1.2.3-8.fc34.x86_64.rpm
libsmartcols-2.36.2-1.fc34.x86_64.rpm
libsndfile-1.0.31-6.fc34.x86_64.rpm
libssh-0.9.6-1.fc34.x86_64.rpm
libssh-config-0.9.6-1.fc34.noarch.rpm
libstdc++-11.3.1-2.fc34.x86_64.rpm
libtasn1-4.16.0-4.fc34.x86_64.rpm
libtdb-1.4.3-6.fc34.x86_64.rpm
libtextstyle-0.21-4.fc34.x86_64.rpm
libthai-0.1.28-6.fc34.x86_64.rpm
libtiff-4.2.0-1.fc34.x86_64.rpm
libtirpc-1.3.2-0.fc34.x86_64.rpm
libtool-ltdl-2.4.6-40.fc34.x86_64.rpm
libunistring-0.9.10-10.fc34.x86_64.rpm
libunwind-1.4.0-5.fc34.x86_64.rpm
libusbx-1.0.24-2.fc34.x86_64.rpm
libutempter-1.2.1-4.fc34.x86_64.rpm
libuuid-2.36.2-1.fc34.x86_64.rpm
libverto-0.3.2-1.fc34.x86_64.rpm
libvorbis-1.3.7-3.fc34.x86_64.rpm
libwayland-client-1.20.0-4.fc34.x86_64.rpm
libwayland-cursor-1.20.0-4.fc34.x86_64.rpm
libwayland-egl-1.20.0-4.fc34.x86_64.rpm
libwebp-1.2.2-1.fc34.x86_64.rpm
libX11-1.7.2-3.fc34.x86_64.rpm
libX11-common-1.7.2-3.fc34.noarch.rpm
libX11-xcb-1.7.2-3.fc34.x86_64.rpm
libXau-1.0.9-6.fc34.x86_64.rpm
libxcb-1.13.1-7.fc34.x86_64.rpm
libXcomposite-0.4.5-5.fc34.x86_64.rpm
libxcrypt-4.4.28-1.fc34.x86_64.rpm
libxcrypt-compat-4.4.28-1.fc34.x86_64.rpm
libXcursor-1.2.0-5.fc34.x86_64.rpm
libXdamage-1.1.5-5.fc34.x86_64.rpm
libXext-1.3.4-6.fc34.x86_64.rpm
libXfixes-6.0.0-1.fc34.x86_64.rpm
libXft-2.3.3-6.fc34.x86_64.rpm
libXi-1.7.10-6.fc34.x86_64.rpm
libXinerama-1.1.4-8.fc34.x86_64.rpm
libxkbcommon-1.3.0-1.fc34.x86_64.rpm
libxml2-2.9.13-1.fc34.x86_64.rpm
libXrandr-1.5.2-6.fc34.x86_64.rpm
libXrender-0.9.10-14.fc34.x86_64.rpm
libXtst-1.2.3-14.fc34.x86_64.rpm
libzstd-1.5.2-1.fc34.x86_64.rpm
lua-libs-5.4.4-1.fc34.x86_64.rpm
lz4-libs-1.9.3-2.fc34.x86_64.rpm
memstrack-0.2.2-1.fc34.x86_64.rpm
mkpasswd-5.5.10-1.fc34.x86_64.rpm
mpfr-4.1.0-7.fc34.x86_64.rpm
ncurses-6.2-4.20200222.fc34.x86_64.rpm
ncurses-base-6.2-4.20200222.fc34.noarch.rpm
ncurses-libs-6.2-4.20200222.fc34.x86_64.rpm
nettle-3.7.3-1.fc34.x86_64.rpm
openldap-2.4.57-6.fc34.x86_64.rpm
openssl-libs-1.1.1n-1.fc34.x86_64.rpm
openssl-pkcs11-0.4.11-2.fc34.x86_64.rpm
opus-1.3.1-8.fc34.x86_64.rpm
os-prober-1.77-7.fc34.x86_64.rpm
p11-kit-0.23.22-3.fc34.x86_64.rpm
p11-kit-trust-0.23.22-3.fc34.x86_64.rpm
pam-1.5.1-8.fc34.x86_64.rpm
pango-1.48.11-1.fc34.x86_64.rpm
pcre2-10.36-4.fc34.x86_64.rpm
pcre2-syntax-10.36-4.fc34.noarch.rpm
pcre-8.44-3.fc34.1.x86_64.rpm
pigz-2.5-1.fc34.x86_64.rpm
pixman-0.40.0-3.fc34.x86_64.rpm
popt-1.18-4.fc34.x86_64.rpm
procps-ng-3.3.17-1.fc34.1.x86_64.rpm
publicsuffix-list-dafsa-20190417-5.fc34.noarch.rpm
pulseaudio-libs-14.2-3.fc34.x86_64.rpm
python3-3.9.12-1.fc34.x86_64.rpm
python3-cairo-1.20.1-1.fc34.x86_64.rpm
python3-configobj-5.0.6-23.fc34.noarch.rpm
python3-dbus-1.2.18-1.fc34.x86_64.rpm
python3-gobject-3.40.1-1.fc34.x86_64.rpm
python3-gobject-base-3.40.1-1.fc34.x86_64.rpm
python3-libs-3.9.12-1.fc34.x86_64.rpm
python3-pip-21.0.1-4.fc34.noarch.rpm
python3-psutil-5.8.0-5.fc34.x86_64.rpm
python3-setuptools-53.0.0-3.fc34.noarch.rpm
python3-six-1.15.0-5.fc34.noarch.rpm
python-pip-wheel-21.0.1-4.fc34.noarch.rpm
python-setuptools-wheel-53.0.0-3.fc34.noarch.rpm
python-unversioned-command-3.9.12-1.fc34.noarch.rpm
qrencode-libs-4.1.1-1.fc34.x86_64.rpm
readline-8.1-2.fc34.x86_64.rpm
rpm-4.16.1.3-1.fc34.x86_64.rpm
rpm-libs-4.16.1.3-1.fc34.x86_64.rpm
sed-4.8-7.fc34.x86_64.rpm
setup-2.13.7-3.fc34.noarch.rpm
shadow-utils-4.8.1-10.fc34.x86_64.rpm
shared-mime-info-2.1-2.fc34.x86_64.rpm
sound-theme-freedesktop-0.8-15.fc34.noarch.rpm
sqlite-libs-3.34.1-2.fc34.x86_64.rpm
systemd-248.10-1.fc34.x86_64.rpm
systemd-libs-248.10-1.fc34.x86_64.rpm
systemd-networkd-248.10-1.fc34.x86_64.rpm
systemd-pam-248.10-1.fc34.x86_64.rpm
systemd-rpm-macros-248.10-1.fc34.noarch.rpm
systemd-udev-248.10-1.fc34.x86_64.rpm
terminator-2.1.1-1.fc34.noarch.rpm
tpm2-tss-3.1.0-1.fc34.x86_64.rpm
tzdata-2022a-1.fc34.noarch.rpm
util-linux-2.36.2-1.fc34.x86_64.rpm
vte291-0.64.2-1.fc34.x86_64.rpm
vte-profile-0.64.2-1.fc34.x86_64.rpm
which-2.21-26.fc34.x86_64.rpm
whois-nls-5.5.10-1.fc34.noarch.rpm
xkeyboard-config-2.33-1.fc34.noarch.rpm
xml-common-0.6.3-56.fc34.noarch.rpm
xz-5.2.5-9.fc34.x86_64.rpm
xz-libs-5.2.5-9.fc34.x86_64.rpm
zlib-1.2.11-26.fc34.x86_64.rpm

If there is a need to download a GROUP of packages such as Gnome Desktop, you may do the following

# dnf -y group install "Basic Desktop" GNOME  --installroot=/installroot  --downloadonly --downloaddir=/tmp/repo -releasever=34

*note: If you need to re-download them again on the same system you should make a new /installroot directory.

This entry was posted in Command Line FU, Linux and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *