Last active
September 11, 2024 09:28
-
-
Save nutrino/a5db54524bda763f113705ebc657b3db to your computer and use it in GitHub Desktop.
RHEL/CentOS 7 Offline Download & Install Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bashn | |
| if [ -z "$1" ]; then | |
| echo "sudo yumdown.sh [packageName]" | |
| exit 1 | |
| fi | |
| if [ "$EUID" -ne 0 ] | |
| then echo "Please run as root (sudo yumdown.sh [packageName])" | |
| exit | |
| fi | |
| set -x #echo on | |
| PKG=$1 # NAME OF THE PACKAGE TO INSTALL ON OFFLINE MACHINE | |
| rm -rf /tmp/$PKG | |
| #rm -rf /tmp/$PKG-installroot | |
| mkdir /tmp/$PKG | |
| #mkdir /tmp/$PKG-installroot | |
| #yum install --downloadonly --installroot=/tmp/$PKG-installroot --releasever=7 --downloaddir=/tmp/$PKG $PKG | |
| repotrack $PKG -p /tmp/$PKG | |
| createrepo --database /tmp/$PKG | |
| #rm -rf /tmp/$PKG-installroot | |
| tar -cvzf $PKG.tar.gz /tmp/$PKG | |
| rm -rf /tmp/$PKG |
Author
Author
IF yumdown.sh FAILS....
sudo yum clean all
ls /etc/yum.repos.d
Author
sudo yum-config-manager --disable \*
sudo yum-config-manager --enable offline-libsmbclient
sudo yum-config-manager --enable offline-samba
sudo yum-config-manager --enable offline-samba-libs
sudo yum install samba
Author
echo 7.9.2009 > /etc/yum/vars/releasever
/etc/yum.repos.d/CentOS-Base.repo
[base]
name=CentOS-$releasever - Base
baseurl=http://vault.centos.org/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[updates]
name=CentOS-$releasever - Updates
baseurl=http://vault.centos.org/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS-$releasever - Extras
baseurl=http://vault.centos.org/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
GCC Debug Support
[ONLINE]
./yumdown.sh binutils-dev
debuginfo-install --downloadonly --downloaddir=./download glibc libgcc libstdc++
[OFFLINE]
sudo ./yumoffline.sh binutils-dev
sudo yum --disablerepo=* localinstall *.rpm