2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

CentOS8でdnfレポジトリサーバを構築したい

Posted at

はじめに

ローカルで仮想マシンを構築するとき、yum updateなどで時間がかかるのでローカルにyumレポジトリを構築したいと思います。

実行環境

OS : CentOS 8

インストール

# dnf install -y  httpd createrepo rsync

webサーバの設定

# systemctl start httpd
# systemctl enable httpd
# firewall-cmd --zone=public --add-service=http --permanent
# firewall-cmd --reload
# echo '<directory "/var/www/html/centos">' > /etc/httpd/conf.d/centos-mirror.conf
# echo 'option +indexes' >> /etc/httpd/conf.d/centos-mirror.conf
# echo '</directory>' >> /etc/httpd/conf.d/centos-mirror.conf

ディレクトリ作成

# mkdir -p /var/www/html/centos/8/{AppStream,BaseOS}/x86_64/os/

レポジトリ作成

# rsync -rtpv --delete rsync://ftp.riken.jp/centos/8/AppStream/x86_64/os/ /var/www/html/centos/8/AppStream/x86_64/os/
# rsync -rtpv --delete rsync://ftp.riken.jp/centos/8/BaseOS/x86_64/os/ /var/www/html/centos/8/BaseOS/x86_64/os/

おまけ

今回作成したディレクトリのサイズを確認してみました

# du -sh /var/www/html/*
9.7G /var/www/html/centos

おわりに

dnfはyumと違って構築が面倒かと思ったんですけどそうでもなかったですね。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?