Skip to content

Downloads a package with all dependencies using `yum` and creates repo-file for `CentOS 7`.

License

Notifications You must be signed in to change notification settings

handflucht/yumdownloadonly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

yumdownloadonly

Downloads a package with all dependencies using yum and creates repo-file for CentOS 7.

This is helpfull if you have a host which is not connected to the internet. On an online-host you have to execute the script, transfer the downloaded data to the offline host and finally execute the installation.

Full example

On the ONLINE-host - DOWNLOAD package

Two download the data, you have two different possibilities: using the script directly or using a container. If the online-host does not run CentOS 7 you should use the container-version.

Downloading package using Script directly

Installation and prerequisites:

git clone https://github.com/handflucht/yumdownloadonly
yum install -y yum-plugin-downloadonly yum-utils createrepo
cd yumdownloadonly

Download everything to offline install httpd:

./offlinecopy.sh httpd
ls /tmp/offline/download

# httpd offline-httpd.repo

Now transfer the data of /tmp/offline/download to the offline-host, e.g. using an USB-device.

Downloading package using Container

You might want to use container if your online-host isn't a CentOS-machine.

podman build -t yumdownloadonly https://github.com/handflucht/yumdownloadonly

Download everything to offline install httpd:

mkdir /var/data
podman run --rm -v /var/data:/tmp:z yumdownloadonly httpd
ls /var/data/offline/download

# httpd offline-httpd.repo

Please be aware, we create a new folder /var/data and called the mount with :z. This has to be done for SeLinux-reasons. Find more information here: containers/podman#3683 (comment).

Now transfer the data of /var/data/offline/download to the offline-host, e.g. using an USB-device.

On the OFFLINE-host - INSTALL package

Copy the repository-data and the the repository-file to the correct location:

ls 
# httpd offline-httpd.repo
mv httpd /var/offlinerepo
mv offline-httpd.repo /etc/yum.repos.d/

Finally, start installation:

yum --disablerepo=\* --enablerepo=offline-httpd install --nogpgcheck httpd

About

Downloads a package with all dependencies using `yum` and creates repo-file for `CentOS 7`.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published