3.6 7.6-7.9听课笔记

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了3.6 7.6-7.9听课笔记相关的知识,希望对你有一定的参考价值。


yum更换国内源

 

操作步骤:

1.      删除目录/etc/yum.repos.d/中原有的Baserepos文件

*操作完成后无法再下载包

2.  使用curl –O http://mirrors.163.com/.help/CentOS7-Base-163.repo 地址下载需要的repos文件(该操作也可以用wget来完成)

3.  清理原先的yum缓存(yum clean all

4.  查看列出的可安装的包(yum list

 

安装扩展源epel

base基础源

 

[[email protected] yum.repos.d]# yum install -y epel-release 安装扩展源

[[email protected] yum.repos.d]# ls

CentOS7-Base-163.repo  CentOS-fasttrack.repo  CentOS-Vault.repo

CentOS-CR.repo         CentOS-Media.repo      epel.repo

CentOS-Debuginfo.repo  CentOS-Sources.repo    epel-testing.repo

 

yum下载rpm

 

[[email protected] yum.repos.d]# yum install  zsh --downloadonly

已加载插件:fastestmirror

Loading mirror speeds from cached hostfile

 * epel: mirrors.tuna.tsinghua.edu.cn

软件包 zsh-5.0.2-28.el7.x86_64 已安装并且是最新版本

无须任何处理

[[email protected] yum.repos.d]#

*仅下载包但不安装包(当该包已经安装时无法下载)

[[email protected] yum.repos.d]# yum install zvbi –downloadonly 只下载不安装

已加载插件:fastestmirror

Loading mirror speeds from cached hostfile

 * epel: mirrors.ustc.edu.cn

正在解决依赖关系

--> 正在检查事务

---> 软件包 zvbi.x86_64.0.0.2.35-1.el7 将被 安装

--> 正在处理依赖关系 libpng15.so.15(PNG15_0)(64bit),它被软件包 zvbi-0.2.35-1.el7.x86_64 需要

--> 正在处理依赖关系 libpng15.so.15()(64bit),它被软件包 zvbi-0.2.35-1.el7.x86_64 需要

--> 正在检查事务

---> 软件包 libpng.x86_64.2.1.5.13-7.el7_2 将被 安装

--> 解决依赖关系完成

 

依赖关系解决

 

===================================================================================

 Package          架构             版本                                     大小

===================================================================================

正在安装:

 zvbi             x86_64           0.2.35-1.el7               epel           415 k

为依赖而安装:

 libpng           x86_64           2:1.5.13-7.el7_2           base           213 k

 

事务概要

===================================================================================

安装  1 软件包 (+1 依赖软件包)

 

总下载量:628 k

安装大小:1.9 M

Background downloading packages, then exiting:

(1/2): libpng-1.5.13-7.el7_2.x86_64.rpm                     | 213 kB  00:00:00    

warning: /var/cache/yum/x86_64/7/epel/packages/zvbi-0.2.35-1.el7.x86_64.rpm.1985.tmp: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY

zvbi-0.2.35-1.el7.x86_64.rpm.1985.tmp 的公钥尚未安装

(2/2): zvbi-0.2.35-1.el7.x86_64.rpm                         | 415 kB  00:00:00    

-----------------------------------------------------------------------------------

总计                                                  651 kB/s | 628 kB  00:00    

exiting because "Download Only" specified

[[email protected] yum.repos.d]#

[[email protected] yum.repos.d]# cd /var/cache/yum/x86_64/7/

 [[email protected] 7]# cd base

[[email protected] base]# ls

0c34273ad0292747ee5e15c047d3e51c67ca59861a446972db45d71abacc7ad7-primary.sqlite.bz2

9346184be1deb727caf4b1ecf4a7949155da5da74af9b92c172687b290a773df-c7-x86_64-comps.xml.gz

cachecookie

gen

packages

repomd.xml

[[email protected] base]# cd pachages

-bash: cd: pachages: 没有那个文件或目录

[[email protected] base]# ls -l

总用量 6052

-rw-r--r--. 1 root root 6023293 9   6 05:51 0c34273ad0292747ee5e15c047d3e51c67ca59861a446972db45d71abacc7ad7-primary.sqlite.bz2

-rw-r--r--. 1 root root  159667 9   6 05:51 9346184be1deb727caf4b1ecf4a7949155da5da74af9b92c172687b290a773df-c7-x86_64-comps.xml.gz

-rw-r--r--. 1 root root       0 3   6 20:08 cachecookie

drwxr-xr-x. 2 root root      31 3   6 20:08 gen

drwxr-xr-x. 2 root root      46 3   6 20:33 packages

-rw-r--r--. 1 root root    3735 9   6 05:51 repomd.xml

[[email protected] base]# cd packages

[[email protected] packages]# ls

libpng-1.5.13-7.el7_2.x86_64.rpm

/var/cache/yum/x86_64/7/base/packages libpng包存放在该目录下

 

[[email protected] packages]# yum install zvbi --downloadonly --downloaddir=/tmp/ 下载包并指定下载路径

已加载插件:fastestmirror

Loading mirror speeds from cached hostfile

 * epel: mirrors.tuna.tsinghua.edu.cn

正在解决依赖关系

--> 正在检查事务

---> 软件包 zvbi.x86_64.0.0.2.35-1.el7 将被 安装

--> 正在处理依赖关系 libpng15.so.15(PNG15_0)(64bit),它被软件包 zvbi-0.2.35-1.el7.x86_64 需要

--> 正在处理依赖关系 libpng15.so.15()(64bit),它被软件包 zvbi-0.2.35-1.el7.x86_64 需要

--> 正在检查事务

---> 软件包 libpng.x86_64.2.1.5.13-7.el7_2 将被 安装

--> 解决依赖关系完成

 

依赖关系解决

 

===================================================================================

 Package          架构             版本                                     大小

===================================================================================

正在安装:

 zvbi             x86_64           0.2.35-1.el7               epel           415 k

为依赖而安装:

 libpng           x86_64           2:1.5.13-7.el7_2           base           213 k

 

事务概要

===================================================================================

安装  1 软件包 (+1 依赖软件包)

 

总下载量:628 k

安装大小:1.9 M

Background downloading packages, then exiting:

exiting because "Download Only" specified

[[email protected] packages]#

[[email protected] packages]#yum reinstall zvbi --downloadonly --downloaddir=/tmp/ 在包已经被安装时重新下载这个包

 

源码包安装

 

约定服务器源码包安装位置:

/usr/local/src

 

可以到r.aminglinux.com(输入后自动跳转页面),下载源码包

 

[[email protected] src]# ls

httpd-2.2.34  httpd-2.2.34.tar.gz

[[email protected] src]# cd httpd-2.2.34

[[email protected] httpd-2.2.34]# ls

ABOUT_APACHE  config.layout  httpd.spec      LICENSE        README.platforms

acinclude.m4  configure      include         Makefile.in    README-win32.txt

Apache.dsw    configure.in   INSTALL         Makefile.win   ROADMAP

build         docs           InstallBin.dsp  modules        server

BuildAll.dsp  emacs-style    LAYOUT          NOTICE         srclib

BuildBin.dsp  httpd.dep      libhttpd.dep    NWGNUmakefile  support

buildconf     httpd.dsp      libhttpd.dsp    os             test

CHANGES       httpd.mak      libhttpd.mak    README         VERSIONING

*两个分别为安装文档和说明文档

[[email protected] httpd-2.2.34]#

[[email protected] httpd-2.2.34]# ./configure --prefix=/usr/local/apache2 指定安装路径

checking for chosen layout... Apache

checking for working mkdir -p... yes

checking build system type... x86_64-unknown-linux-gnu

checking host system type... x86_64-unknown-linux-gnu

checking target system type... x86_64-unknown-linux-gnu

 

Configuring Apache Portable Runtime library ...

 

checking for APR... reconfig

configuring package in srclib/apr now

checking build system type... x86_64-unknown-linux-gnu

checking host system type... x86_64-unknown-linux-gnu

checking target system type... x86_64-unknown-linux-gnu

Configuring APR library

Platform: x86_64-unknown-linux-gnu

checking for working mkdir -p... yes

APR Version: 1.5.2

checking for chosen layout... apr

checking for gcc... no

checking for cc... no

checking for cl.exe... no

configure: error: in `/usr/local/src/httpd-2.2.34/srclib/apr':

configure: error: no acceptable C compiler found in $PATH

See `config.log' for more details

configure failed for srclib/apr

[[email protected] httpd-2.2.34]# echo $? 如果不知道上一条命令是否执行成功可以使用

1 1则失败,为0成功

[[email protected] httpd-2.2.34]# echo $? 指明该命令的上一条命令是正确的

0

[[email protected] httpd-2.2.34]# ./configure --prefix=/usr/local/apache2 ./configure是配置的过程,过程中出现问题就会停下报错,解决问题后再重运行直到配置完全完成

 

*配置的过程中会生成一个makefile文件,根据该文件进行编译

[[email protected] httpd-2.2.34]# make 对该目录下产生的makefile文件进行编译

[[email protected] httpd-2.2.34]# echo $? 检测

0

[[email protected] httpd-2.2.34]# make install 将编译完成的文件放到prefix指定的目录下

[[email protected] httpd-2.2.34]# echo $?

0

[[email protected] httpd-2.2.34]# ls /usr/local/apache2

bin    cgi-bin  error   icons    lib   man     modules

build  conf     htdocs  include  logs  manual

发现源码包安装的文件都在prefix指定的目录下,所以若要卸载这个包只要删除对应的目录就可以

 

*源码包最好到可信任的站点下载,否则可能被攻击

 

 


以上是关于3.6 7.6-7.9听课笔记的主要内容,如果未能解决你的问题,请参考以下文章

python 听课笔记- 序(鸡汤)

APIO2017听课笔记关键词

听课笔记

Daily dictation 听课笔记

Struts+Hibernate 听课笔记

3.12 听课笔记