13
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

yumdownloaderでソースrpmをダウンロードする

Last updated at Posted at 2014-06-15

環境

$ cat /etc/centos-release
CentOS release 6.5 (Final)

手順

yum-utilsのインストール

$ sudo yum install yum-utils

ソースrpm用リポジトリの追加

拡張子が*.repoならロードされるので、既存ファイルを書き換えなくてもファイルの追加でOK。
バージョンを動的に指定する方法がわからなかったので、今回はとりあえず決め打ちで。

/etc/yum.repos.d/CentOS-Base-Src-6.5.repo
[base-src]
name=CentOS-6.5 - Base - Source
baseurl=http://vault.centos.org/6.5/os/Source/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#released updates
[updates-src]
name=CentOS-6.5 - Updates - Source
baseurl=http://vault.centos.org/6.5/updates/Source/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful
[extras-src]
name=CentOS-6.5 - Extras - Source
baseurl=http://vault.centos.org/6.5/extras/Source/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

リポジトリがされたことを確認。

$ yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: www.ftp.ne.jp
 * extras: www.ftp.ne.jp
 * updates: www.ftp.ne.jp
repo id                               repo name                                               status
base                                  CentOS-6 - Base                                         4,802
base-src                              CentOS-6.5 - Base - Source                              2,132
extras                                CentOS-6 - Extras                                          12
extras-src                            CentOS-6.5 - Extras - Source                                9
updates                               CentOS-6 - Updates                                        745
updates-src                           CentOS-6.5 - Updates - Source                             200
repolist: 7,900

ソースrpmのダウンロード

yumdownloaderコマンドでソースrpmをダウンロードする。

$ yumdownloader --source neon
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: www.ftp.ne.jp
 * extras: www.ftp.ne.jp
 * updates: www.ftp.ne.jp
neon-0.29.3-3.el6_4.src.rpm                                                  | 875 kB     00:02

参考

13
15
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
13
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?