Та же проблема,
#rpm -q centos-release
centos-release-4-4.3
Попробуйте изменить ваш /etc/yum.repos.d/CentOS-Base.repo этим: http://vault.centos.org/4.8/CentOS-Base.repo
У меня сработало.
Попробуйте это,
awk '/^$/{comm=0}{if($1~/^#/){comm=1}else{if(comm){$1="# "$1}} print}' file
или то же самое в полной форме:
awk '
# reset on empty line
/^$/{comm=0}
{
if ($1~/^#/) {
# start commenting lines when # found
comm=1
}
else {
# comment lines not starting with #
if (comm){ $1="# "$1 }
}
print
}
' file