[root@localhost yum.repos.d]# pwd
/etc/yum.repos.d
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# ls
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# cat CentOS-Media.repo
[c7-media]
name=CentOS-$releasever - Media
baseurl=file:///media/CentOS/
file:///media/cdrom/
file:///media/cdrecorder/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# mkdir /media/cdrom
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# mount /dev/cdrom /media/cdrom/
mount: /dev/sr0 is write-protected, mounting read-only
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# ls /media/cdrom/
CentOS_BuildTag GPL LiveOS RPM-GPG-KEY-CentOS-7
EFI images Packages RPM-GPG-KEY-CentOS-Testing-7
EULA isolinux repodata TRANS.TBL
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# yum --disablerepo=* --enablerepo=c7-media list
Loaded plugins: fastestmirror, langpacks
file:///media/CentOS/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /media/CentOS/repodata/repomd.xml"
Trying other mirror.
c7-media | 3.6 kB 00:00
c7-media/group_gz FAILED
file:///media/CentOS/repodata/436345f4b666f0a461d479ccfabc2c22823d4f2173c2653e5250fea62f0afe98-c7-x86_64-comps.xml.gz: [Errno 14] curl#37 - "Couldn't open file /media/CentOS/repodata/436345f4b666f0a461d479ccfabc2c22823d4f2173c2653e5250fea62f0afe98-c7-x86_64-comps.xml.gz"
Trying other mirror.
c7-media/group_gz FAILED
file:///media/cdrecorder/repodata/436345f4b666f0a461d479ccfabc2c22823d4f2173c2653e5250fea62f0afe98-c7-x86_64-comps.xml.gz: [Errno 14] curl#37 - "Couldn't open file /media/cdrecorder/repodata/436345f4b666f0a461d479ccfabc2c22823d4f2173c2653e5250fea62f0afe98-c7-x86_64-comps.xml.gz"
Trying other mirror.
(1/2): c7-media/group_gz | 155 kB 00:00
(2/2): c7-media/primary_db | 2.8 MB 00:00
Loading mirror speeds from cached hostfile
* c7-media:
Installed Packages
GConf2.x86_64 3.2.6-8.el7 @anaconda
ModemManager.x86_64 1.1.0-8.git20130913.el7 @anaconda
ModemManager-glib.x86_64 1.1.0-8.git20130913.el7 @anaconda
NetworkManager.x86_64 1:1.0.6-27.el7 @anaconda
NetworkManager-adsl.x86_64 1:1.0.6-27.el7 @anaconda
NetworkManager-glib.x86_64 1:1.0.6-27.el7 @anaconda
NetworkManager-libnm.x86_64 1:1.0.6-27.el7 @anaconda
~~~
[root@localhost yum.repos.d]# yum --disablerepo=* --enablerepo=c7-media install -y git
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* c7-media:
Resolving Dependencies
--> Running transaction check
---> Package git.x86_64 0:1.8.3.1-5.el7 will be installed
--> Processing Dependency: perl-Git = 1.8.3.1-5.el7 for package: git-1.8.3.1-5.el7.x86_64
--> Processing Dependency: perl(Term::ReadKey) for package: git-1.8.3.1-5.el7.x86_64
--> Processing Dependency: perl(Git) for package: git-1.8.3.1-5.el7.x86_64
--> Processing Dependency: perl(Error) for package: git-1.8.3.1-5.el7.x86_64
--> Running transaction check
---> Package perl-Error.noarch 1:0.17020-2.el7 will be installed
---> Package perl-Git.noarch 0:1.8.3.1-5.el7 will be installed
---> Package perl-TermReadKey.x86_64 0:2.30-20.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
git x86_64 1.8.3.1-5.el7 c7-media 4.3 M
Installing for dependencies:
perl-Error noarch 1:0.17020-2.el7 c7-media 32 k
perl-Git noarch 1.8.3.1-5.el7 c7-media 53 k
perl-TermReadKey x86_64 2.30-20.el7 c7-media 31 k
Transaction Summary
================================================================================
Install 1 Package (+3 Dependent packages)
Total download size: 4.4 M
Installed size: 22 M
Downloading packages:
warning: /media/cdrom/Packages/git-1.8.3.1-5.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Public key for git-1.8.3.1-5.el7.x86_64.rpm is not installed
--------------------------------------------------------------------------------
Total 12 MB/s | 4.4 MB 00:00
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
Userid : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
Package : centos-release-7-2.1511.el7.centos.2.10.x86_64 (@anaconda)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 1:perl-Error-0.17020-2.el7.noarch 1/4
Installing : perl-TermReadKey-2.30-20.el7.x86_64 2/4
Installing : perl-Git-1.8.3.1-5.el7.noarch 3/4
Installing : git-1.8.3.1-5.el7.x86_64 4/4
Verifying : git-1.8.3.1-5.el7.x86_64 1/4
Verifying : 1:perl-Error-0.17020-2.el7.noarch 2/4
Verifying : perl-Git-1.8.3.1-5.el7.noarch 3/4
Verifying : perl-TermReadKey-2.30-20.el7.x86_64 4/4
Installed:
git.x86_64 0:1.8.3.1-5.el7
Dependency Installed:
perl-Error.noarch 1:0.17020-2.el7 perl-Git.noarch 0:1.8.3.1-5.el7
perl-TermReadKey.x86_64 0:2.30-20.el7
Complete!
[root@localhost yum.repos.d]