【转载】使用yum框架流畅安装依赖包

http://blog.chinaunix.net/uid-14504139-id-3852208.html

安装linux的rpm包经常遇到要安装一堆依赖包的问题,使用yum可以顺利安装,但是如果无法连接到网络的情况下,也希望使用yum来流畅安装rpm。

1.先从系统盘中安装以下3个rpm包
deltarpm、python-deltarpm、createrepo

[[email protected] Packages]# rpm -ivh deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
warning: deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
   1:deltarpm               ########################################### [100%]
[[email protected] Packages]# rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
warning: python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
   1:python-deltarpm        ########################################### [100%]
[[email protected] Packages]# rpm -ivh createrepo-0.9.8-5.el6.noarch.rpm
warning: createrepo-0.9.8-5.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
   1:createrepo             ########################################### [100%]

2.在/media下面扫描光盘的rpm包,作为来源。
[[email protected] ~]# cd /media

创建repo,需要扫描一段时间
[[email protected] media]# createrepo .
3274/3653 - RHEL_6.3 x86_64 Disc 1/Packages/system-config-keyboard-base-1.3.1-4.
iso-8859-1 encoding on Ville Skytt?<[email protected]> - 2.8.2-2

3653/3653 - RHEL_6.3 x86_64 Disc 1/Packages/zsh-4.3.10-5.el6.x86_64.rpm         
Saving Primary metadata
Saving file lists metadata
Saving other metadata

[[email protected] yum.repos.d]# cd /etc/yum.repos.d
编辑一个repo文件,内容如下即可。名字可以自己随便取,这里取名为cc
[[email protected] yum.repos.d]# vi cc.repo

[cc]
baseurl=file:///media
enabled=1
gpgcheck=0

3.安装方法如下
yum install 包名* -y
安装时会自动在cd中找寻依赖包进行安装

[[email protected] yum.repos.d]# yum install glibc-headers* -y
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Repository ‘cc‘ is missing name in configuration, using id
cc                                                                                                           | 1.3 kB     00:00 ... 
cc/primary                                                                                                   | 1.3 MB     00:00 ... 
cc                                                                                                                        3653/3653
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package glibc-headers.x86_64 0:2.12-1.80.el6 will be installed
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.12-1.80.el6.x86_64
--> Processing Dependency: kernel-headers for package: glibc-headers-2.12-1.80.el6.x86_64
--> Running transaction check
---> Package kernel-headers.x86_64 0:2.6.32-279.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================
 Package                             Arch                        Version                              Repository               Size
====================================================================================================================================
Installing:
 glibc-headers                       x86_64                      2.12-1.80.el6                        cc                      600 k
Installing for dependencies:
 kernel-headers                      x86_64                      2.6.32-279.el6                       cc                      1.9 M

Transaction Summary
====================================================================================================================================
Install       2 Package(s)

Total download size: 2.5 M
Installed size: 4.5 M
Downloading Packages:
------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                58 MB/s | 2.5 MB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : kernel-headers-2.6.32-279.el6.x86_64                                                                             1/2 
  Installing : glibc-headers-2.12-1.80.el6.x86_64                                                                               2/2 
Installed products updated.
  Verifying  : glibc-headers-2.12-1.80.el6.x86_64                                                                               1/2 
  Verifying  : kernel-headers-2.6.32-279.el6.x86_64                                                                             2/2

Installed:
  glibc-headers.x86_64 0:2.12-1.80.el6

Dependency Installed:
  kernel-headers.x86_64 0:2.6.32-279.el6

Complete!

时间: 2024-08-02 08:27:13

【转载】使用yum框架流畅安装依赖包的相关文章

安装snmp无法安装依赖包net-snmp-libs = 1:5.3.2.2-20.el5

问题:一直不能安装依赖包net-snmp-libs = 1:5.3.2.2-20.el5 原因:系统已经存在net-snmp-libs-5.3.2.2-25.el5_11 解决办法:先删除存在的包rpm -e --allmatches --nodeps net-snmp-libs-5.3.2.2-25.el5_11 esolving Dependencies --> Running transaction check ---> Package net-snmp.x86_64 1:5.3.2.2

git克隆项目到本地&amp;&amp;全局安装依赖项目&amp;&amp;安装依赖包&amp;&amp;启动服务

 一.安装本地开发环境 1.安装本项目 在需要保存到本地的项目的文件夹,进入到文件夹里点击右键,bash here,出现下图: 2.安装依赖项目  3.安装依赖包(进入到命令行) # 安装依赖包 $ npm install window+R,进入到命令行 ..... ..... 很多个安装的依赖包. .... 最后安装完之后的依赖包,如下图所示: 4.全局安装node-dev(进入到命令行) 5.启动服务(进入到命令行) # 启动服务 $ node-dev bin/www 出现如上图所示,红框的

python离线批量安装依赖包

python离线批量安装依赖包 [前提]:已安装pip,下载地址https://pypi.python.org/pypi/pip [步骤一]:打包已安装的依赖包 pip freeze >requirements.txt#生成已安装包清单 如本地保留了之前下载的各依赖包,直接将各whl/tar/zip包保存到某个文件夹下,如d:\packages 如本地未保留之前下载的各依赖包whl/tar/zip包,则需要用下面的命令从网络下载到d:\packages pip install–download

python安装依赖包方法

Python安装包的几种常用方式 1). pip安装方式(正常在线安装) 2). whl安装方式(离线安装),一般是.whl格式的包 3). 源码安装方式(离线安装),tar.gz/egg格式 4). easy_install安装方式(用的比较少) 不同安装方式具体安装步骤 1). pip是一个通用的 Python 包管理工具:提供了对 Python 包的查找.下载.安装.卸载的功能,使用pip安装软件包会自动安装包所依赖的其它包,而无需手动安装. > pip install --upgrade

【CentOS】yum install --downloadonly 下载依赖包研究

在CentOS中可以使用yum自动安装软件,在离线环境中却行不通. Linux localhost 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux 对于同一版本CentOS,我们可以事先下载离线依赖包,后面用命令手动安装. Java 自动安装命令: yum install -y java 安装结果: Installed: java-1.8.0-openjdk.x86_

linux CentOS7最小化安装环境静默安装Oracle11GR2数据库(安装依赖包)

安装Oracle11GR2所需要的依赖包 有高手写成了这样:yum -y install gcc gcc-c++ make binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel elfutils-libelf-devel-static glibc glibc-common glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel numa

用Yumdownloader将YUM安装包及其依赖包下载到本地

我们可以通过 yum 命令的 Yumdownloader 插件下载 RPM 软件包及其所有依赖包. 安装yum-utils 以通过–destdir 来指定位置,软件包和依赖的软件将被下载到此目录 命令格式:yumdownloader --resolve(可选,意为下依赖包) --destdir=软件存放位置 (可选) +软件包名 原文地址:https://www.cnblogs.com/zhangshuaihui/p/12336868.html

pip离线安装依赖包

pip安装离线本地包 导出本地已有的依赖包 pip freeze > requirements.txt 将依赖包下载到本地 # 下载到当前目录,指定pip源 pip download -r requirements.txt -d . -i http://mirrors.aliyun.com/pypi/simple/ 创建虚拟环境 # -q 安静的方式创建 # --no-site-packages 不拷贝本地的第三方包,创建干净的虚拟python运行环境 # --python=python3.7

关于npm无法安装依赖包以及安装包缓慢的解决方法

因为npm的服务器在国外,导致我们使用npm安装第三方包缓慢.而且有的第三方包是被墙的. 因此,作为墙内人,必须解决这个问题,否则开发起来实在是太坑了! 推荐大家使用淘宝的镜像(cnpm),它以每10分钟一次的同步频率同步npm官方数据.而且安装速度很快. 安装cnpm [javascript] view plain copy npm install -g cnpm --registry=https://registry.npm.taobao.org 使用cnpm安装包 [javascript]