2

I have an enterprise network, people seems not willing to download rpm and dependancies for CentOS.

How can I

yum --download pkg_name --directory my_repo

in a system which do not use yum as packaging system such as Ubuntu or debian?

4
  • if your target system is ubuntu instead of centos then the package files are .deb files instead of .rpm files. debian and ubuntu use a different packagin system.
    – Skaperen
    Sep 25, 2015 at 11:35
  • why do you want to just download instead of install?
    – Skaperen
    Sep 25, 2015 at 11:35
  • I want to download packages for CentOS. Sep 25, 2015 at 14:08
  • Can you run a apt-cacher proxy on the Ubuntu system? (Despite the name, apt-cacher can be used with rpm and pacman too.)
    – muru
    Sep 26, 2015 at 4:11

3 Answers 3

4

It seems that Debian has yum-utils available, which should have yumdownloader, which you can use to download RPMs from yum repositories.

0
1

As far as I know, the best way for apt-based distros like Debian or Ubuntu is to install alien, which converts individual RPMs into the native deb format, and then install them individually with dpkg.

Running as root:

apt-get install alien

alien package-name.rpm

dpkg -i package-name.deb

This obviously won't resolve dependencies automatically, and dpkg will refuse to install until they are met. Someone else might know a way to make this easier or automate it.

1
  • Sorry, I have miswritten : I want to downmload stuff for CentOS and not for the host distribution based on debian. Sep 25, 2015 at 14:07
1

You can save all the deb files with dependencies using the following command

apt install --download-only kubeadm=1.20.15-00

And the files will be stored under /var/cache/apt/archives

$ cd /var/cache/apt/archives

$ ls |grep kubeadm
kubeadm_1.20.15-00_amd64.deb
1
  • I think you missed the question asked. The question was how to download CentOS packages on a Debian-based system. Apt is not the right solution.
    – jsbillings
    Jul 29, 2022 at 2:38

You must log in to answer this question.

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