Skip to content

Instantly share code, notes, and snippets.

@pochi
Last active June 24, 2017 03:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pochi/6f874a19bc1f35195c1830d2669a1424 to your computer and use it in GitHub Desktop.
Save pochi/6f874a19bc1f35195c1830d2669a1424 to your computer and use it in GitHub Desktop.

作りかた

  • reposyncを利用して外部のリポジトリをコピー
  • createrepoを利用して内部のファイルサーバをリポジトリに
  • /etc/yum.repo.d/xxx.repo ファイルを作って内部リポジトリの設定を記載

reposync

  • すでにある外部レポジトリを全部持って来ればいいじゃないという考える
  • 対象サーバの/etc/yum.repo.dの中身をみてreposyncで指定する
$ reposync -p /var/www/html/ -r fedora12_64_updates

-r, –repoid: リポジトリの ID(※1)
-t, –tempcache: yum-cache にアクセスするときテンポラリディレクトリを使う
-p, –download_path: ダウンロードしたパッケージの保存先
-u, –urls: ダウンロード対象のパッケージの URL リストを表示する
-n, –newest-only: リポジトリごとに新しいパッケージだけダウンロードする
-q, –quiet: 出力メッセージを最小限にする
--arch : x86_64とかを指定する

createrepo

  • 指定されたパスにあるパッケージを、全部チェックして yum リポジトリに仕上げてくれる
$ createrepo /var/www/html/fedora12_64_updates

redhat on ec2 repo

blog

使えないようにする

$  yum-config-manager --disable rhui-REGION-rhel-server-rh-common
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment