Skip to content

Instantly share code, notes, and snippets.

@momijiame
Created July 30, 2012 06:24
Show Gist options
  • Save momijiame/3205303 to your computer and use it in GitHub Desktop.
Save momijiame/3205303 to your computer and use it in GitHub Desktop.
CentOS6 version lock script
#!/bin/sh
set -x
set -e
VERSION=6.2
cd /etc/yum.repos.d
cp CentOS-Base.repo{,.orig}
sed -i "s/\$releasever/${VERSION}/" CentOS-Base.repo
sed -i "s/^mirrorlist/#mirrorlist/" CentOS-Base.repo
sed -i "s/^#baseurl/baseurl/" CentOS-Base.repo
sed -i "s/mirror.centos.org\/centos/vault.centos.org/" CentOS-Base.repo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment