yum 更换国内源
- cd /etc/yum.repos.d/--进入到yum源目录
- mv CentOS-Base.repo CentOS-Base.repo.bak---把自带的国外源备份
- wget http://mirrors.163.com/.help/CentOS7-Base-163.repo 或者curl -O http://mirrors.163.com/.help/CentOS7-Base-163.repo(没有网络仓库和wget命令时可以使用)下载163源
- yum list---生成缓存
yum安装扩展源
- yum install -y epel-release 安装扩展源
- yum list|grep epel 查看扩展源的包
yum下载rpm包
- yum install -y zsh(包名) --downloadonly 下载rpm包但不安装
- ls /var/cache/yum/x86_64/7/ ---默认下载的rpm包存放目录,在该目录对应的仓库子目录下的packages目录下
[[email protected] yum.repos.d]# ls /var/cache/yum/x86_64/7/ base/ extras/ timedhosts updates/ epel/ .gpgkeyschecked.yum timedhosts.txt [[email protected] yum.repos.d]# ls /var/cache/yum/x86_64/7/updates/packages/ zsh-5.0.2-25.el7_3.1.x86_64.rpm
- yum install -y vim --downloadonly --downloaddir=/tmp/ ---下载vim包到/tmp目录下
- yum reinstall -y vim --downloadonly --downloaddir=/tmp/ ---已安装的包用reinstall
[[email protected] yum.repos.d]# yum reinstall -y vim --downloadonly --downloaddir=/tmp/ [[email protected] yum.repos.d]# ls /tmp/ 1.txt 1.txt.gz d6z systemd-private-2ba69af5110e40babc13fe4506eadae3-vmtoolsd.service-JXm5ZF vim-enhanced-7.4.160-1.el7_3.1.x86_64.rpm
源码包安装
- cd /usr/local/src/ 约定源码包统一存放目录
- wget http:mirrors.cnnic.cn/apache/httpd/httpd-2.2.32.tar.gz ---下载apache源码包
- tar zxvf httpd-2.2.32.tar.gz ---解压源码包
- cd httpd-2.2.32 ---进入目录
- ./configure --prefix=/usr/local/apache2 ---环境检测指定安装目录
- 解决编译apache出现的问题转载
- echo $?检测上一条命令,0表示正确
- make ---编译
- make install ---安装
- 卸载就是删除安装的文件
扩展
原文地址:http://blog.51cto.com/akui2521/2104583
时间: 2024-10-01 03:41:50