4
4

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.

yumリポジトリをローカルに設定する方法

Posted at

商用環境だと、外に接続できないときがあります。
そんなときにISOイメージをyumのリポジトリとして使う方法があります。

では早速設定してみます。
動作環境は、以下の通り
Scientific Linux 6.4

リポジトリ設定

/etc/yum.repos.d/sl-media.repo
[sl-media]
Name=Scientific Linux $releasever $basearch Media
baseurl=file:///mnt
gpgcheck=1
enable=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-sl file:///etc/pki/rpm-gpg/RPM-GPG-KEY-sl6 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-cern

IOSのマウント

bash
# mount -o loop /var/kvm/iso/SL-64-x86_64-2013-03-18-Install-DVD.iso /mnt/

確認

bash
# yum repolist
Loaded plugins: security
repo id                                      repo name                                                              status
sl-media                                     Scientific Linux 6.4 x86_64 Media                                      4,003
repolist: 4,003

yum installしてみる

bash
# yum install sysstat
Loaded plugins: security
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package sysstat.x86_64 0:9.0.4-20.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==========================================================================================================================
 Package                    Arch                      Version                           Repository                   Size
==========================================================================================================================
Installing:
 sysstat                    x86_64                    9.0.4-20.el6                      sl-media                    224 k

Transaction Summary
==========================================================================================================================
Install       1 Package(s)

Total download size: 224 k
Installed size: 807 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : sysstat-9.0.4-20.el6.x86_64                                                                            1/1
  Verifying  : sysstat-9.0.4-20.el6.x86_64                                                                            1/1

Installed:
  sysstat.x86_64 0:9.0.4-20.el6

Complete!
4
4
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
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?