zoukankan      html  css  js  c++  java
  • 7.6 yum更换国内源 7.7 yum下载rpm包 7.8/7.9 源码包安装

    [root@lizhipeng01 ~]# cd /etc/yum.repos.d
    [root@lizhipeng01 yum.repos.d]# ls
    dvd.repo
    [root@lizhipeng01 yum.repos.d]# rm -f dvd.repo

    [root@lizhipeng01 yum.repos.d]# ls                之前已经做过一次,删除重新做
    CentOS7-Base-163.repo
    [root@lizhipeng01 yum.repos.d]# rm -f CentOS7-Base-163.repo
    [root@lizhipeng01 yum.repos.d]# curl -O http://mirrors.163.com/.help/CentOS7-Base-163.repo
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 1572 100 1572 0 0 4020 0 --:--:-- --:--:-- --:--:-- 4020
    [root@lizhipeng01 yum.repos.d]# ls
    CentOS7-Base-163.repo
    [root@lizhipeng01 yum.repos.d]# yum list

    [root@lizhipeng01 yum.repos.d]# yum install -y epel-release

    [root@lizhipeng01 yum.repos.d]# ls
    CentOS7-Base-163.repo epel.repo epel-testing.repo

    默认下载到这个路径下了

    [root@lizhipeng01 yum.repos.d]# yum install zsh --downloadonly --downloaddir=/tmp/    指定下载路径/tmp/

    [root@lizhipeng01 yum.repos.d]# ls /tmp/
    1.txt.gz passwd yum_save_tx.2018-01-08.04-02.qEI5H9.yumtx
    2.txt yum_save_tx.2018-01-08.03-48.cHBmYa.yumtx yum_save_tx.2018-01-08.04-07.WnWCQB.yumtx
    8 yum_save_tx.2018-01-08.03-55.9n9vMR.yumtx zsh-5.0.2-28.el7.x86_64.rpm

    [root@lizhipeng01 yum.repos.d]# yum install vim-enhanced --downloadonly --downloaddir=/tmp/   下载vim-enhanced,提示已经安装过了
    Failed to set locale, defaulting to C
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    * epel: mirrors.ustc.edu.cn
    Package 2:vim-enhanced-7.4.160-2.el7.x86_64 already installed and latest version


    Nothing to do

    [root@lizhipeng01 yum.repos.d]# yum reinstall vim-enhanced --downloadonly --downloaddir=/tmp/        reinstall重新安装

    [root@lizhipeng01 yum.repos.d]# ls /tmp/
    1.txt.gz vim-enhanced-7.4.160-2.el7.x86_64.rpm yum_save_tx.2018-01-08.04-07.WnWCQB.yumtx
    2.txt yum_save_tx.2018-01-08.03-48.cHBmYa.yumtx yum_save_tx.2018-01-08.04-11.P33d3C.yumtx
    8 yum_save_tx.2018-01-08.03-55.9n9vMR.yumtx zsh-5.0.2-28.el7.x86_64.rpm
    passwd yum_save_tx.2018-01-08.04-02.qEI5H9.yumtx

    安装源码包3步骤

    1.   ./configure.这一步会自动检测Linux系统与相关的套件是否有编译该源码包时所需要的库,因为一旦缺少某个库,就不能完成编译。只有检测通过后,才会生成Makefile文件。

    2.    make。使用这个命令,会根据Mkefile文件中预设的参数进行编译,这一步其实就是gcc在工作。

    3.    make install。这一步是安装步骤,用于创建相关软件的存放目录和配置文件。

    [root@lizhipeng01 yum.repos.d]# cd
    [root@lizhipeng01 ~]# cd /usr/local/src/
    [root@lizhipeng01 src]# ls

    [root@lizhipeng01 src]# wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.2.32.tar.gz

    [root@lizhipeng01 src]# ls
    httpd-2.2.34.tar.gz

    [root@lizhipeng01 src]# tar -zxvf httpd-2.2.34.tar.gz   解压缩

    [root@lizhipeng01 httpd-2.2.34]# ./configure --prefix=/usr/local/apache2

    [root@lizhipeng01 httpd-2.2.34]# echo $?             上一条命令报错了,原因是没有gcc

    1

    [root@lizhipeng01 httpd-2.2.34]# yum install -y gcc

    root@lizhipeng01 httpd-2.2.34]# ./configure --prefix=/usr/local/apache2

    [root@lizhipeng01 httpd-2.2.34]# echo $?
    0

    [root@lizhipeng01 httpd-2.2.34]# make

    [root@lizhipeng01 httpd-2.2.34]# echo $?
    0

    [root@lizhipeng01 httpd-2.2.34]# make install

    [root@lizhipeng01 httpd-2.2.34]# echo $?
    0

    [root@lizhipeng01 httpd-2.2.34]# ls /usr/local/apache2/
    bin build cgi-bin conf error htdocs icons include lib logs man manual modules

  • 相关阅读:
    查找正序排列的List中缺失的日期数据的一个算法
    了解下C#异常时的输出
    Environment.Exit(0) 、Application.Exit() 、this.Close() 、this.Dispose()的区别
    java--多线程之后台线程
    java--线程状态【转】
    DRP项目总结
    Java实现 蓝桥杯 算法训练 矩阵乘法
    Java实现 蓝桥杯 算法训练 矩阵乘法
    Java实现 蓝桥杯 算法训练 矩阵乘法
    Java实现 蓝桥杯 算法训练 大小写转换
  • 原文地址:https://www.cnblogs.com/sisul/p/8231729.html
Copyright © 2011-2022 走看看