yum配置

 

[root@localhost Server]# ll |grep vsftp  查询服务
[root@localhost Server]# rpm -ivh vsftpd-2.0.5-16.el5.i386.rpm  安装服务
[root@localhost Server]# service vsftpd start   启动服务
[root@localhost Server]# ftp 127.0.0.1
Connected to 127.0.0.1.
220 (vsFTPd 2.0.5)
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (127.0.0.1:root): anonymous      匿名登录
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 "/"
ftp> dir
227 Entering Passive Mode (127,0,0,1,162,50)
150 Here comes the directory listing.
drwxr-xr-x    2 0        0            4096 May 13  2009 pub
226 Directory send OK.
ftp> bye
221 Goodbye.

 

 

 


[root@localhost Server]# cd /var/ftp  进入ftp目录
[root@localhost ftp]# ll
[root@localhost ftp]# pwd
[root@localhost ftp]# mkdir rhel  创建目录
[root@localhost ftp]# cd rhel  进入目录
[root@localhost rhel]# pwd
[root@localhost rhel]# cp -a -r /mnt/cdrom/* ./  将/mnt/cdrom/下的文件拷贝到 当前目录下
[root@localhost rhel]# cp -a -r /mnt/cdrom/* ./
[root@localhost rhel]# ll
[root@localhost rhel]# cd Server
[root@localhost Server]# cd /mnt/cdrom/Server
[root@localhost Server]# ll cre*
[root@localhost Server]# pwd
/mnt/cdrom/Server
[root@localhost Server]# cd /var/ftp/rhel
[root@localhost rhel]# cd Server/
[root@localhost Server]createrepo -g repodata/comps-rhel5-server-core.xml ./     创建包依赖关系
[root@localhost Server]# cd ../VT
[root@localhost VT]# createrepo -g repodata/comps-rhel5-vt.xml ./
[root@localhost VT]# cd ../Cluster
[root@localhost Cluster]# createrepo -g repodata/comps-rhel5-cluster.xml ./
[root@localhost Cluster]# cd ../ClusterStorage/
[root@localhost ClusterStorage]# createrepo -g repodata/comps-rhel5-cluster-st.xml ./
[root@localhost Cluster]#cd
[root@localhost ~]#vim /etc/yum.conf
[root@localhost ~]#cd /etc/yum.conf
[root@localhost yum.repos.d]# cp rhel
[root@localhost yum.repos.d]# cp rhel-debuginfo.repo server1
[root@localhost yum.repos.d]#vim server.repo  编译网络yum
  [rhel-server]
   name=Red Hat Enterprise Linux server
   baseurl=ftp://192.168.101.2/rhel/Server
   enabled=1
   gpgcheck=1
   gpgkey=ftp://192.168.101.2/rhel/RPM-GPG-KEY-redhat-release
   [rhel-vt]
   name=Red Hat Enterprise Linux vt
   baseurl=ftp://192.168.101.2/rhel/VT
  enabled=1
  gpgcheck=1
  gpgkey=ftp://192.168.101.2/rhel/RPM-GPG-KEY-redhat-release
  [rhel-cluster]
 name=Red Hat Enterprise Linux cluster
  baseurl=ftp://192.168.101.2/rhel/Cluster
  enabled=1
  gpgcheck=1
  gpgkey=ftp://192.168.101.2/rhel/RPM-GPG-KEY-redhat-release
  [rhel-clusterstorag]
  name=Red Hat Enterprise Linux clusterstorage
  baseurl=ftp://192.168.101.2/rhel/ClusterStorage
 enabled=1
  gpgcheck=1
  gpgkey=ftp://192.168.101.2/rhel/RPM-GPG-KEY-redhat-release


 

 

 

[root@localhost etc]# cd yum.repos.d
[root@localhost yum.repos.d]# ll    

[root@localhost yum.repos.d]# vim server1.repo  编译 本地yum
[root@localhost yum.repos.d]#sed 's&ftp://192.168.101.2/rhel&file:///mnt/cdrom&'server.repo
  [rhel-server]
   name=Red Hat Enterprise Linux server
   baseurl=file:///mnt/cdrom/Server
   enabled=1
   gpgcheck=1
   gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release
   [rhel-vt]
   name=Red Hat Enterprise Linux vt
   baseurl=file:///mnt/cdrom/VT
  enabled=1
  gpgcheck=1
  gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release
  [rhel-cluster]
  name=Red Hat Enterprise Linux cluster
  baseurl=file:///mnt/cdrom/Cluster
  enabled=1
  gpgcheck=1
  gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release
  [rhel-clusterstorag]
  name=Red Hat Enterprise Linux clusterstorage
  baseurl=file:///mnt/cdrom/ClusterStorage
  enabled=1
  gpgcheck=1
  gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release

 

清除缓存

[root@localhost ~]#yum clean all

    本地YUM源创建完毕,我们就可以用YUM命令安装软件包,比如yum install bind 等。YUM常用命令:

   yum install package...  安装指定的软件包,可自动解决依赖关系
   yum localinstall rpmfile...  直接从本地安装rpm包,而不是从yum源
   yum groupinstall packagegroup... 安装该组包默认和相关的包

   yum remove package...  删除指定的包

   yum update [package...] 更新指定的包
   yum search searchterm 搜索有包含特定文件名的rpm包
   yum list [all][package_glob] 列出库中所有或者特定的rpm包

   yum list (available | updates | installed | extras | obsoletes [package_glob])

    列出可用的、可更新的、安装过的、从其它网站上下载的、淘汰的等rpm包

   yum info package 列出指定rpm包信息

   yum groupinfo packagegroup  列出指定一组rpm包信息

你可能感兴趣的:(职场,yum,休闲)