1.制作YUM源
先关闭相关安全设置,安装vsftpd

[root@rhel7 ~]# firewall-cmd --set-default-zone=trusted  设置防火墙受信
[root@rhel7 ~]# setenforce 0
[root@rhel7 ~]# systemctl start vsftpd 启动已经安装的vsftpd
[root@rhel7 ~]# systemctl enable vsftpd
[root@rhel7 ~]# ls /var/ftp/ 共享目录
pub

挂载到共享目录

[root@rhel7 ~]# mkdir /var/ftp/dvd
[root@rhel7 ~]# umount /mnt
[root@rhel7 ~]# mount /dev/cdrom /var/ftp/dvd/
mount: /dev/sr0 is write-protected, mounting read-only
[root@rhel7 ~]# ls /var/ftp/dvd/
addons GPL LiveOS release-notes RPM-GPG-KEY-redhat-release
EFI images media.repo repodata TRANS.TBL
EULA isolinux Packages RPM-GPG-KEY-redhat-beta
[root@rhel7 ~]# rm -rf /var/ftp/pub/

对新增的安装包目录生成包的元数据(把包中依赖关系统计)

createrepo -v 目录 (会在目录下生成一个repodata的原数据信息)

配置yum路径特性

[root@rhel7 ~]# cat /etc/yum.repos.d/file.repo
[dvd]
name=dvd
baseurl=ftp://192.168.56.133/dvd
enabled=1
gpgcheck=0

生成yum

[root@rhel7 ~]# yum clean all
[root@rhel7 ~]# yum makecache

2.YUM命令简单使用
查询安装包

[root@rhel7 ~]# yum search vsftpd
vsftpd.x86_64 : Very Secure Ftp Daemon
[root@rhel7 ~]# yum list vsftpd 可以知道包的安装情况
vsftpd.x86_64 3.0.2-9.el7 installe

清除提示信息

[root@rhel7 ~]# yum list subscript*
Loaded plugins: product-id, subscription-manager #redhat系统是免费使用的,但是服务是收费的
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
[root@rhel7 ~]# yum remove subscript* -y

查找命令对应的安装包----常用

[root@rhel7 ~]# yum whatprovides */ifconfig   #*/是因为包安装完后,会放在各个不同目录下,这里是可能在那个目录下
net-tools-2.0-0.17.20131004git.el7.x86_64 : Basic networking tools
Repo : dvd
Matched from:
Filename : /sbin/ifconfig

要实现某个功能,这个功能是由很多个包组成

[root@rhel7 ~]# yum grouplist
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Available environment groups:
Minimal Install
Infrastructure Server
File and Print Server
Basic Web Server
Virtualization Host
Server with GUI
Available Groups:
Compatibility Libraries
Console Internet Tools
Development Tools
Graphical Administration Tools
Legacy UNIX Compatibility
Scientific Support
Security Tools
Smart Card Support
System Administration Tools
System Management
Done
[root@rhel7 ~]# yum grouplist virtual*
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Available environment groups:
Virtualization Host
Done
[root@rhel7 ~]# yum groupinstall virtual* -y

禁用yum源

[root@rhel7 ~]# yum list ceph --disablerepo=ceph
[root@rhel7 ~]# yum list ceph --disablerepo=* --enablerepo=ceph 禁用所有源,只使用ceph

安装时设置下载包存放的路径(需要搭建本地源时,可以下载所有包)

[root@rhel7 ~]# yum install ceph -y --downloaddir=/opt --downonly #下载到/opt,只是下载

yum报错:Bad id for repo

“[centos - updates]”的格式不对,“centos”,“-”,“updates”之间是不允许存在空格的,删除即可。

  

最新文章

  1. Android自定义控件之基本原理
  2. python 小练手
  3. Java面试题汇总(一)
  4. IIS32位,64位模式下切换
  5. [转] Android OkHttp完全解析 是时候来了解OkHttp了
  6. Java库使用----xstream1.3.1
  7. Oracle学习之常见错误整理
  8. VC,一条会被鼠标移动的直线
  9. (N叉树 DFS 递归 BFS) leetcode 559. Maximum Depth of N-ary Tree
  10. 一键分享代码(提供能分享到QQ空间、新浪微博、人人网等的分享功能)
  11. Python——列表、元祖、字典 操作方法
  12. using 关键字的作用
  13. pt-table-checksum 使用实践
  14. 堆叠箱子(基础dp)
  15. Direct2D教程VII——变换几何(TransformedGeometry)对象
  16. Python 图像下载解决图像损坏
  17. e565. 关闭的时候隐藏窗口
  18. Dynamics CRM 2011 报表无法显示的问题总结
  19. Winter-1-D Max Sum 解题报告及测试数据
  20. 关于jQuery获得表单radio类型输入框的选中值

热门文章

  1. CodeForces 29D Ant on the Tree
  2. windows--OSError: [Errno 22] Invalid argument: '\u202aE:/desk/Desktop/test.txt' 读取文件的坑
  3. 【redis】redis应用场景,缓存的各种问题
  4. 浅析runtime包中的三个方法Gosched、Goexit、GOMAXPROCS
  5. 关于GIS中Scale和Resolution的那些事儿
  6. python 38 线程队列与协程
  7. Springboot源码分析之事务拦截和管理
  8. HDU 6059
  9. Scala 系列(十二)—— 类型参数
  10. CodeForces round 520 div2