zoukankan      html  css  js  c++  java
  • 【Linux学习七】软件安装


    环境
      虚拟机:VMware 10
      Linux版本:CentOS-6.5-x86_64
      客户端:Xshell4
      FTP:Xftp4

    一、编译安装
    1.解压 源码文件是压缩包 要先解压
    tar -zxvf tengine-2.1.0.tar.gz

    2.进入解压包 查看README文件 里面有对软件的介绍和安装指导
    3.查看./configure --help 看一下有哪些安装参数,设定参数来安装
    4.安装装编译器  检查依赖:是否有对应的编译器

    [root@node1 tengine-2.1.0]# ./configure
    checking for OS
    + Linux 2.6.32-431.el6.x86_64 x86_64
    checking for C compiler ... not found
    
    ./configure: error: C compiler cc is not found

    报错:提示没有cc编译器
    解决方案:yum install -y gcc 安装gcc编译器(GNU cc)


    5.安装依赖库PCRE、OpenSSL
    再次执行./configure,会提示缺少依赖库
    可以通过yum serch PCRE来查询这个库,
    然后安装yum install -y pcre-devel

    ./configure: error: the HTTP rewrite module requires the PCRE library.
    You can either disable the module by using --without-http_rewrite_module
    option, or install the PCRE library into the system, or build the PCRE library
    statically from the source with nginx by using --with-pcre=<path> option.
    
    ./configure: error: SSL modules require the OpenSSL library.
    You can either do not enable the modules, or install the OpenSSL library
    into the system, or build the OpenSSL library statically from the source
    with nginx by using --with-openssl=<path> option.
    
    [root@node1 tengine-2.1.0]# yum search PCRE
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    * base: mirrors.njupt.edu.cn
    * extras: mirrors.njupt.edu.cn
    * updates: mirrors.cqu.edu.cn
    =================================================== N/S Matched: PCRE ===================================================
    pcre-devel.i686 : Development files for pcre
    pcre-devel.x86_64 : Development files for pcre
    pcre-static.x86_64 : Static library for pcre
    pcre.x86_64 : Perl-compatible regular expression library
    pcre.i686 : Perl-compatible regular expression library
    
    Name and summary matches only, use "search all" for everything.

    6.最后configure配置执行成功
    首先做检查依赖,最后生成MakeFile编译文件

    7.编译:make


    8.安装:make install


    9.访问验证
    注意关闭防火墙:service iptables stop

    二、rpm安装:包

    RPM 安装
    Redhat提供了rpm管理体系
    已经编译的软件包:针对不同的平台系统编译目标软件包
    操作系统维护安装信息
    软件包包含依赖检查,但,还需人为解决

    rpm -ivh jdk-7u80-linux-x64.rpm 就完事

    rpm安装:
    -ivh filename
    --prefix
    rpm升级:
    -Uvh
    -Fvh
    rpm卸载:
    -e PACKAGE_NAME

    rpm查询
    rpm -qa : 查询已经安装的所有包
    rpm -q PACKAGE_NAME: 查询指定的包是否已经安装
    rpm -qi PACKAGE_NAME: 查询指定包的说明信息
    rpm -ql PACKAGE_NAME: 查询指定包安装后生成的文件列表
    rpm -qc PACEAGE_NEME:查询指定包安装的配置文件
    rpm -qd PACKAGE_NAME: 查询指定包安装的帮助文件
    rpm -q --scripts PACKAGE_NAME: 查询指定包中包含的脚本
    rpm -qf /path/to/somefile: 查询文件是由哪个rpm包安装生成的
    如果某rpm包尚未安装,需查询其说明信息、安装以后会生成的文件
    rpm -qpi /PATH/TO/PACKAGE_FILE
    rpm -qpl

    三、yum安装:仓库

    yum安装 C / S
    基于rpm包管理
    提供rpm仓库
    repo:
    /etc/yum.repos.d/
    [repoID]
    baseurl=
    http://
    file://
    ftp://
    gpgcheck=1/0
    enable=0/ 1

    repo国内源:使用开源镜像(阿里(快一些)、163)作镜像
    1.安装wget:yum install -y wget
    2.备份原来的repo文件
    3.下载阿里repo:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

    或者直接使用curl命令(centos 默认安装curl):

    curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo


    4.yum clean all
    5.yum makecache



    repo本地目录源:(最好使用本地源,不依赖网络,而且不占用带宽 但是需要一个比较全的ISO镜像)
    mount /dev/cdrom /mnt
    vi /etc/yum.repos.d/local.repo
    [local]
    baseurl=file:///mnt
    gpgcheck=0
    enable=1

    参考:
    Linux 使用系统ISO制作yum源:https://www.cnblogs.com/cac2020/p/9785999.html

    yum命令:
    yum repolist
    #清空依赖关系缓存
    yum clean all
    #更新依赖关系
    yum makecache
    yum update

    查询:
    yum list
    yum search
    yum info

    安装&卸载:
    yum install
    remove|erase

    yum命令:分组
    yum grouplist
    yum groupinfo
    yum groupinstall
    yum groupremove
    yum groupupdate

    中文展示
    1.展示分组清单
    yum grouplist
    2.安装和更新中文包
    yum groupinstall "Chinese Support"
    3.修改字符集

    [root@node1 yum.repos.d]# echo $LANG
    en_US.UTF-8
    [root@node1 yum.repos.d]# LANG=zh_CN.UTF-8
    [root@node1 yum.repos.d]# echo $LANG
    zh_CN.UTF-8
    [root@node1 yum.repos.d]# ll
    总用量 12
    drwxr-xr-x. 2 root root 4096 12月 24 00:26 bak
    -rw-r--r--. 1 root root 2523 6月 16 2018 CentOS-Base.repo
    -rw-r--r--. 1 root root 664 5月 11 2018 epel.repo

    4.支持查看中文帮助文档
    4.1增加epel的repo:(同上配置阿里源)
    wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
    4.2 yum clean all
    4.3 yum makecache
    4.4 yum search man-pages
    4.5 yum install -y man man-pages man-pages-zh-CN

    测试:
    man bash

    补充:

    上传文件工具:

    安装:yum install lrzsz -y
    
    使用:rz -y
  • 相关阅读:
    CentOS7配置RAID10
    CentOS7配置RAID5笔记
    CentOS7改主机名hostname
    CentOS7设置光盘镜像为本地yum源
    VMware安装Windows Server 2008
    VMware安装CentOS7
    xss漏洞介绍
    pakichu-暴力破解
    搭建xcode9的IOS开发环境
    dvwa之xss
  • 原文地址:https://www.cnblogs.com/cac2020/p/10165060.html
Copyright © 2011-2022 走看看