CentOS6.4建立本地yum源



Linux安装见如下文章:

http://alipay.blog.51cto.com/7119970/1542040


挂在光盘见如下文章:

http://alipay.blog.51cto.com/7119970/1542659



[root@rhel64 ~]# mount /dev/cdrom /mnt

mount: block device /dev/sr0 is write-protected, mounting read-only

[root@rhel64 ~]# mkdir /home/yum

[root@rhel64 ~]# cp -rf /mnt/Packages/* /home/yum/

[root@rhel64 ~]# rpm -ivh /home/yum/deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm

warning: /home/yum/deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY

Preparing...                ########################################### [100%]

   1:deltarpm               ########################################### [100%]

[root@rhel64 ~]# rpm -ivh /home/yum/python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm

warning: /home/yum/python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY

Preparing...                ########################################### [100%]

   1:python-deltarpm        ########################################### [100%]

[root@rhel64 ~]# rpm -ivh /home/yum/createrepo-0.9.9-18.el6.noarch.rpm 

warning: /home/yum/createrepo-0.9.9-18.el6.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY

Preparing...                ########################################### [100%]

   1:createrepo             ########################################### [100%]

[root@rhel64 ~]# createrepo -g /mnt/repodata/b4e0b9342ef85d3059ff095fa7f140f654c2cb492837de689a58c581207d9632-c6-x86_64-comps.xml /home/yum/

Spawning worker 0 with 3995 pkgs

Workers Finished

Gathering worker results


Saving Primary metadata

Saving file lists metadata

Saving other metadata

Generating sqlite DBs

Sqlite DBs complete

[root@rhel64 ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_Bak

[root@rhel64 ~]# mv /etc/yum.repos.d/CentOS-Debuginfo.repo /etc/yum.repos.d/CentOS-Debuginfo.repo_Bak

[root@rhel64 ~]# vi /etc/yum.repos.d/CentOS-Media.repo 

# CentOS-Media.repo

#

#  This repo can be used with mounted DVD media, verify the mount point for

#  CentOS-6.  You can use this repo and yum to install items directly off the

#  DVD ISO that we release.

#

# To use this repo, put in your DVD and use it with the other repos too:

#  yum --enablerepo=c6-media [command]

#

# or for ONLY the media repo, do this:

#

#  yum --disablerepo=\* --enablerepo=c6-media [command]


[c6-media]

name=CentOS-$releasever - Media

baseurl=file:///home/yum/

        file:///media/cdrom/

        file:///media/cdrecorder/

gpgcheck=1

enabled=1

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


[root@rhel64 ~]# yum clean all

Loaded plugins: fastestmirror, refresh-packagekit, security

Cleaning repos: c6-media

Cleaning up Everything

[root@rhel64 ~]# yum repolist

Loaded plugins: fastestmirror, refresh-packagekit, security

Determining fastest mirrors

 * c6-media: 

c6-media                                                                                   | 3.8 kB     00:00 ... 

c6-media/primary_db                                                                        | 3.3 MB     00:00 ... 

repo id                                           repo name                                                 status

c6-media                                          CentOS-6 - Media                                          3,995

repolist: 3,995

[root@rhel64 ~]# 


常用yum基本命令

            yum --help                   --帮助信息

            yum list                     --列出软件包

            yum repolist                 --查看有多少仓库

            yum info 软件包              --软件包的信息

            yum install  软件包          --安装软件包

            yum reinstall 软件包         --覆盖安装软件包

            yum remove 软件包            --删除软件包

            yum clean 软件包             --清除软件包

            yum grouplist                --查看软件组

            yum groupinstall "软件组"    --安装软件组

            yum install info "软件组"    --查看软件组的信息

            yum remove “组件组"          --删除软件组

            yum search  软件包           --检测是否有软件包      

            yum update  软件包           --软件包升级


你可能感兴趣的:(yum安装)