Linux yum的配置使用和程序包的编译安装(2)

[repositoryID] #具有唯一性 name=some name for this repository baseurl=url://path/to/repository #yum repository的url可以为多个,路径下必须有repodata enable=1 #是否开启,1为开启,0为关闭,不写的话,默认开启 gpgckeck=1 gpgkey=URL cost=1000 enablegroup=1 #是否允许使用包组,默认是允许

 

但是我们可以看到CentOS-Base.repo里面没有baseurl而是mirrorlist,mirrorlist指向的URL就是存放了baseurl的位置。

yum的repo配置文件中的可用的变量:

$releasever:当前os的发行版的主版本号 $arch:平台 $basearch:基础平台 $YUM0-$YUM9:用户自定义的变量

yum命令的用法

yum [options] [command] [package ...] command is one of: * install package1 [package2] [...] * update [package1] [package2] [...] * update-to [package1] [package2] [...] * update-minimal [package1] [package2] [...] * check-update * upgrade [package1] [package2] [...] * upgrade-to [package1] [package2] [...] * distribution-synchronization [package1] [package2] [...] * remove | erase package1 [package2] [...] * autoremove [package1] [...] * list [...] * info [...] * provides | whatprovides feature1 [feature2] [...] * clean [ packages | metadata | expire-cache | rpmdb | plugins | all ] * makecache [fast] * groups [...] * search string1 [string2] [...] * shell [filename] * resolvedep dep1 [dep2] [...] (maintained for legacy reasons only - use repoquery or yum provides) * localinstall rpmfile1 [rpmfile2] [...] (maintained for legacy reasons only - use install) * localupdate rpmfile1 [rpmfile2] [...] (maintained for legacy reasons only - use update) * reinstall package1 [package2] [...] * downgrade package1 [package2] [...] * deplist package1 [package2] [...] * repolist [all|enabled|disabled] * repoinfo [all|enabled|disabled] * repository-packages <enabled-repoid> <install|remove|remove-or-reinstall|remove-or-

yum命令

1.显示repository列表:

repolist [all|enabled|disabled] all:显示所有的yum repository enable:不带参数默认显示启用的yum repository disable:显示关闭的yum repository

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/13477.html