系统环境 CentOS 6.2 x64
配置步骤
安装createrepo工具
yum install createrepo
创建一个目录,用于存放rpm包
mkdir /home/download
cp xxx.rpm /home/download
createrepo /home/download
执行createrepo命令后,在该目录自动搜索rpm文件,并创建repodata目录
修改yum.conf配置文件
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
# 0删除下载文件,1不删除下载文件
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
# 0不启用验证,1启用验证
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release
修改下载源定义文件x.repo
vim /etc/yum.repos.d/mytest.repo
[mytest]
name=mytest
baseurl=file:///home/download
# 路径要设置成repodata所在目录的上级目录名
enabled=1
# 1启用该配置,0不启用
gpgcheck=0
# 关闭验证
安装测试
yum install Percona-Server-server-55 Percona-Server-client-55
yum命令列表
命令
功能
yum clean packages
清除缓存中的软件包文件
yum clean headers
清除缓存中的软件包文件头信息
yum clean metadata
清除缓存中的描述信息
yum clean dbcache
清除sqlite格式的描述信息
yum clean all
清除缓存中的所有数据信息
yum list all
列出所有软件包
yum list installed
列出所有已经安装的软件包
yum list available
列出可安装的软件包
yum list updates
列出所有可以更新的软件包
yum list extras
显示额外的软件包
yum list obsoletes
显示已经被淘汰的软件包
yum list recent
显示近期的软件包
yum makecache
Is used to download and make usable all the metadata for the currently enabled yum repos
配置步骤
安装createrepo工具
yum install createrepo
创建一个目录,用于存放rpm包
mkdir /home/download
cp xxx.rpm /home/download
createrepo /home/download
执行createrepo命令后,在该目录自动搜索rpm文件,并创建repodata目录
修改yum.conf配置文件
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
# 0删除下载文件,1不删除下载文件
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
# 0不启用验证,1启用验证
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release
修改下载源定义文件x.repo
vim /etc/yum.repos.d/mytest.repo
[mytest]
name=mytest
baseurl=file:///home/download
# 路径要设置成repodata所在目录的上级目录名
enabled=1
# 1启用该配置,0不启用
gpgcheck=0
# 关闭验证
安装测试
yum install Percona-Server-server-55 Percona-Server-client-55
yum命令列表
命令
功能
yum clean packages
清除缓存中的软件包文件
yum clean headers
清除缓存中的软件包文件头信息
yum clean metadata
清除缓存中的描述信息
yum clean dbcache
清除sqlite格式的描述信息
yum clean all
清除缓存中的所有数据信息
yum list all
列出所有软件包
yum list installed
列出所有已经安装的软件包
yum list available
列出可安装的软件包
yum list updates
列出所有可以更新的软件包
yum list extras
显示额外的软件包
yum list obsoletes
显示已经被淘汰的软件包
yum list recent
显示近期的软件包
yum makecache
Is used to download and make usable all the metadata for the currently enabled yum repos
CentOS6.2下自建YUM源教程
5914

被折叠的 条评论
为什么被折叠?



