软件包管理-软件包安装

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
简介:

软件包安装

rpm包
半源码包
源码包
二进制文件包

linux两种软件包:
Redhat/Centos/FedoraRPMrpm,rpmbuild yum
Ubuntu/DebianDPKGdpkg apt


notecase-1.9.8-1.fc6.i386.rpm
软件包名   版本  发布次数  平台
平台:i386(32),x86_64(64),noarch

RPM (rpm,yum) 

rpm管理 (依赖性关系需要手动解决)

rpm -ivh httpd-2.2.3-63.el5.i386.rpm-i install  v 过程  h 百分比
rpm -ivh --root=/tmp/ httpd-2.2.3-63.el5.i386.rpm   //指定路径安装
rpm -ivh httpd-2.2.3-63.el5.i386.rpm
rpm -ivh httpd-manual-2.2.3-63.el5.i386.rpm
rpm -q httpd
rpm -qa |grep httpd//查询程序安装包信息
rpm -ql httpd//查询软件的安装位置
rpm -qf /etc/passwd//通过文件检索软件包
rpm -qi httpd//查询安装包信息
rpm -qc httpd
rpm -qd httpd
rpm -qf `which nmap`//查询命令的安装包
rpm -e httpd
rpm -e httpd --nodeps
rpm -qip notecase-1.9.8-1.fc6.i386.rpm//查询未安装软件包详细信息
rpm -qpl caching-nameserver-9.3.6-20.P1.el5.i386.rpm//未安装软件安装时的路径
rpm -ivh httpd-2.2.3-63.el5.i386.rpm --force //强制安装
rpm -e apr-devel --nodeps//不检测依赖关系卸载

导入校验key
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
rpm --import  /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta

===========================================================================================

安装

[root@station230 Server]# rpm -ivh mysql-5.0.77-4.el5_6.6.i386.rpm 
warning: mysql-5.0.77-4.el5_6.6.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
error: Failed dependencies:
       perl(DBI) is needed by mysql-5.0.77-4.el5_6.6.i386
===========================================================================================
yum管理 repodata(依赖性关系数据库)

红帽系统yum软件库在镜像里的位置
Server
Cluster
ClusterStorage
VT

======================================================

使用yum的步骤:

1. 指定仓库
cd /etc/yum.repos.d/
vim rhel-debuginfo.repo
[Server]
name=Server
baseurl=file:///media/Server
enabled=1
gpgcheck=1key的校验,没有导入公钥时可以关闭

[VT]
name=VT
baseurl=file:///media/VT
enabled=1
gpgcheck=1

[Cluster]
name=Cluster
baseurl=file:///media/Cluster
enabled=1
gpgcheck=1

[ClusterStorage]
name=ClusterStorage
baseurl=file:///media/ClusterStorage
enabled=1
gpgcheck=1

2. 安装
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release//导入红帽公钥
yum clean all
yum -y install mysql
yum -y install mysql*
yum -y install vsftpd mysql httpd

扩展:自定义仓库

(1)安装软件
yum -y install createrepo
createrepo 安装包目录  生成repodata

(2)准备仓库
[root@station230 soft]# pwd
/var/ftp/pub/soft
[root@station230 soft]# createrepo .

1/1 - notecase-1.9.8-1.fc6.i386.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
[root@station230 soft]# ls
notecase-1.9.8-1.fc6.i386.rpm  repodata

(3)安装
vim /etc/yum.repos.d/soft.repo
[soft]
name=private
baseurl=file:///var/ftp/pub/soft
enabled=1
gpgcheck=0

yum clean all
yum -y install notecase
yum -y update vsftpd

# yum -y localinstall toilet-0.3-1.mga3.i586.rpm --nogpgcheck
# rpm -ivh banner-1.3.2-1.fc17.i686.rpm --force --nodeps

============================================================

yum clean all
清空yum缓存

yum list测试yum
yum install httpd-devel

wKiom1M7mBrByhZ0AALhrtc_1aM101.jpg

yum remove apr-devel
yum reinstall httpd
yum provides */dhcpd.conf   
查找dhcpd.conf文件属于哪个RPM包
yum list tftp
yum list | grep tftp
yum -y remove tftp

wKiom1M7l8GwPKnZAAGL94OFX0M163.jpg

通过YUM管理软件包组[rhel-Server]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=file:///mnt/Server
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

yum grouplist

wKiom1M7mMeSink9AAMWMiZgGCs930.jpgyum groupinfo "开发库"

yum -y groupinstall "开发库" "开发工具"


tarball(SOURCE)

tar xvf httpd-2.2.11.tar.bz2 -C /usr/local/src#关注:INSTALL README

Quick Start - Unix
 ------------------
./configure --prefix=PREFIX
    make
    make install
    PREFIX/bin/apachectl start



源码包安装三步曲:

1. # ./configure --prefix=/usr/local/apache2//检查环境,指定安装选项等参数,生成 Makefile

2. # make//编译

3. # make install//安装

[root@station230 httpd-2.2.11]# ls /usr/local/apache2/
bin  build  cgi-bin  conf  error  htdocs  icons  include  lib  logs  man  manual  modules
[root@station230 httpd-2.2.11]# ls /usr/local/apache2/conf/httpd.conf 
/usr/local/apache2/conf/httpd.conf

[root@station230 httpd-2.2.11]# /usr/local/apache2/bin/apachectl start

编译选项:
./configure --help 选项
--prefix=DIR
--enable-ssl
--disable-filter
--with-apr=PATH例如 --with-apr=/usr/local/apr   --with-apr
--with-apr-util=PATH 

================================================================================

二进制bin包

[root@station230 pub]# chmod a+x jdk-6u27-linux-i586.bin 
[root@station230 pub]# ./jdk-6u27-linux-i586.bin 













本文转自zhang25yun51CTO博客,原文链接:http://blog.51cto.com/1585654/1388990 ,如需转载请自行联系原作者




相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
17天前
|
Ubuntu Java Linux
软件包管理篇
软件包管理篇
|
2月前
|
缓存 Linux Shell
【Linux工具篇】软件包管理器yum
【Linux工具篇】软件包管理器yum
53 1
|
3月前
|
缓存 Linux
软件包管理工具 - yum
【1月更文挑战第17天】
55 0
|
3月前
|
Linux
软件包管理工具 - dpkg
【1月更文挑战第15天】
46 4
|
3月前
|
缓存 Linux
软件包管理工具 - dnf
【1月更文挑战第14天】
72 0
|
3月前
|
缓存 Ubuntu Linux
apt-get 软件包管理工具
【1月更文挑战第1天】
68 0
|
8月前
|
Linux
RPM软件包管理
RPM软件包管理
169 0
Yocto 包管理 apt-get
/******************************************************************** * Yocto 包管理 apt-get * 说明: * 查一下Yocto的包管理方式,记录参考文档。
1912 0
|
缓存 Oracle 安全
YUM软件管理工具
YUM软件管理工具
162 0
|
Ubuntu Shell Linux
如果高效使用apt-get、pip来下载安装依赖包、软件呢?
在Python开发中,需要安装一下包、依赖库或软件等,有时出现网络、权限和无法安装等问题困扰着我们,经历过一段时间的洗礼,悟出了一些要点分享给大家
1642 0