RHEL7.0使用centos的yum源,並安裝python3.6.9 和git2.9.5 htop

  • 配置本地yum源

    1  提前下載好EPEL.iso,添加到虛擬機光驅,並在rhel7.0中創建一個文件夾用來掛載ISO
    mkdir /mnt/cdrom
    2  執行掛載
    mount -t auto -o loop /dev/cdrom /mnt/cdrom
    3  創建本地源文件並編輯
    vi /etc/yum.repos.d/local.repo
    添加以下代碼:
    [local]
    name=local
    baseurl=file:///mnt/cdrom
    gpgcheck=0
    enabled=1
    4  配置完成,使用 yum install -y vim 測試是否可以安裝
  • 配置163yum源

    1、創建163.repo並編輯
    vi /etc/yum.repos.d/163.repo
    添加以下代碼:
    [163]
    name=163
    baseurl=http://mirrors.163.com/centos/7/os/x86_64/
    gpgcheck=0
    enabled=1
    2、配置完成,使用 yum install -y vim 測試是否可以安裝yum 安裝軟件 
    報錯:No package XXX available.
    解決:運行yum makecache生成緩存
  • 配置EPEL源

    使用fedora的源
    rpm -vih http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm 
    或者使用清華鏡像的centos的源
    wget https://mirrors.ustc.edu.cn/epel//7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
    rpm -ivh epel-release-7-11.noarch.rpm
  • 安裝 python3.6.9

    1 下載安裝wget https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tar.xz
        tar -xvf Python-3.6.9.tar.xz
        ./configure
        make && make 
    2 報錯:cannot find zlib
       依賴庫:
        yum install zlib*
  • 安裝 git 2.9.5

    1  準備git下載htop的源代碼,
    報錯 Peer reports incompatible or unsupported protocol version
    原因: git版本爲1.8.1 太舊, 卸載git1.8並手動更新git2.9.5
    wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.5.tar.xz
    tar -xvf git-2.9.5.tar.xz
    ./configure
    make && make install
    2  make 報錯:Can''t locate ExtUtils/MakeMaker.pm in @INC
    原因:缺少依賴庫
    解決:yum install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker
  • 安裝 htop

    1 下載htop 源碼包:git clone https://github.com/hishamhm/htop.git
    報錯:fatal: Unable to find remote helper for 'http'
    原因:缺http支持庫
    解決一:yum install curl-devel  
    解決二:使用git 協議:git clone --recursive git://github.com/hishamhm/htop.git  
    2 編譯安裝:./autogen.sh && ./configure && make
    3 報錯:autoconf: command not found
     原因: 缺少 libtool解決: yum install install autoconf automake libtool3
    4 報錯:configure: error: You may want to use --disable-unicode or install libncursesw
    解決:yum install ncurses-devel 
    5 繼續安裝:./autogen.sh && ./configure && make 
     提示:make[2]: Leaving directory ,
         錯誤:bash輸入htop命令,提示找不到
         原因:默認安裝到/usr/local/bin/htop,使用 ln -s /usr/local/bin/htop /bin/htop添加一條軟鏈接到/bin/htop
  • 發表評論
    所有評論
    還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
    相關文章