第 4 章 Package Manager

简介:

目录

4.1. Yum Resource & Yum Mirror
4.1.1. Fedora resource
4.1.1.1. Fedora 5.4
4.1.1.2. Fedora 6.x
4.1.1.3. Fedora 7.x
4.1.2. rpmforge-release
4.1.2.1. CentOS 5.x
4.1.2.2. CentOS 6.x
4.1.2.3. CentALT
4.1.3. atomic
4.1.4. famillecollet
4.1.5. rpmfind.net
4.1.6. pkgs.org
4.1.7. China Resource
4.1.8. 制作本地共享源
4.2. yum - Yellowdog Updater Modified
4.2.1. install
4.2.2. localinstall
4.2.3. list
4.2.4. search
4.2.5. update / upgrade
4.2.6. remove
4.2.7. installed
4.2.8. group
4.2.8.1. grouplist
4.2.8.2. groupinfo
4.2.8.3. groupinstall
4.2.8.4. groupremove
4.2.9. 查看包的依赖关系
4.2.10. provides / whatprovides
4.2.11. YUM 源管理
4.3. rpm - RPM Package Manager
4.3.1. install/upgrade/remove
4.3.1.1. --prefix
4.3.2. query
4.3.2.1. changelog 查看变更日志
4.4. rpmbuild - Build RPM Package(s)
4.4.1. RPM_directory_macros
4.4.2. --define 专递模板变量
4.4.3.
4.4.4. FAQ

4.1. Yum Resource & Yum Mirror

yum install yum-fastestmirror -y
		

4.1.1. Fedora resource

http://fedoraproject.org/wiki/EPEL

4.1.1.1. Fedora 5.4

5.4

rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
				

4.1.1.2. Fedora 6.x

6.x

rpm -Uvh http://download.fedora.redhat.com/pub/epel/6/i386/epel-release-6-5.noarch.rpm
rpm -Uvh http://download.fedora.redhat.com/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm
				

上面的地址已经停用,新地址在:http://mirrors.fedoraproject.org/publiclist

rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm
				

epel-release-6-7.noarch.rpm 升级为 epel-release-6-8.noarch.rpm

rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
				

4.1.1.3. Fedora 7.x

http://ftp.cuhk.edu.hk/pub/linux/fedora-epel/7/x86_64/repoview/epel-release.html

yum localinstall -y http://ftp.cuhk.edu.hk/pub/linux/fedora-epel/7/x86_64/e/epel-release-7-5.noarch.rpm
				

4.1.2. rpmforge-release

http://wiki.centos.org/AdditionalResources/Repositories/RPMForge

4.1.2.1. CentOS 5.x

http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
	    		
# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
# rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
# rpm -K rpmforge-release-0.5.2-2.el5.rf.*.rpm
# rpm -i rpmforge-release-0.5.2-2.el5.rf.*.rpm
    			

4.1.2.2. CentOS 6.x

i686 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
x86_64 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm


rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
rpm -K http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
rpm -i http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
    			

CentOS 6.5

http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm
http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
    			

4.1.2.3. CentALT

http://centos.alt.ru

http://centos.alt.ru/repository/centos/5/i386/centalt-release-5-3.noarch.rpm
http://centos.alt.ru/repository/centos/5/x86_64/centalt-release-5-3.noarch.rpm
				
http://centos.alt.ru/repository/centos/6/i386/centalt-release-6-1.noarch.rpm
http://centos.alt.ru/repository/centos/6/x86_64/centalt-release-6-1.noarch.rpm
				

含 php-fpm 等包

rpm -Uvh http://centos.alt.ru/repository/centos/6/x86_64/centalt-release-6-1.noarch.rpm
				

4.1.3. atomic

http://www6.atomicorp.com/channels/atomic/centos/5/x86_64/RPMS/atomic-release-1.0-14.el5.art.noarch.rpm
			

4.1.4. famillecollet

rpm --import http://rpms.famillecollet.com/RPM-GPG-KEY-remi
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
			

4.1.5. rpmfind.net

http://rpmfind.net

4.1.6. pkgs.org

http://pkgs.org/

4.1.7. China Resource

http://mirrors.163.com/ http://mirrors.sohu.com/

4.1.8. 制作本地共享源

我使用Ubuntu + vsftpd为 Redhat 提供源

将光盘Mount到/mnt,或使用iso文件Mount 到 /mnt

sudo mount /dev/cdrom /mnt/
or
sudo mount -o loop rhel-server-5.6-i386-dvd.iso /mnt
			

将整个光盘复制到ftp的anonymous目录或者http目录

sudo rsync -auvP /mnt/* /srv/ftp/
			

一般完整DVD光盘复制,不需要做此步骤。如果你的RPM看来自非官方,需要运行createrepo

cd /srv/ftp/
sudo apt-get install createrepo
sudo createrepo -g repodata/comps-rhel5-server-core.xml Server
			

FTP方式

			
cat > /etc/yum.repos.d/rhel-source-dvd.repo <<EOF
[rhel-source-dvd]
name=Red Hat Enterprise Linux $releasever - Source
baseurl=ftp://172.16.1.2/Server
enabled=1
gpgcheck=1
gpgkey=ftp://172.16.1.2/RPM-GPG-KEY-redhat-release
EOF
			
			

HTTP方式

			
cat > /etc/yum.repos.d/rhel-source-dvd.repo <<EOF
[rhel-source-dvd]
name=Red Hat Enterprise Linux $releasever - Source
baseurl=http://172.16.1.2/Server
enabled=1
gpgcheck=1
gpgkey=http://172.16.1.2/RPM-GPG-KEY-redhat-release
EOF
			
			

还可以使用本地文件或者光盘Mount目录

			
cat > /etc/yum.repos.d/rhel-source-dvd.repo <<EOF
[rhel-source-dvd]
name=Red Hat Enterprise Linux $releasever - Source
baseurl=file:///mnt/Server
enabled=1
gpgcheck=1
gpgkey=file:///mnt/RPM-GPG-KEY-redhat-release
EOF
			
			
yum clean all
yum list updates
			

Please enable JavaScript to view the &lt;a href="http://disqus.com/?ref_noscript"&gt;comments powered by Disqus.&lt;/a&gt;comments powered by Disqus





原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

目录
相关文章
|
7月前
|
Windows
NI Package Manager创建程序包
NI Package Manager创建程序包
128 0
|
资源调度
No change to package.json was detected. No package manager install will be executed.怎么解决
这个提示是由于没有对 package.json 文件进行更改所导致的,因此无需运行包管理器的安装。
439 0
|
安全 Apache C++
Creating a package:创建一个软件包
Creating a package:创建一个软件包
194 0
No package ‘gobject-introspection-1.0‘ found
No package ‘gobject-introspection-1.0‘ found
286 0
No package ‘libpeas-1.0‘ found/No package ‘libpeas-gtk-1.0‘
No package ‘libpeas-1.0‘ found/No package ‘libpeas-gtk-1.0‘
60 0
No package ‘dconf‘ found
No package ‘dconf‘ found
121 0
No package ‘libmatekbd‘ found
No package ‘libmatekbd‘ found
73 0
No package ‘polkit-gobject-1‘ found
No package ‘polkit-gobject-1‘ found
116 0
No package ‘vte-2.91‘ found
No package ‘vte-2.91‘ found
82 0
【Unity3D 问题总结】Failed to import package with error: Couldn‘t decompress package
报错问题:Failed to import package with error: Couldn’t decompress package 今天在导入一个资源包的时候突然提示报错:Failed to import package with error: Couldn’t decompress package
【Unity3D 问题总结】Failed to import package with error: Couldn‘t decompress package