Linux-CentOs7 Yum源配置
Linux安装服务是以rpm包的方式安装的,然而rpm的包之间存在依赖关系,如果使用rmp包安装服务,就会出现A包依赖B包,B包依赖C包的无限循环。[root@k8s1 yum.repos.d]#yum list| more--查看rpm包。[root@k8s1 yum.repos.d]# yum clean all--清理本地yum源。[root@k8s1 yum.repos.d]# yum m
1、什么是Linux Yum源?
Yum(全称为 Yellow dog Updater, Modified )是一个rmp包管理器。Linux安装服务是以rpm包的方式安装的,然而rpm的包之间存在依赖关系,如果使用rmp包安装服务,就会出现A包依赖B包,B包依赖C包的无限循环。
2、为何要配置本地配置Yum源?
在商用环境中,服务器集群往往是不允许连接到外网的,所以无法使用网络YUM源,需要自己配置。
3、配置步骤
挂载Linux镜像
[root@k8s1 ~]# mkdir /mnt/cdrom
[root@k8s1 ~]# mount -t iso9660 -o loop /dev/cdrom /mnt/cdrom
[root@k8s1 Packages]# pwd -查看挂载目录下得rpm包
/mnt/cdrom/Packages
[root@k8s1 Packages]# ls -lrt | more
total 3993900
-rw-rw-r--. 3 root root 148020 Jul 4 2014 agg-2.5-18.el7.x86_64.rpm
-rw-rw-r--. 21 root root 23548 Jul 4 2014 aic94xx-firmware-30-6.el7.noarch.rpm
-rw-rw-r--. 3 root root 742196 Jul 4 2014 akonadi-1.9.2-4.el7.x86_64.rpm
-rw-rw-r--. 3 root root 15872 Jul 4 2014 akonadi-mysql-1.9.2-4.el7.x86_64.rpm
-rw-rw-r--. 13 root root 365776 Jul 4 2014 antlr-tool-2.7.7-30.el7.noarch.rpm
-rw-rw-r--. 13 root root 51704 Jul 4 2014 apache-commons-cli-1.2-13.el7.noarch.rpm
-----------------------------------------------------------------------------------------------------------------------
虚拟机mount光驱
[root@master mnt]# mount /dev/cdrom /mnt/iso/
mount: /dev/sr0 is write-protected, mounting read-onl
-----------------------------------------------------------------------------------------------------------------------
配置本地YUM源
cd /etc/yum.repos.d
[root@k8s1 yum.repos.d]# more CentOS-Base.repo
[localyum]
name=CentOS7
baseurl=file:///mnt/cdrom/
gpgcheck=0
执行检查命令
[root@k8s1 yum.repos.d]# yum clean all --清理本地yum源
Loaded plugins: fastestmirror, langpacks
Cleaning repos: localyum
Cleaning up list of fastest mirrors
[root@k8s1 yum.repos.d]# yum makecache --重新加载
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
localyum | 3.6 kB 00:00:00
(1/4): localyum/group_gz | 153 kB 00:00:00
(2/4): localyum/filelists_db | 3.3 MB 00:00:00
(3/4): localyum/primary_db | 3.3 MB 00:00:00
(4/4): localyum/other_db | 1.3 MB 00:00:00
Metadata Cache Created
[root@k8s1 yum.repos.d]#
[root@k8s1 yum.repos.d]# yum list | more --查看rpm包
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Installed Packages
GConf2.x86_64 3.2.6-8.el7 @anaconda
GeoIP.x86_64 1.5.0-14.el7 @anaconda
LibRaw.x86_64 0.19.4-1.el7 @anaconda
ModemManager.x86_64 1.6.10-4.el7 @anaconda
ModemManager-glib.x86_64 1.6.10-4.el7 @anaconda
4、使用YUM安装FTP服务
root@k8s1 yum.repos.d]# yum -y install ftp
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package ftp.x86_64 0:0.17-67.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===================================================================================================
Package Arch Version Repository Size
===================================================================================================
Installing:
ftp x86_64 0.17-67.el7 localyum 61 k
Transaction Summary
===================================================================================================
Install 1 Package
Total download size: 61 k
Installed size: 96 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : ftp-0.17-67.el7.x86_64 1/1
Verifying : ftp-0.17-67.el7.x86_64 1/1
Installed:
ftp.x86_64 0:0.17-67.el7
Complete!
[root@k8s1 yum.repos.d]#
配置网络yum源
更多推荐
所有评论(0)