您的位置:首页 > 运维架构 > Linux

重识yum(updating)

2015-10-29 15:07 204 查看

定义

Yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及CentOS中的Shell前端软件包管理器。基于RPM包管理,能够从指定的服务器自动下载RPM包并且安装,可以自动处理依赖性关系,并且一次安装所有依赖的软件包,无须繁琐地一次次下载、安装。

operations

yum can perform operations such as:

installing packages

deleting packages

updating existing installed packages

listing available packages

listing installed packages

与rpm之前关系(主要看rpm的定义)

RPM Package Manager (RPM) (originally Red Hat Package Manager; now a recursive acronym) is a package management system.[5] The name RPM variously refers to the .rpm file format, files in this format, software packaged in such files, and the package manager itself. RPM was intended primarily for Linux distributions;

Features of RPM include:

RPM packages can be cryptographically verified with GPG and MD5 Original source archive(s) (e.g. .tar.gz, .tar.bz2) are included in SRPMs, making verification easier

PatchRPMs and DeltaRPMs, the RPM equivalent of a patch file, can incrementally update RPM-installed software

Automatic build-time dependency evaluation.

Repositories

RPMs are often collected centrally in one or more repositories on the internet. A site often has its own RPM repositories which may either act as local mirrors of such internet repositories or be locally maintained collections of useful RPMs.

RPM默认安装路径

pathfunction
/etc一些设置文件放置的目录如/etc/crontab
/usr/bin一些可执行文件
/usr/lib ¦ /usr/lib64一些程序使用的动态函数库
/usr/share/doc一些基本的软件使用手册与帮助文档
/usr/share/man一些man ¦ page文件

Common Operations

rpm -ql jdk    #查看安装jdk的所有路径


rpm -qc jdk    #查看安装jdk的配置文件路径


创建本地yum源

检查本机是否有web服务器,如没有则安装(yum install httpd)

安装yum自带工具:yum install yum-utils createrepo

在/var/www/html/下,执行reposync -r cloudera-cdh5,进行同步下载到本地

cloudera-cdh5为/etc/yum.repos/xx的一个yum源id

通过http://ip:port/项目名 来访问本地yum源

在其它服务器上修改/etc/yum.repos.d/xxx.repo文件中的baseurl换成本地地址

createrepo cloudera-cdh5

cloudera-cdh5是reposync同步后在/var/www/html下生成的文件夹

yum源

中科大的yum源地址:http://centos.ustc.edu.cn/

这里下载的.repo文件中要把$releasever和$basearch 自己手动替换成相应的版本


网易的yum源地址:http://mirrors.163.com/

搜狐的yum源地址:http://mirrors.sohu.com/

http://mirror.centos.org/centos/

注意事项

yum install 错误:Package *.rpm is not signed

解决方案是:更改 /etc/yum.conf 下的 gpgcheck=1 为 gpgcheck=0

关于 yum.conf 的详细可参考 man yum.conf。其中对 gpgcheck 的描述是:

gpgcheck

Either  ‘1’  or ‘0’. This tells yum whether or not it should perform a GPG signature check on pack-

ages. When this is set in the [main] section it sets the default for all repositories. This  option

also  determines whether or not an install of a package from a local RPM file will be GPG signature

checked. The default is ‘0’.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  linux