文章目錄
- 前言
- ping 測試網絡
- 排查原因
- 排查虛擬機的虛擬網絡是否開啟
- 檢查net8虛擬網絡和Centos 7的ip地址是否在一個局域網
- 點擊虛擬網絡編輯器
- 點擊更改設置
- 記錄net8的虛擬網絡地址
- ip a
- 記錄Centos 7的ip地址
- 比較net8和Centos 7的ip地址是否在一個網段
- 解決問題
- 問題
- 解決辦法
- 修改net8的ip地址,讓其作為Centos 7的網管
- 讓net8的DHCP重新分配一個子ip
- MobaXterm連接
- 進入yum軟件源配置文件夾
- 查看需要的軟件源 CentOS-Base.repo
- 下載到本地
- 本地查看軟件源
- CentOS-Base.repo
前言
如何安裝別人分享的Centos 7
上面這篇文章詳細講述了,用別人分享的虛擬機的好處,這里我們繼續講解這個虛擬機的好處,有完善能用的軟件源,這個非常的重要。自己網上找,就需要不斷的試錯,而且還不容易找到可以使用的軟件源,這里我們Copy別人分享的Centos 7的軟件源。
ping 測試網絡
一直閃爍,說明網絡配置有問題,可能沒有連接到虛擬網卡
排查原因
排查虛擬機的虛擬網絡是否開啟
如果沒有已啟用,就右鍵啟用
檢查net8虛擬網絡和Centos 7的ip地址是否在一個局域網
點擊虛擬網絡編輯器
點擊更改設置
記錄net8的虛擬網絡地址
192.168.230.0
ip a
查看Centos 7的ip地址是否有
記錄Centos 7的ip地址
192.168.127.126
比較net8和Centos 7的ip地址是否在一個網段
明顯不在一個網段
解決問題
問題
net8和Centos 7的ip地址不在一個網段
解決辦法
修改net8的ip地址,讓其作為Centos 7的網管
讓net8的DHCP重新分配一個子ip
ens33 網卡名字
dhclient ens33
根據自己的實際情況改寫dhclient后面的網卡名字
MobaXterm連接
選擇保存密碼,省的輸的麻煩
密碼最少7位
勾選跟隨目錄
進入yum軟件源配置文件夾
cd /etc/yum.repos.d/
推薦第一個,具體根據個人選擇
查看需要的軟件源 CentOS-Base.repo
下載到本地
點擊OK
本地查看軟件源
明顯可以看出是阿里的源,總體還是不錯的
CentOS-Base.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#released updates
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/http://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/http://mirrors.cloud.aliyuncs.com/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7