Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sed Script to update Yum Repo Data
#!/usr/bin/env sed -f
#grep ^metalink /etc/yum.repos.d/*
#grep ^mirrorlist /etc/yum.repos.d/*
#grep ^#base /etc/yum.repos.d/*
#grep ^base /etc/yum.repos.d/*
#grep ^base /etc/yum.repos.d/* | uniq -u
s/^metalink/#metalink/g
s/^mirrorlist/#mirrorlist/g
s/^#baseurl/baseurl/g
# For CentOS
s/baseurl=http\:\/\/mirror\.centos\.org\//baseurl=http\:\/\/mirrors\.kernel\.org\//g
s/baseurl=http\:\/\/vault\.centos\.org\/centos\//baseurl=http\:\/\/mirrors\.kernel\.org\//g
s/baseurl=http\:\/\/vault\.centos\.org\//baseurl=http\:\/\/mirrors\.kernel\.org\//g
s/baseurl=http\:\/\/debuginfo\.centos\.org\//baseurl=http\:\/\/mirrors\.kernel\.org\//g
# For Fedora or EPEL on CentOS 7
s/baseurl=http\:\/\/download\.fedoraproject\.org\/pub\//baseurl=http\:\/\/mirrors\.kernel\.org\//g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.