Last active
November 28, 2025 18:12
-
-
Save Utshaw/de784edec14adbe2d745acae1789d9d4 to your computer and use it in GitHub Desktop.
centos8stream_repo_fix_auto_internet_connect
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/bash | |
| set -e | |
| echo "---- Removing all existing YUM repo files ----" | |
| sudo rm -f /etc/yum.repos.d/*.repo | |
| echo "---- Creating BaseOS repo ----" | |
| sudo tee /etc/yum.repos.d/CentOS-Stream-BaseOS.repo >/dev/null << 'EOF' | |
| [baseos] | |
| name=CentOS Stream 8 - BaseOS | |
| baseurl=https://vault.centos.org/8-stream/BaseOS/x86_64/os/ | |
| enabled=1 | |
| gpgcheck=0 | |
| EOF | |
| echo "---- Creating AppStream repo ----" | |
| sudo tee /etc/yum.repos.d/CentOS-Stream-AppStream.repo >/dev/null << 'EOF' | |
| [appstream] | |
| name=CentOS Stream 8 - AppStream | |
| baseurl=https://vault.centos.org/8-stream/AppStream/x86_64/os/ | |
| enabled=1 | |
| gpgcheck=0 | |
| EOF | |
| echo "---- Creating Extras repo ----" | |
| sudo tee /etc/yum.repos.d/CentOS-Stream-Extras.repo >/dev/null << 'EOF' | |
| [extras] | |
| name=CentOS Stream 8 - Extras | |
| baseurl=https://vault.centos.org/8-stream/extras/x86_64/os/ | |
| enabled=1 | |
| gpgcheck=0 | |
| EOF | |
| echo "---- Cleaning DNF cache ----" | |
| sudo dnf clean all | |
| sudo rm -rf /var/cache/dnf | |
| echo "---- Refreshing metadata ----" | |
| sudo dnf makecache --refresh | |
| echo "---- Done! Try: sudo dnf update ----" | |
| sudo nmcli connection modify "enp1s0" connection.autoconnect yes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment