linux yum 使用,linux yum 使用

一、配置

yum 配置

主配置文件 /etc/yum.conf

资源库配置目录 /etc/yum.repos.d

[root@localhost doudou]# ls /etc/yum.repos.d/

CentOS-Base.repo CentOS-Media.repo CentOS-Vault.repo remi-glpi92.repo remi-php54.repo remi-php73.repo

CentOS-CR.repo CentOS-SCLo-scl.repo epel.repo remi-glpi93.repo remi-php70.repo remi-php74.repo

CentOS-Debuginfo.repo CentOS-SCLo-scl-rh.repo epel-testing.repo remi-glpi94.repo remi-php71.repo remi.repo

CentOS-fasttrack.repo CentOS-Sources.repo remi-glpi91.repo remi-modular.repo remi-php72.repo remi-safe.repo

[root@localhost doudou]#

默认的yun源CentOS-Base.repo 文件说明,

[base]

name=CentOS-$releasever - Base

# name 就是发行版的名称,其格式标示“操作系统名称和释出版本”,

# base 表明此段寻找的是base包。

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra

#mirrorlist yum在网络上查找升级文件的RUL.

# $basearch 代表机器的硬件架构,i386,x86_64等。

#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/

gpgcheck=1

enabled=1 ,1生效,0停用。没有enabled同等生效。

# 标示是否启用gpg检查,1启用,0不启用。

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#released updates

#本段是更新模块用到的配置。

[updates]

name=CentOS-$releasever - Updates

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra

#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful

# 本段指定的是有用的额外软件包部分配置

[extras]

name=CentOS-$releasever - Extras

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra

#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages

# 本段指定的是扩展的额外软件包部分配置

[centosplus]

name=CentOS-$releasever - Plus

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra

#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/

gpgcheck=1

enabled=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

二、查询功能

[--enablerepo=remi ] 在指定的包源操作

yum [--enablerepo=remi ] search httpd //搜索某个软件名称或者描述的重要关键字

yum info httpd //列出软件功能

yum list //列出yum服务器上面所有的软件名称

yum list htpd* //找出以pam开头的软件名称

yum list updates //列出yum服务器上可提供本机进行升级的软件

yum list installed 列出所有已安装的包

yum list extras 列出所有已安装但不在资源库中的包

yum list | grep httpd 管道符查询特定包

三、安装

[--enablerepo=remi]在指定的源搜索安装软件

yum [--enablerepo=remi] install

yum install httpd

四、 删除

yum remove httpd

五、检查更新

yum check-update httpd 检查更新,不执行更新

yum update 更新所有包,不推荐使用。

yum update httpd 更新指定包。

软件组功能

yum grouplist //查看容器和本机上可用与安装过的软件组

yum groupinfo group_name //查看group内所有组名称

yum install/remove group_name //安装与删除

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值