RPM:(我使用的是Centos的yum软件包)
Linux Yum 本地源
原创
©著作权归作者所有:来自51CTO博客作者mit-tony的原创作品,谢绝转载,否则将追究法律责任
OS:Linux redhat4 2.6.9-78.ELsmp (i386)
RPM:(我使用的是Centos的yum软件包)
RPM:(我使用的是Centos的yum软件包)
centos-yumconf_4-4.3_noarch.rpm (i386)
python-sqlite_1.1.6-1_i386.rpm (i386)
sqlite_3.2.2-1_i386.rpm (i386)
python-elementtree_1.2.6-4_i386.rpm (i386)
python-urlgrabber_2.9.6-2_noarch.rpm (i386)
yum_2.4.0-1.centos4_noarch.rpm (i386)
createrepo-0.4.6-1.el4.rf.noarch.rpm (i386)
1.安装上面所有的软件包,会在/etc目录下有个三个文件: “yum” “yum.conf “ “/etc/yum.repos.d”
2. 建立一个目录,用于存放本地源的仓库
#mkdir –p /mnt/localhost/RPMS
2.1 将 OS光盘中的所有的RPM软件,全部COPY到/mnt/localhost/RPMS
#cp –a /media/cdrom/RedHat/RPMS /mnt/localhost/RPMS
3. 生成 依赖性关系
#createrepo /mnt/localhost/RPMS (这个会时间比较长)
注意,如果有新的软件加入到了这目录,那么就要重新执行一下这个命令。还有一点,如果是使用网络源,那么这条命令可以省略
4. 修改/etc/yum.repos.d/ CentOS-Base.repo
5. #vi /etc/yum.repos.d/ CentOS-Base.repo
内容如下:
[base]
name=redhat4 - Base
baseurl=file:///mnt/localhost/RPMS/
enabled=1
gpgcheck=1
gpgkey=file:///mnt/localhost/RPMS/RPM-GPG-KEY-redhat-release
#released updates
[update]
name=redhat4- Updates
baseurl=file:///mnt/localhost/RPMS/
enabled=1(是否 开启源) 1:开启
gpgcheck=1(是否 验证,可不要) 1:需要
gpgkey=file:///mnt/localhost/RPMS/RPM-GPG-KEY-redhat-release (验证的密钥,可不要)
注意:gpgkey=file:///mnt/localhost/RPMS/RPM-GPG-KEY-redhat-release 这一段可以不要,如果要用也可以使用命令直接导入:rpm –import /mnt/localhost/RPMS/RPM-GPG-KEY
RPM-GPG-KEY 这个KEY在系统安装盘中有
6. 修改配置文件 /etc/yum.conf
#vi /etc/yum.conf
内容:
[base]
name=redhat4 - Base
baseurl=file:///mnt/localhost/RPMS/
enabled=1
gpgcheck=1
gpgkey=file:///mnt/localhost/RPMS/RPM-GPG-KEY-redhat-release
#released updates
[update]
name=redhat4- Updates
baseurl=file:///mnt/localhost/RPMS/
enabled=1
gpgcheck=1
gpgkey=file:///mnt/localhost/RPMS/RPM-GPG-KEY-redhat-release
注:也就是在现在的文件中加上一步在vi /etc/yum.repos.d/ CentOS-Base.repo 中的内容
7.基本完成!
8. 测试
# yum install uucp-1.07-8.RHEL4.i386.rpm
Repository base is listed more than once in the configuration
Repository update is listed more than once in the configuration
Setting up Install Process
Setting up repositories
base 100% |=========================| 951 B 00:00
update 100% |=========================| 951 B 00:00
Reading repository metadata in from local files
Parsing package install arguments
Examining uucp-1.07-8.RHEL4.i386.rpm: uucp - 1.07-8.RHEL4.i386
Marking uucp-1.07-8.RHEL4.i386.rpm to be installed
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package uucp.i386 0:1.07-8.RHEL4 set to be updated
--> Running transaction check
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
uucp i386 1.07-8.RHEL4 uucp-1.07-8.RHEL4.i386.rpm 5.2 M
Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 5.2 M
Is this ok [y/N]: y
Downloading Packages:
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: uucp ######################### [1/1]
Installed: uucp.i386 0:1.07-8.RHEL4
Complete!
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
使用Nginx搭建本地YUM源
离线环境使用nginx搭建本地yum源(2种方式)
nginx yum源 服务器 -
Centos7.9 清华yum源配置
清华YUM源配置
CentOS centos -
怎么看自己linux是centos几 怎么看linux系统
如何知道你的Linux系统机器是否被黑 俗称“小鬼”的家伙是属于那种很糟糕的,因为基本上他们中的许多和大多数人都是如此的没有技巧。可以这样说,如果你安装了所有正确的补丁,拥有经过测试的防火墙,并且在多个级别都了先进的检测系统,那么只有在一种情况下你才
怎么看自己linux是centos几 linux internet 脚本 测试