redhat64安装yum源
来源:互联网 发布:日系男装 知乎 编辑:程序博客网 时间:2024/06/04 00:55
1.查看系统版本
[root@localhost /]# cat /etc/issueRed Hat Enterprise Linux Server release 6.4 (Santiago)Kernel \r on an \m
2.通过wget在http://mirrors.163.com/centos/6/os/x86_64/Packages/装yum源,但是由于是最小化安装,没有wget这个命令(系统提示-bash: wget: command not found)。需要下载一个wget-1.12-1.4.el6.x86_64.rpm包,然后通过rpm命令安装wget程序。
3.安装wget,如果已经存在则忽略此步骤,到http://rpm.pbone.net/index.php3 搜索wget-1.12-1.4.el6.x86_64.rpm,使用rpm -ivh wget-1.12-1.4.el6.x86_64.rpm 安装,当然需要把wget-1.12-1.4.el6.x86_64.rpm放置到RedHat64的目录下,到此目录下去执行rpm -ivh wget-1.12-1.4.el6.x86_64.rpm
4.通过wget下载yum软件包,注意以下的软件包不一定能够成功的下载,原因就是版本的不断变化,网上很多文章没法直接使用就是因为软件包的版本问题,如果下载不到的话可以直接到http://mirrors.163.com/centos/6/os/x86_64/Packages/ 然后通过ctrl+f快捷键查找到匹配到最前面的几个字样的rpm包,比如yum-3等选择下载下述4个软件包
[root@localhost src]# wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm--2017-09-28 15:05:14-- http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm正在解析主机 mirrors.163.com... 123.58.190.235, 123.58.190.209, 123.58.190.236, ...正在连接 mirrors.163.com|123.58.190.235|:80... 已连接。已发出 HTTP 请求,正在等待回应... 200 OK长度:37052 (36K) [application/x-redhat-package-manager]正在保存至: “python-iniparse-0.3.1-2.1.el6.noarch.rpm”100%[======================================================================================================>] 37,052 --.-K/s in 0.01s 2017-09-28 15:05:14 (2.67 MB/s) - 已保存 “python-iniparse-0.3.1-2.1.el6.noarch.rpm” [37052/37052])[root@localhost src]# wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm[root@localhost src]# wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm[root@localhost src]# wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm
如果在这个过程中提示Couldn’t resolve host ‘mirrors.163.com 字样,有可能是DNS没有设置好,
通过:
cd ~
cd /etc
vi resolv.conf
添加一个nameserver 8.8.8.8
5.安装yum,按照以下顺序格式安装,注意最后yum-3.2.29-81.el6.centos.noarch.rpm 和 yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm需要同时安装,他们互相依赖
[root@localhost src]# rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm[root@localhost src]# rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm[root@localhost src]# rpm -ivh yum-3.2.29-81.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm
如果在这个过程中提示如下字样:
rpm -ivh yum-3.2.29-81.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm
warning: yum-3.2.29-81.el6.centos.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
error: Failed dependencies:
python-urlgrabber >= 3.9.1-10 is needed by yum-3.2.29-81.el6.centos.noarch
查看系统的python信息 rpm -qa|grep python,
发现python-urlgrabber-3.9.1-9.el6.noarch 版本低于3.9.1-10
卸载:python-urlgrabber-3.9.1-9.el6.noarch
rpm -e python-urlgrabber-3.9.1-9.el6.noarch
下载高版本
[root@localhost src]# wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm
安装
[root@localhost src]# rpm -ivh python-urlgrabber-3.9.1-11.el6.noarch.rpm
查看安装成功没
[root@localhost src]# rpm -qa|grep pythonnotify-python-0.1.1-10.el6.x86_64python-iniparse-0.3.1-2.1.el6.noarchpython-simplejson-2.0.9-3.1.el6.x86_64python-rhsm-1.1.8-1.el6.x86_64python-ethtool-0.6-3.el6.x86_64python-urlgrabber-3.9.1-11.el6.noarch------------------------python-2.6.6-36.el6.x86_64rpm-python-4.8.0-32.el6.x86_64python-dmidecode-3.10.13-1.el6.x86_64newt-python-0.52.11-3.el6.x86_64python-libs-2.6.6-36.el6.x86_64dbus-python-0.83.0-6.1.el6.x86_64libxml2-python-2.7.6-8.el6_3.4.x86_64python-dateutil-1.4.1-6.el6.noarchpython-pycurl-7.19.0-8.el6.x86_64python-gudev-147.1-4.el6_0.1.x86_64
重新执行yum安装命令
[root@localhost src]# rpm -ivh yum-3.2.29-81.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm
查看yum命令,已成功安装
[root@localhost /]# yum已加载插件:fastestmirror, product-id, subscription-managerThis system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.你需要给出命令Usage: yum [options] COMMANDList of Commands:check Check for problems in the rpmdbcheck-update 检查是否有软件包更新clean 删除缓存的数据deplist 列出软件包的依赖关系distribution-synchronization Synchronize installed packages to the latest available versionsdowngrade downgrade a packageerase 从系统中移除一个或多个软件包groupinfo 显示组的详细信息groupinstall 向系统中安装一组软件包grouplist 列出可安装的组groupremove 从系统中移除一组软件包help 显示用法信息history Display, or use, the transaction historyinfo 显示关于软件包或组的详细信息install 向系统中安装一个或多个软件包list 列出一个或一组软件包load-transaction load a saved transaction from filenamemakecache 创建元数据缓存provides 查找提供指定内容的软件包reinstall 覆盖安装一个包repolist 显示已配置的仓库resolvedep 判断哪个包提供了指定的依赖search 在软件包详细信息中搜索指定字符串shell 运行交互式的 yum 外壳update 更新系统中的一个或多个软件包upgrade 更新软件包同时考虑软件包取代关系version Display a version for the machine and/or available repos.Options: -h, --help show this help message and exit -t, --tolerant 容忍错误 -C, --cacheonly run entirely from system cache, don't update cache -c [config file], --config=[config file] 配置文件路径 -R [minutes], --randomwait=[minutes] 命令最长等待时间 -d [debug level], --debuglevel=[debug level] 调试输出级别 --showduplicates 在 list/search 命令下,显示仓库里重复的条目。 -e [error level], --errorlevel=[error level] 错误输出级别 --rpmverbosity=[debug level name] debugging output level for rpm -q, --quiet 安静的操作 -v, --verbose verbose operation -y, --assumeyes 回答所有的问题为是 --assumeno answer no for all questions --version 显示 Yum 版本信息并退出 --installroot=[path] 设置目标根目录 --enablerepo=[repo] 启用一个或多个仓库(支持通配符) --disablerepo=[repo] 禁用一个或多个仓库(支持通配符) -x [package], --exclude=[package] 用全名或通配符排除软件包 --disableexcludes=[repo] 禁止从主配置,从仓库或者从任何位置排除 --obsoletes 升级时考虑软件包取代关系 --noplugins 禁用 Yum 插件 --nogpgcheck 禁用 gpg 签名检测 --disableplugin=[plugin] 禁用指定名称的插件 --enableplugin=[plugin] enable plugins by name --skip-broken 跳过有依赖问题的软件包 --color=COLOR 配置是否使用颜色 --releasever=RELEASEVER set value of $releasever in yum config and repo files --downloadonly don't update, just download --downloaddir=DLDIR specifies an alternate directory to store packages --setopt=SETOPTS set arbitrary config and repo options 插件选项:
更改(创建)yum源CentOS-Base.repo
[root@localhost yum.repos.d]# cd /etc/yum.repos.d/[root@localhost yum.repos.d]# rm -rf *[root@localhost yum.repos.d]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo--2017-09-28 15:52:58-- http://mirrors.163.com/.help/CentOS6-Base-163.repo正在解析主机 mirrors.163.com... 123.58.190.209, 123.58.190.236, 123.58.190.228, ...正在连接 mirrors.163.com|123.58.190.209|:80... 已连接。已发出 HTTP 请求,正在等待回应... 200 OK长度:2006 (2.0K) [application/octet-stream]正在保存至: “CentOS6-Base-163.repo”100%[======================================================================================================>] 2,006 --.-K/s in 0s 2017-09-28 15:53:03 (428 MB/s) - 已保存 “CentOS6-Base-163.repo” [2006/2006])[root@localhost yum.repos.d]# vi CentOS6-Base-163.repo
将所有
清理yum缓存
yum clean all
将服务器软件包信息缓存至本地,提高搜索安装效率
yum makecache
测试
yum search java|grep jdk
执行yum repolist查看,如果显示出repo仓库列表,并显示软件包数量则OK。(或者使用yum makecache)
使用yum安装软件包测试。
[root@localhost /]# whereis unzipunzip:[root@localhost /]# unzip-bash: unzip: command not found[root@localhost /]# yum install -y unzip zip[root@localhost /]# unzip
至此,如果unzip有效,就说明unzip软件包安装成功,yum也就可以正常使用了。
- redhat64安装yum源
- redhat64安装yum源
- redhat5安装yum源
- yum源安装soft
- 设置yum安装源
- linux安装yum源
- yum安装网易源
- 安装Webtatic yum源
- 163安装yum源
- centos5安装yum源
- 安装本地yum源
- RedHat安装yum+配置国内yum源
- RHEL4安装配置YUM源
- 初识yum本地安装源
- 网络&本地yum源安装
- CentOS 6 安装yum 源
- 使用yum安装本地源
- rhel 6.5 安装yum源
- Adb
- 定点数、浮点数类型运算的说明
- 基于Hadoop大数据分析应用场景与实战
- ijkplayer框架深入剖析
- 5分钟搞定android混淆
- redhat64安装yum源
- 第二篇:主页面及主页的两个模块
- Hive2ElasticSearch
- oracle 11g 完全卸载方法
- JSON解析-开源jsoncpp---动态链接库生成
- 永久性重定向和元描述的介绍
- 设计师应该做到的简洁是什么
- Hive自定义函数
- SSM的web.xml模板