1、yum 仓库 cs 架构:


2、yum 出问题的地方:

    client 配置文件

    yum cache (包的 meta data )

3、yum list 

yum clean all

yum repolist all 

yum repolist disabled 

yum remove sl

yum reinstall 

yum list *ftp*

yum update 

yum check-update

yum remove 


yum info bash

rpm -qi bash


yum provides bash

rpm -qf /bin/bash


yum  makecache 


yum search  

yum deplist 

yum hisrtory lsit 12 

yum hisrtory info 12 

yum history redo 12 

yum history undo 12 

yum install -y -q httpd 

yum remvoe -y -q httpd



/etc/yum.conf 
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.cent
os.org/bug_report_page.php?category=yum
distroverpkg=centos-release
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d


4、客户端配置yum 


[root@centos7 yum.repos.d]#vim base.repo 

[base]  #本地光盘

name=centos7 cdrom

baseurl=file:///misc/cd

gpgcheck=0

gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-CentOS-7 (校验:第一次暗转会有:importing gpg key blob.png

(yum instal autofs ; systemctl restart autofs ; systemctl enable autofs  开启 autos 服务)

#enabled =0禁用

[epel] #阿里epel

name=epel

baseurl=https://mirrors.aliyun.com/epel/7/x86_64/

#baseurl=https://mirrors.aliyun.com/epel/$releasever/$basearch/

gpgcheck=0

enabled=0 禁用仓库


5、编译二进制:

yum instal gcc 

[root@centos7 yum.repos.d]#cat hello.c 
#include 
int main(void)
{
   printf("hello,world\n");
}

[root@centos7 yum.repos.d]#gcc hello.c -o hello
[root@centos7 yum.repos.d]#./hello
hello,world


6、mirrorlist 

[root@centos7 yum.repos.d]#vim base.repo

[mirrorlist]
name=mirrorlist
mirrorlist=file:///etc/yum.repos.d/baselist 
gpgcheck=0

[root@centos7 yum.repos.d]#ll /etc/yum.repos.d/baselist

-rw-r--r-- 1 root root 74 Feb  2 16:27 /etc/yum.repos.d/baselist


7 ali repo/epel 


[root@centos7 yum.repos.d]#wget https://mirrors.aliyun.com/repo/Centos-7.repo

https://mirrors.aliyun.com/epel/7/x86_64/


8 history 

yum history 

yum history info 12 

blob.png

yum hisrtory lsit 12 

blob.png

yum history redo 12 

yum history undo 12 


9:

yum groupinstall "Development Tools"

yum grouplist 

yum groupinfo  "Development Tools"

yum groupremove "Development Tools"


10:create repo_data 

[root@centos7 yum.repos.d]#cp /misc/cd/Packages/httpd-2.4.6-80.el7.centos.x86_64.rpm  /data

[root@centos7 data] createrepo /data

[root@centos7 data]#ls

httpd-2.4.6-80.el7.centos.x86_64.rpm  repodata

vim /etc/yum.repos.d/base.repo

[test]

name=test

baseurl=file:///data

gpgcheck=0



11 :

yum 服务器;

server :192.168.30.102

cs:192.168.30.102/192.168.30.101

1、添加centos6/7 光盘

echo "- - - " > /sys/class/scsi_host/host2/scan

2、yum install httpd

3、[root@centos7 html]# mkdir centos/{6,7}/os/x86_64

mount /dev/sr0 centos/7/os/x86_64/

mount /dev/sr0 centos/6/os/x86_64/

blob.png

4、浏览器:http://192.168.30.102/centos/6/os/x86_64/


5、client 

[root@centos7 html]#vim /etc/yum.repos.d/base.repo

[base]

name=centos7 cdrom /cnetos6 cdrom  

baseurl=http://192.168.30.102/centos/$releasever/os/$basearch/gpgcheck=0

enabled=1