Skip to content

Commit

Permalink
rpm: use baseurl explicitly
Browse files Browse the repository at this point in the history
It avoids the "Could not resolve host: mirrorlist.centos.org; Unknown
error".

Signed-off-by: Kentaro Hayashi <[email protected]>
  • Loading branch information
kenhys committed Jul 2, 2024
1 parent a443699 commit cd81df8
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fluent-package/yum/systemd-test/downgrade-to-v4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ case ${distribution} in
amazon)
curl -fsSL https://toolbelt.treasuredata.com/sh/install-amazon2-td-agent4.sh | sh
;;
centos)
sudo sed -i -e 's,^mirrorlist=,#mirrorlist,' /etc/yum.repos.d/CentOS-Base.repo
sudo sed -i -e 's,^#baseurl=http://mirror.centos.org/centos/\$releasever/,baseurl=http://ftp.iij.ad.jp/pub/linux/centos/7.9.2009/,' /etc/yum.repos.d/CentOS-Base.repo
cat /etc/yum.repos.d/CentOS-Base.repo
curl -fsSL https://toolbelt.treasuredata.com/sh/install-redhat-td-agent4.sh | sh
;;
*)
curl -fsSL https://toolbelt.treasuredata.com/sh/install-redhat-td-agent4.sh | sh
;;
Expand Down
8 changes: 8 additions & 0 deletions fluent-package/yum/systemd-test/install-newly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ set -exu

. $(dirname $0)/commonvar.sh

case $DISTRIBUTION in
centos)
sudo sed -i -e 's,^mirrorlist=,#mirrorlist,' /etc/yum.repos.d/CentOS-Base.repo
sudo sed -i -e 's,^#baseurl=http://mirror.centos.org/centos/\$releasever/,baseurl=http://ftp.iij.ad.jp/pub/linux/centos/7.9.2009/,' /etc/yum.repos.d/CentOS-Base.repo
cat /etc/yum.repos.d/CentOS-Base.repo
;;
esac

case $1 in
local)
sudo $DNF install -y \
Expand Down
5 changes: 5 additions & 0 deletions fluent-package/yum/systemd-test/update-from-v4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ gpgkey=https://packages.treasuredata.com/GPG-KEY-td-agent
EOF
sudo mv td.repo /etc/yum.repos.d/
;;
centos)
sudo sed -i -e 's,^mirrorlist=,#mirrorlist,' /etc/yum.repos.d/CentOS-Base.repo
sudo sed -i -e 's,^#baseurl=http://mirror.centos.org/centos/\$releasever/,baseurl=http://ftp.iij.ad.jp/pub/linux/centos/7.9.2009/,' /etc/yum.repos.d/CentOS-Base.repo
cat /etc/yum.repos.d/CentOS-Base.repo
;;
*)
cat > td.repo <<'EOF';
[treasuredata]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ gpgkey=https://packages.treasuredata.com/GPG-KEY-td-agent
EOF
sudo mv td.repo /etc/yum.repos.d/
;;
centos)
sudo sed -i -e 's,^mirrorlist=,#mirrorlist,' /etc/yum.repos.d/CentOS-Base.repo
sudo sed -i -e 's,^#baseurl=http://mirror.centos.org/centos/\$releasever/,baseurl=http://ftp.iij.ad.jp/pub/linux/centos/7.9.2009/,' /etc/yum.repos.d/CentOS-Base.repo
cat /etc/yum.repos.d/CentOS-Base.repo
;;
*)
cat > td.repo <<'EOF';
[treasuredata]
Expand Down
7 changes: 7 additions & 0 deletions fluent-package/yum/systemd-test/update-to-next-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ case $distribution in
;;
esac
;;
centos)
sudo sed -i -e 's,^mirrorlist=,#mirrorlist,' /etc/yum.repos.d/CentOS-Base.repo
sudo sed -i -e 's,^#baseurl=http://mirror.centos.org/centos/\$releasever/,baseurl=http://ftp.iij.ad.jp/pub/linux/centos/7.9.2009/,' /etc/yum.repos.d/CentOS-Base.repo
cat /etc/yum.repos.d/CentOS-Base.repo
sudo $DNF install -y epel-release
sudo $DNF install -y rpmrebuild
;;
*)
sudo $DNF install -y epel-release
sudo $DNF install -y rpmrebuild
Expand Down

0 comments on commit cd81df8

Please sign in to comment.