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

centos软件包安装

2014-04-14 16:15 302 查看
软件包安装 环境CentOS release 6.4 64位1、二进制1)rpm: redhat packet manager 对象 软件包名称-版本号-修订号.平台.rpm 【二进制 手册 库文件 头文件】 安装 卸载 升级 校验 签名检测 查询 安装-ivh 后面加文件名称卸载rpm -e httpd缺点:依赖性所以安装用yum, 卸载升级 校验 签名检测 查询 用rpm.查询: -q -a -qa 【查询已经安装的软件包】 -l -ql 包名称 【已经安装】-qlp 文件名称 【未安装】 -i -qi 包名称 【查看已经安装软件信息】 qip 文件名称 【未安装】 -f ---》-qf 文件 【查询该文件所属的包】升级 -Fvh 【升级】 -Uvh 【升级 安装】校验 -V -a c %config configuration file. d %doc documentation file.g %ghost file (i.e. the file contents are not included in the package payload). l %license license file. r %readme readme file. S file Size differs M Mode differs (includes permissions and file type) 5 digest (formerly MD5 sum) differs D Device major/minor number mismatch L readLink(2) path mismatch U User ownership differs G Group ownership differs T mTime differs P caPabilities differ安装软件包:1.查找mount /dev/cdrom /media/cdromcd /media/cdrom/Packagesll http*2.安装rpm -ivh httpd-2.2.15-26.e16.centos.x86_64.rpm2)yum优点:解决依赖关系mount /devc/cdrom /media/cdromyum --disablerepo=\* --enablerepo=c6-media install httpdinstall后面跟软件包名称 3. 源代码 1.检测预编译环境 (1)[root@host1 ~]# mount /dev/cdrom /media/cdrom/ (2)yum --disablerepo=\* --enablerepo=c6-media grouplist[root@host1 ~]# cd /etc/yum.repos.d[root@host1 yum.repos.d]# ll RHEL 5 Development Libraries Development Tools X Software Development Legacy Software Development centos 6 Development tools 安装:[root@host1 yum.repos.d]# yum --disablerepo=\* --enablerepo=c6-media groupinstall "Development tools" Server Platform Development 前2个必装Additional Development 2) 产生 makefile 文件工具 ./configure4. make 开始编译 ---》二进制 头文件 库文件 手册5. make install 实验: httpd的源代码安装 传软件包:源码--httpd2.4 里面3个压缩文件 apr-1.4.6. apr-util httpd-2.4.4.tar.bz2 !! 安装按顺序 拆软件包 1.对.gz文件tar -zxvf apr-1.4.6.tar.gz -C /usr/local/src/ .c表示的是源代码 2.对bz2文件tar -jxvf httpd-2.4.4.tar.bz2 -C /usr/local/src/3.cd /usr/local/src/ --> ll[root@host1 src]# lldrwxr-sr-x. 25 5000 10001 4096 Feb 8 2012 apr-1.4.6drwxr-xr-x. 19 user1 1000 4096 Sep 8 2012 apr-util-1.5.1drwxr-xr-x. 11 user2 games 4096 Feb 19 2013 httpd-2.4.4 (1)cd apr-1.4.6/ -->ls-->./configure --help |less(能查看源代码安装目录--prefix) ./configure --prefix=/usr/local/apr4.make 5.make install[root@host1 ~]# cd /usr/local/ [root@host1 local]# lltotal 44drwxr-xr-x. 6 root root 4096 Apr 9 01:51 apr[root@host1 local]# cd apr[root@host1 apr]# lltotal 16drwxr-xr-x. 2 root root 4096 Apr 9 01:51 bindrwxr-xr-x. 2 root root 4096 Apr 9 01:51 build-1drwxr-xr-x. 3 root root 4096 Apr 9 01:51 includedrwxr-xr-x. 3 root root 4096 Apr 9 01:51 lib cd apr-->ll (cd /usr/local/src/-->ll (2) cd apr-util -->ls-->./configure --help |grep apr(能查看源代码安装目录--prefix) ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config make && make install [root@host1 apr-util-1.5.1]# cd /usr/local[root@host1 local]# lltotal 48drwxr-xr-x. 6 root root 4096 Apr 9 01:51 apr [root@host1 local]# ll apr-util/total 12drwxr-xr-x. 2 root root 4096 Apr 9 02:06 bindrwxr-xr-x. 3 root root 4096 Apr 9 02:06 includedrwxr-xr-x. 3 root root 4096 Apr 9 02:06 lib cd /usr/local/src/-->ll cd httpd-2.4.4/-->ls vim INSTALL ./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd有错误 ./configure --help |grep apr-util[root@host1 httpd-2.4.4]# ./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr-util/bin/apu-1-config ll /media/cdrom/Packages |grep pcre [root@host1 httpd-2.4.4]# yum --disablerepo=\* --enablerepo=c6-media install pcre pcre-develmake && make install([root@host1 httpd-2.4.4]# cd /usr/local[root@host1 local]# lltotal 52drwxr-xr-x. 13 root root 4096 Apr 9 02:35 apache)!![root@host1 local]# ll /etc/httpd[root@host1 local]# cd apache[root@host1 apache]# lltotal 52drwxr-xr-x. 2 root root 4096 Apr 9 02:35 bindrwxr-xr-x. 2 root root 4096 Apr 9 02:35 builddrwxr-xr-x. 2 root root 4096 Apr 9 02:35 cgi-bindrwxr-xr-x. 3 root root 4096 Apr 9 02:35 errordrwxr-xr-x. 2 root root 4096 Apr 9 01:18 htdocsdrwxr-xr-x. 3 root root 4096 Apr 9 02:35 iconsdrwxr-xr-x. 2 root root 4096 Apr 9 02:35 includedrwxr-xr-x. 2 root root 4096 Apr 9 02:35 logsdrwxr-xr-x. 4 root root 4096 Apr 9 02:35 mandrwxr-xr-x. 14 root root 12288 Feb 19 2013 manualdrwxr-xr-x. 2 root root 4096 Apr 9 02:35 modulesPATH=$PATH:/usr/local/apache/bin/ !!!vim README 后续 [root@host1 apache]# cd bin[root@host1 bin]# pwd/usr/local/apache/bin[root@host1 bin]# ab 二进制 永久!!vim /etc/profile 55行export上面添加:PATH=$PATH:/usr/local/apache/bin --->wq PATH=$PATH:路径 重新登录 或者 . /etc/profile
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息