前作った奴とはディレクトリ配置が変わっていたので修正。
ベタで書く方法しか思い浮かばない。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#!/bin/sh
yum install yum-priorities -y
cd /tmp
export arc=`uname -i`
export rpmforge_Packname=`wget http://apt.sw.be/redhat/el5/en/${arc}/dag/RPMS/ -O - |grep rpmforge-release | awk -F"${arc}.rpm\"<" '{print $2}' |cut -d'>' -f 1`
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
for rpm in $rpmforge_Packname
do
wget http://apt.sw.be/redhat/el5/en/${arc}/dag/RPMS/${rpm}
yum install ${rpmforge_Packname} -y
done
cat <<EOF> /etc/yum.repos.d/rpmforge.repo
# Name: RPMforge RPM Repository for Red Hat Enterprise 5 - dag
# URL: http://rpmforge.net/
[rpmforge]
name = Red Hat Enterprise $releasever - RPMforge.net - dag
#baseurl = http://apt.sw.be/redhat/el5/en/$basearch/dag
mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 0
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
EOF
|
以下の方がいいかも(2014/11/03)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#!/bin/sh
VERSION="6"
yum install yum-priorities -y
cd /tmp
export arc=`uname -i`
export rpmforge_Packname=`wget http://apt.sw.be/redhat/el${VERSION}/en/${arc}/dag/RPMS/ -O - |grep -o rpmforge-release.*.rpm |cut -d'"' -f 1 | sort | tail -n 1`
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
for rpm in $rpmforge_Packname
do
wget http://apt.sw.be/redhat/el${VERSION}/en/${arc}/dag/RPMS/${rpm}
yum install ${rpmforge_Packname} -y
done
cat <<EOF> /etc/yum.repos.d/rpmforge.repo
# Name: RPMforge RPM Repository for Red Hat Enterprise ${VERSION} - dag
# URL: http://rpmforge.net/
[rpmforge]
name = Red Hat Enterprise $releasever - RPMforge.net - dag
#baseurl = http://apt.sw.be/redhat/el${VERSION}/en/$basearch/dag
mirrorlist = http://apt.sw.be/redhat/el${VERSION}/en/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 0
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
|