标题:
rpm、yum、编译安装轻松管理centos7程序包(21)
[打印本页]
作者:
look_w
时间:
2019-2-18 20:29
标题:
rpm、yum、编译安装轻松管理centos7程序包(21)
四、自建yum仓库
使用createrepo命令建立repodata文件从而处理程序包的依赖关系
createrepo [options] <directory>
1、创建仓库
# yum install createrepo -y
# ll
total 0
drwxr-xr-x 4 root root 33 Mar 19 21:49 xen4
# ls xen4/
drpms Packages
# createrepo xen4/
Spawning worker 0 with 159 pkgs
Spawning worker 1 with 159 pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
# ls xen4/
drpms Packages repodata
2、指向仓库
# cat /etc/yum.repos.d/xen.repo
[xen4]
name=this is a xen
baseurl=file:///opt/xzen4
gpgcheck=0
# yum install xen -y
Loaded plugins: fastestmirror, langpacks
xzen4 | 2.9 kB 00:00:00
xzen4/primary_db | 172 kB 00:00:00
Determining fastest mirrors
Resolving Dependencies
--> Running transaction check
---> Package xen.x86_64 0:4.2.4-30.el6.centos.alt will be installed
--> Processing Dependency: xen-runtime = 4.2.4-30.el6.centos.alt for package: xen-4.2.4-30.el6.centos.alt.x86_64
.............
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/)
Powered by Discuz! 7.0.0