标签:class map ... etc pac images title txt dep
7.6 yum更换国内源系统自带的源是国外网站,可能不好使用,比如网速较慢等,这样可以更换国内的源
·如果自建了yum源,那么先恢复默认的源
[root@localhost yum.repos.d]# cd .. [root@localhost etc]# cp yum.repos.d.bak/ yum.repos.d cp: 略过目录"yum.repos.d.bak/" [root@localhost etc]# cp -r yum.repos.d.bak/ yum.repos.d [root@localhost etc]# ls yum.repos.d CentOS-Base.repo CentOS-CR.repo CentOS-Debuginfo.repo CentOS-fasttrack.repo CentOS-Media.repo CentOS-Sources.repo CentOS-Vault.repo [root@localhost yum.repos.d]# rm CentOS-Base.repo ##删除基础源 rm:是否删除普通文件 "CentOS-Base.repo"?y [root@localhost yum.repos.d]# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo -bash: wget: 未找到命令 ##未安装wget,但是源已删除 [root@localhost yum.repos.d]# curl -0 http://mirrors.163.com/.help/CentOS7-Base-163.repo # CentOS-Base.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead. # # [base] name=CentOS-$releasever - Base - 163.com #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 #released updates [updates] name=CentOS-$releasever - Updates - 163.com #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras - 163.com #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus - 163.com baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 [root@localhost yum.repos.d]# vim CentOS7-Base-163.repo ##将数据复制进新建的源 此处省略 [root@localhost yum.repos.d]# yum list ##查看可用的包 [root@localhost yum.repos.d]# yum install wget
[root@localhost yum.repos.d]# yum repolist all
已经更换了163的源
7.7 yum下载rpm包
·安装扩展源epel
[root@localhost ~]# cd /etc/yum.repos.d [root@localhost yum.repos.d]# ls CentOS7-Base-163.repo CentOS-CR.repo CentOS-Debuginfo.repo CentOS-fasttrack.repo CentOS-Media.repo CentOS-Sources.repo CentOS-Vault.repo [root@localhost yum.repos.d]# yum install -y epel-release ##扩展源 过程省略 [root@localhost yum.repos.d]# ls CentOS7-Base-163.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo epel-testing.repo CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo epel.repo [root@localhost yum.repos.d]# yum list ##会有更多的包出现,以epel结尾
[root@localhost yum.repos.d]# yum list |grep epel ##只选择epel的包
(图中只取部分)
·yum下载rpm包
先确认要下载的包是不是已经安装过了
[root@localhost yum.repos.d]# yum install -y znc --downloadonly
[root@localhost yum.repos.d]# rpm -q znc 未安装软件包 znc [root@localhost yum.repos.d]# ls /var/cache/yum/x86_64/7/epel/packages/ ##包默认下载位置 znc-1.6.5-1.el7.x86_64.rpm
·指定包的下载目录:
[root@localhost yum.repos.d]# yum install -y zmap --downloadonly --downloaddir=绝对路径
(包和依赖包都会下载到指定目录下)
·已经安装过的包下载到指定位置:yum install -y 包名 --downloadonly --downloaddir=绝对路径
如果包已经安装过,那么下载时会提示不做处理
[root@localhost yum.repos.d]# yum install -y vim-enhanced --downloadonly --downloaddir=/tmp/ 已加载插件:fastestmirror Loading mirror speeds from cached hostfile * epel: mirrors.tongji.edu.cn 软件包 2:vim-enhanced-7.4.160-2.el7.x86_64 已安装并且是最新版本 无须任何处理
这时,可以用yum reinstall
[root@localhost yum.repos.d]# yum reinstall -y vim-enhanced --downloadonly --downloaddir=/tmp/
7.8 、7.9 源码包安装
★★★源码包放置的位置 /usr/local/src
[root@localhost /]# cd /usr/local/src [root@localhost src]# wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.2.32.tar.gz --2018-01-06 22:16:04-- http://mirrors.cnnic.cn/apache/httpd/httpd-2.2.32.tar.gz 正在解析主机 mirrors.cnnic.cn (mirrors.cnnic.cn)... 101.6.6.178, 2402:f000:1:416:101:6:6:177 正在连接 mirrors.cnnic.cn (mirrors.cnnic.cn)|101.6.6.178|:80... 已连接。 已发出 HTTP 请求,正在等待回应... 404 Not Found 2018-01-06 22:16:04 错误 404:Not Found。 ##地址不正确,去找正确地址 [root@localhost src]# wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.2.34.tar.gz --2018-01-06 22:17:04-- http://mirrors.cnnic.cn/apache/httpd/httpd-2.2.34.tar.gz 正在解析主机 mirrors.cnnic.cn (mirrors.cnnic.cn)... 101.6.6.178, 2402:f000:1:416:101:6:6:178 正在连接 mirrors.cnnic.cn (mirrors.cnnic.cn)|101.6.6.178|:80... 已连接。 已发出 HTTP 请求,正在等待回应... 200 OK 长度:7684419 (7.3M) [application/octet-stream] 正在保存至: “httpd-2.2.34.tar.gz” 100%[==========================================================================>] 7,684,419 2.10MB/s 用时 3.5s 2018-01-06 22:17:08 (2.10 MB/s) - 已保存 “httpd-2.2.34.tar.gz” [7684419/7684419]) [root@localhost src]# tar zxvf httpd-2.2.34.tar.gz 文件过多,不详细展示 [root@localhost src]# cd httpd-2.2.34 [root@localhost httpd-2.2.34]# ls ABOUT_APACHE BuildAll.dsp config.layout emacs-style httpd.spec LAYOUT LICENSE NOTICE README.platforms srclib acinclude.m4 BuildBin.dsp configure httpd.dep include libhttpd.dep Makefile.in NWGNUmakefile README-win32.txt support Apache.dsw buildconf configure.in httpd.dsp INSTALL libhttpd.dsp Makefile.win os ROADMAP test build CHANGES docs httpd.mak InstallBin.dsp libhttpd.mak modules README server VERSIONING
·安装源码包:
1.检测:/configure
./configure
--prefix 指定安装位置 (源码包安装完成后,所有目录会统一在一个文件夹中)
[root@localhost httpd-2.2.34]# ./configure --prefix=/usr/local/apache2
那么先去安装gcc:yum install -y gcc
安装完成后,再次执行./configure --prefix=/usr/local/apache2
等待完成……
[root@localhost httpd-2.2.34]# echo $? 0
没有问题
2.编译:make
[root@localhost httpd-2.2.34]# make 等待完成...... [root@localhost httpd-2.2.34]# echo $? 0
没有问题
3.安装:make install
[root@localhost httpd-2.2.34]# make install 等待完成…… [root@localhost httpd-2.2.34]# echo $? 0 [root@localhost httpd-2.2.34]# ls /usr/local/apache2/ bin build cgi-bin conf error htdocs icons include lib logs man manual modules
·卸载就是删除安装的文件 (指定安装目录的)
☆试着去安装php的包http://cn2.php.net/distributions/php-5.6.30.tar.bz2
下载到 /usr/local/src 下,解压后,进入到/usr/local/src/php-5.6.30目录下
./configure --prefix=/usr/local/php5 检查并指定安装目录为/usr/local/php5
出现问题,关于的错误,找不到makefile,无法make
查了下之前信息,libxml2报错
运行命令yum provides ’/*/libxml2 ' 查到了libxml2-devel
yum install -y libxml2-devel完成安装
再次./configure --prefix=/usr/local/php5,这次成功了
之后make
完成安装
[root@localhost php5]# ls
bin etc include lib php
标签:class map ... etc pac images title txt dep
原文地址:http://blog.51cto.com/11530642/2059196