软件包安装
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
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
通过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
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
本文出自 “cisco” 博客,请务必保留此出处http://1585654.blog.51cto.com/1575654/1388990
原文:http://1585654.blog.51cto.com/1575654/1388990