CentOS6、CentOS7配置Base源和epel源


1.用yum安裝軟件報錯

Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os
error was 14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'
# 這種錯誤是因為網絡問題,沒有配置/etc/resolv.conf,在這個文件里寫入nameserver 8.8.8.8即可.

2.在CentOS6上配置Base源

# 備份你的原鏡像文件,出錯后還可以恢復
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
# 下載新的CentOS-Base.repo到/etc/yum.repos.d/
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

yum makecache  # 生成緩存
yum clean all  # 清除緩存
chkconfig NetworkManager off 
service NetworkManager stop

3.在CentOS6上配置EPEL源

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
yum repolist  # 驗證是否成功
# 如果出錯,就編輯vi epel.repo,取消baseurl的注釋,將mirrorlist行注釋,就差不多了.

# Centos7同理
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

4.CentOS6關停iptables

iptables -F 
/etc/init.d/iptables save 
chkconfig iptables off
service iptables stop

5.hping3解決編譯報錯問題

在安裝完gcc后,編譯報錯,需要編輯bytesex.h文件,添加一行
vim bytesex.h
#if      defined(__i386__) \
        || defined(__x86_64__) \
        || defined(__alpha__) \

# hping3命令用法詳解:http://www.searu.org/16384.html
# hping3命令:http://man.linuxde.net/hping3
# hping的使用方式:http://blog.csdn.net/lhl_blog/article/details/19572631
# iftop的安裝和簡單使用:https://www.cnblogs.com/chaichuan/p/4442610.htm

 

hping3命令

來自: http://man.linuxde.net/hping3
hping3命令

來自: http://man.linuxde.net/hping3


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM