2
3

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 5 years have passed since last update.

GitHubに自作yumリポジトリを公開する方法

Posted at

GitHubに自作yumリポジトリを公開する方法

概要

自作したRPMパッケージをGitHubに公開することで保守・管理が容易になると思った。

1. 環境

  • CentOS6.x
  • GitHubアカウント取得済

2. 手順の概要

  1. createrepoのインストール
  2. GitHub上にリポジトリの作成
  3. yumリポジトリ用ディレクトリの作成
  4. yumリポジトリの作成
  5. repoファイルの作成
  6. 動作確認

3. 詳細手順

1. createrepoのインストール

# yum install createrepo

2. GitHub上にリポジトリの作成

GitHub上にリポジトリを作成する

3. yumリポジトリ用ディレクトリの作成

# git clone <作成したリポジトリのURL>

4. yumリポジトリの作成

ここでは rpm.repo がリポジトリ名とする

# mkdir -p rpm.repo/el6/
# cp -p *rpm rpm.repo/el6/
# createrepo rpm.repo/el6/
# git push origin master
5. repoファイル作成
# vi /etc/yum.repos.d/<リポジトリ名(任意)>.repo

以下とした

[<リポジトリID任意)]
name=リポジトリ名(任意)
baseurl=https://github.com/<GitHubアカウント名>/rpm.repo/raw/master/el6/
enabled=1
gpgcheck=0

6. 動作確認

# yum clean all
# yum repolist

以下を確認

  • 作成したリポジトリID、リポジトリ名が表示されること
  • 状態にリポジトリに含めたRPMパッケージ数が表示されること
2
3
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
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?