Linux/yum
Posted qianxiamo
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux/yum相关的知识,希望对你有一定的参考价值。
作业六:yum命令
1) 自定义yum仓库:createrepo
[[email protected] /]#mkdir /rpm_bak
[[email protected] /]#cp /media/Packages/apr-* /rpm_bak/
[[email protected] /]#cp /media/Packages/mailcap-2.1.41-2.el7.noarch.rpm /rpm_bak/
[[email protected] /]#cp /media/Packages/httpd-2.4.6-40.el7.centos.x86_64.rpm /rpm_bak/
[[email protected] /]# createrepo /rpm_bak/
Spawning worker 0 with 17 pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
[[email protected] rpm_bak]# ls -l /rpm_bak
出现repodata目录
drwxr-xr-x. 2 root root 4096 3月 17 18:41 repodata
2) 自定义repo文件
[[email protected] yum.repos.d]# pwd
/etc/yum.repos.d
[[email protected] yum.repos.d]# cat local.repo
[local]
name=local repo
baseurl=file:///rpm_bak
enabled=1
gpgcheck=0
3) 使用yum命令安装httpd软件包
安装:
yum install httpd -y
4) 卸载httpd软件包:yum –y remove 软件名
yum –y remove httpd
yum -y erase httpd
5) 使用yum安装组件‘KDE 桌面‘:yum –y groupinstall 组件名
[[email protected] yum.repos.d]# cat local.repo
[local]
name=local repo
baseurl=file:///media
enabled=1
gpgcheck=0
[[email protected] yum.repos.d]# yum clean all
[[email protected] yum.repos.d]# yum grouplist
[[email protected] yum.repos.d]# yum -y groupinstall "KDE Plasma Workspaces"
[[email protected] yum.repos.d]# yum -y groupinstall "虚拟化主机"
6) 掌握使用yum删除组件‘KDE 桌面’:yum –y groupremove 组件名
[[email protected] yum.repos.d]# yum -y groupremove "虚拟化主机"
7) 掌握清除yum缓存:yum clean all
[[email protected] yum.repos.d]# yum clean all
已加载插件:fastestmirror, langpacks
正在清理软件源: local
Cleaning up everything
Cleaning up list of fastest mirrors
8) 使用yum查找软件包:yum search 软件包名
[[email protected] yum.repos.d]# yum search httpd
以上是关于Linux/yum的主要内容,如果未能解决你的问题,请参考以下文章