rpm 安装(无法解决包之间依赖性问题):
- rpm -ivh # 安装包(需要给出包绝对路径)
- rpm -V #用作包校验, 包无变化则不执行操作, 包被改变则显示包改变的属性
- rpm -e # 卸载包
- rpm -qi
- rpm -ql
- rpm -qf
- rpm -K
yum 安装(可解决包之间依赖性问题):
定制 yum 库:
1 先移走 / etc/yum.repos.d / 文件里默认的互联网 yum 源
- 2cd /etc/yum.repos.d/
- 3vim base.repo #后缀为. repo, 名字随便起
- 4base
- baseurl=https://mirrors.aliyun.com/epel/7/x86_64/(阿里云 epel 源; 有网络时方可用)
- gpgcheck=0
- yum clean all # 清理所有缓存
yum 安装不成功一般分为两种去情况;
1 定制 yum 库路径书写错误或路径不存在
2 没有清理缓存
关闭防火墙:
- centos6:
- service iptables stop (马上停止防火墙)
- chkconfig iptables off(开机不启动防火墙)
- centos7:
- systemctl disable firewalld(马上停止防火墙)
- systemctl disable firewalld(开机不启动防火墙)
编译安装:
1wget 软件包 (源码) 下载链接(http 或 ftp)# 直接将软件包下载到 linux 系统中
tar xvf 软件包名字 -C 指定目录 #将软件解压到指定目录
- 2yum groupinstall "development tools" #(安装编译相关工具及依赖的包)
- yum install apr-devel apr-util-devel pcre-devel
- 3./configure --prefix=/apps/httpd24 --sysconfdir=/etc/httpd24(/apps/httpd24 该目录需要事先创建, 为 httpd 软件安装目录 #以安装 httpd 为例子)
- 4make -j 4(4 是 cpu 数量, 可以选择)
- 5make install
6PATH 变量
- echo PATH=/apps/httpd24/bin:$PATH> /etc/profile.d/httpd24.sh
- ./etc/profile.d/httpd24.sh
- 7apachectl # 启动服务, 不同软件该步骤不同
来源: http://www.bubuko.com/infodetail-2530069.html