VMvare Redhat source configuration network configuration yum

Cloud platform, big data platform basically deployed on linux server, this blog describes how to build a platform in a virtual machine environment. It includes the following sections:

First, the virtual machine network (to ensure the system can be networked within a virtual machine, you can access each other with the host).

VM: vmvare.

linux system: Redhat7.0

1. Set the host IP

vmvare two virtual network card will appear in the host's network configuration after installation.

 

View VMnet8 of ipv4

Setup the wireless network may share

2, view the virtual machine IP

Enter Edit "Virtual Network Editor, edit the same network segment with the host vmnet8 VMnet8 of.

 

 

3, modify the virtual machine configuration file system IP

Which IPADDR vmnet8 virtual machine in the same network segment as the network segment.

4, restart the virtual machine system network services.

service network restart

5. Verify.

ping www.baidu.com

Second, the configuration YUM source.

1, the local source configuration.

1.1 will mount ISO file to a virtual machine

1.2 lsblk command to view the available disk.

sr0 is ISO.

1.3 Create a mount point.

Create a subdirectory mkdir / mnt / cdrom # Create a directory cdrom in / mnt

1.4 permanent mount

We mount the device information in the / etc / fstab inside, so we want to permanently mount the need to modify the fstab file. Open the file with vim, we can see three lines of information, it is to mount another partition information, so we are now trying our mounts add information on the disc past.

 

We add the following information to mount the disc past

/dev/sr0        /mnt/cdrom      iso9660   defaults    0    0

 


After the addition, save and exit.

Then execute mount -a. This command means that all file system mount fstab file. We can see, we have a good mount.

 

After you mount the iso file, we have to modify the configuration file source /etc/yum.repos.d/, it defaults to a file, we delete it, and then create their own ending .repo file, opened with vim editor . Enter the following configuration saved.

[name]               #括号中的名称为仓库源名称,通常为字母和数字,必须填写name=my new repo     #对yum的描述,可写可不写baseurl=file:///mnt/cdrom    #baseurl表示声明yum可以管理并使用的rpm包路径,必须填写enabled=1            #enabled表示当前仓库是否开启,1为开启,0为关闭,此项不写默认为开启gpgcheck=0           #gpgcheck表示安装rpm包时,是否基于公私钥对匹配包的安全信息,1表示开启,                     #0表示关闭,此项不写默认为验证

然后执行  yum clean all   ,清空缓存信息。 

 验证。

yum  list | wc -l   统计列出所有包的数量,如果列出了,说明yum源配置完成

1.5 配置网络yum源。

由于Red Hat Enterprise Linux7的更新包只对注册的用户生效,所以需要自己手动改成Centos的更新包。

首先查看redhat7系统本身安装的yum软件包 ,redhat本身安装了6个关于yum的软件包。

rpm  -qa | grep yum  

卸载这些软件包的指令

rpm -qa | grep yum | xargs rpm -e --nodeps   #不检查依赖关系,直接卸载
然后重新安装centos的yum软件包。

保证上网正常

阿里云网络源地址:https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/  
网易163网络源地址:http://mirrors.163.com/  
CentOS网络源地址:http://centos.ustc.edu.cn/centos/  

下载删除的包。也可以直接拷贝到系统中。
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-158.el7.centos.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-utils-1.1.31-45.el7.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-updateonboot-1.1.31-45.el7.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-45.el7.noarch.rpm
输入指令rpm -ivh yum-* 安装。

[root@linuxprobe home]# rpm -ivh yum-*
warning: yum-3.4.3-158.el7.centos.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
error: Failed dependencies:
    python-urlgrabber >= 3.10-8 is needed by yum-3.4.3-158.el7.centos.noarch
    rpm >= 0:4.11.3-22 is needed by yum-3.4.3-158.el7.centos.noarch
遇到报错,依赖项问题。

另外再回去找安装包下载下来:

wget http://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-4.11.3-32.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-8.el7.noarch.rpm
输入指令更新rpm。

rpm -Uvh rpm-4.11.3-32.el7.x86_64.rpm --nodeps
rpm -Uvh python-urlgrabber-3.10-8.el7.noarch.rpm --nodeps
再次运行rpm -ivh yum-*。

修改 /etc/yum.repos.d/ 下的文件了,这里和配置本地yum源修改一样。


[base]

name= yum repo

baseurl=http://mirrors.aliyun.com/centos/7/os/$basearch/

enabled=1

gpgcheck=0
 

清空缓存。

yum clean all

2,安装桌面组件。

yum groupinstall -y "Server with GUI"

startx

init 3 命令界面

 

Guess you like

Origin blog.csdn.net/ws_developer/article/details/92403233