-
-
Save hwdsl2/81ef6f0315ac24ea55d4 to your computer and use it in GitHub Desktop.
Workaround for CentOS kernel-devel "No package available" error
This file contains 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
IMPORTANT: First, check your CentOS version with: | |
cat /etc/redhat-release | |
Then choose one of the sections below. | |
============================ | |
Steps for CentOS 6.x ONLY | |
============================ | |
# Older versions of the kernel-devel package are kept in the CentOS Vault. | |
# We need to temporarily add this repository. | |
repo_url=https://gist.githubusercontent.com/hwdsl2/81ef6f0315ac24ea55d4/raw/CentOS-6-Vault.repo | |
wget -t 3 -T 30 -O /etc/yum.repos.d/CentOS-6-Vault.repo $repo_url | |
# Next, install the kernel-devel package: | |
yum --enablerepo=C6.9-base --enablerepo=C6.9-updates \ | |
--enablerepo=C6.8-base --enablerepo=C6.8-updates \ | |
--enablerepo=C6.7-base --enablerepo=C6.7-updates \ | |
--enablerepo=C6.6-base --enablerepo=C6.6-updates \ | |
--enablerepo=C6.5-base --enablerepo=C6.5-updates \ | |
--enablerepo=C6.4-base --enablerepo=C6.4-updates \ | |
--enablerepo=C6.3-base --enablerepo=C6.3-updates \ | |
--enablerepo=C6.2-base --enablerepo=C6.2-updates \ | |
--enablerepo=C6.1-base --enablerepo=C6.1-updates \ | |
--enablerepo=C6.0-base --enablerepo=C6.0-updates \ | |
install kernel-devel-$(uname -r) | |
# Remove the temporary repository we just added: | |
rm -f /etc/yum.repos.d/CentOS-6-Vault.repo | |
============================ | |
Steps for CentOS 7.x ONLY | |
============================ | |
# Older versions of the kernel-devel package are kept in the CentOS Vault. | |
# We need to temporarily add this repository. | |
repo_url=https://gist.githubusercontent.com/hwdsl2/81ef6f0315ac24ea55d4/raw/CentOS-7-Vault.repo | |
wget -t 3 -T 30 -O /etc/yum.repos.d/CentOS-7-Vault.repo $repo_url | |
# Next, install the kernel-devel package: | |
yum --enablerepo=C7.5.1804-base --enablerepo=C7.5.1804-updates \ | |
--enablerepo=C7.4.1708-base --enablerepo=C7.4.1708-updates \ | |
--enablerepo=C7.3.1611-base --enablerepo=C7.3.1611-updates \ | |
--enablerepo=C7.2.1511-base --enablerepo=C7.2.1511-updates \ | |
--enablerepo=C7.1.1503-base --enablerepo=C7.1.1503-updates \ | |
--enablerepo=C7.0.1406-base --enablerepo=C7.0.1406-updates \ | |
install kernel-devel-$(uname -r) | |
# Remove the temporary repository we just added: | |
rm -f /etc/yum.repos.d/CentOS-7-Vault.repo |
This file contains 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
[C6.9-base] | |
name=CentOS-6.9 - Base | |
baseurl=http://vault.centos.org/6.9/os/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 | |
enabled=0 | |
[C6.9-updates] | |
name=CentOS-6.9 - Updates | |
baseurl=http://vault.centos.org/6.9/updates/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 | |
enabled=0 | |
[C6.8-base] | |
name=CentOS-6.8 - Base | |
baseurl=http://vault.centos.org/6.8/os/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 | |
enabled=0 | |
[C6.8-updates] | |
name=CentOS-6.8 - Updates | |
baseurl=http://vault.centos.org/6.8/updates/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 | |
enabled=0 | |
[C6.7-base] | |
name=CentOS-6.7 - Base | |
baseurl=http://vault.centos.org/6.7/os/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 | |
enabled=0 | |
[C6.7-updates] | |
name=CentOS-6.7 - Updates | |
baseurl=http://vault.centos.org/6.7/updates/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 | |
enabled=0 | |
[C6.6-base] | |
name=CentOS-6.6 - Base | |
baseurl=http://vault.centos.org/6.6/os/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 | |
enabled=0 | |
[C6.6-updates] | |
name=CentOS-6.6 - Updates | |
baseurl=http://vault.centos.org/6.6/updates/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 | |
enabled=0 | |
[C6.5-base] | |
name=CentOS-6.5 - Base | |
baseurl=http://vault.centos.org/6.5/os/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 | |
enabled=0 | |
[C6.5-updates] | |
name=CentOS-6.5 - Updates | |
baseurl=http://vault.centos.org/6.5/updates/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 | |
enabled=0 | |
[C6.4-base] | |
name=CentOS-6.4 - Base | |
baseurl=http://vault.centos.org/6.4/os/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 | |
enabled=0 | |
[C6.4-updates] | |
name=CentOS-6.4 - Updates | |
baseurl=http://vault.centos.org/6.4/updates/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 | |
enabled=0 | |
[C6.3-base] | |
name=CentOS-6.3 - Base | |
baseurl=http://vault.centos.org/6.3/os/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 | |
enabled=0 | |
[C6.3-updates] | |
name=CentOS-6.3 - Updates | |
baseurl=http://vault.centos.org/6.3/updates/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 | |
enabled=0 | |
[C6.2-base] | |
name=CentOS-6.2 - Base | |
baseurl=http://vault.centos.org/6.2/os/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 | |
enabled=0 | |
[C6.2-updates] | |
name=CentOS-6.2 - Updates | |
baseurl=http://vault.centos.org/6.2/updates/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 | |
enabled=0 | |
[C6.1-base] | |
name=CentOS-6.1 - Base | |
baseurl=http://vault.centos.org/6.1/os/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 | |
enabled=0 | |
[C6.1-updates] | |
name=CentOS-6.1 - Updates | |
baseurl=http://vault.centos.org/6.1/updates/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 | |
enabled=0 | |
[C6.0-base] | |
name=CentOS-6.0 - Base | |
baseurl=http://vault.centos.org/6.0/os/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 | |
enabled=0 | |
[C6.0-updates] | |
name=CentOS-6.0 - Updates | |
baseurl=http://vault.centos.org/6.0/updates/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 | |
enabled=0 |
This file contains 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
# CentOS Vault contains rpms from older releases in the CentOS-7 | |
# tree. | |
[C7.5.1804-base] | |
name=CentOS-7.5.1804 - Base | |
baseurl=http://vault.centos.org/7.5.1804/os/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 | |
enabled=0 | |
[C7.5.1804-updates] | |
name=CentOS-7.5.1804 - Updates | |
baseurl=http://vault.centos.org/7.5.1804/updates/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 | |
enabled=0 | |
[C7.4.1708-base] | |
name=CentOS-7.4.1708 - Base | |
baseurl=http://vault.centos.org/7.4.1708/os/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 | |
enabled=0 | |
[C7.4.1708-updates] | |
name=CentOS-7.4.1708 - Updates | |
baseurl=http://vault.centos.org/7.4.1708/updates/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 | |
enabled=0 | |
[C7.3.1611-base] | |
name=CentOS-7.3.1611 - Base | |
baseurl=http://vault.centos.org/7.3.1611/os/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 | |
enabled=0 | |
[C7.3.1611-updates] | |
name=CentOS-7.3.1611 - Updates | |
baseurl=http://vault.centos.org/7.3.1611/updates/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 | |
enabled=0 | |
[C7.2.1511-base] | |
name=CentOS-7.2.1511 - Base | |
baseurl=http://vault.centos.org/7.2.1511/os/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 | |
enabled=0 | |
[C7.2.1511-updates] | |
name=CentOS-7.2.1511 - Updates | |
baseurl=http://vault.centos.org/7.2.1511/updates/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 | |
enabled=0 | |
[C7.1.1503-base] | |
name=CentOS-7.1.1503 - Base | |
baseurl=http://vault.centos.org/7.1.1503/os/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 | |
enabled=0 | |
[C7.1.1503-updates] | |
name=CentOS-7.1.1503 - Updates | |
baseurl=http://vault.centos.org/7.1.1503/updates/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 | |
enabled=0 | |
[C7.0.1406-base] | |
name=CentOS-7.0.1406 - Base | |
baseurl=http://vault.centos.org/7.0.1406/os/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 | |
enabled=0 | |
[C7.0.1406-updates] | |
name=CentOS-7.0.1406 - Updates | |
baseurl=http://vault.centos.org/7.0.1406/updates/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 | |
enabled=0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment