安装ubuntu的坑&RHEL7配置

1.需要其他设置->分区,分区需要有/根目录分区和swap空间,后者文件系统类型选择swap,其他都是ext4

2.普通配置电脑,安装16.04.5 LTS,不要安装最新的,安装重启后卡在那里,需要右键设置,移除安装镜像,仍然报错,使用虚拟机重启按钮,可正常启动

3.如果本地物理机已设置了对VMNet8的共享,虚拟机设置了NAT网关、子网网段、DHCP等,安装ubuntu采用了NAT模式,安装好的ubuntu是自动配置了ip网络的,可直接上网。NAT方式配置物理机、虚拟机参照另一篇Red Hat以NAT连接网络的博文即可

4.选择英文作为语言,时区可选shanghai

5.勾选配置更新和安装第三方软件

6.内存要够大,至少选择2G,CPU选择1个4核,与物理机的一致,硬盘选择50G,保证ubuntu可以不卡顿

7.ifconfig查看网络:

ens33     Link encap:Ethernet  HWaddr 00:0c:29:f2:a4:51  
          inet addr:172.20.10.2  Bcast:172.20.10.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fef2:a451/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7295 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4940 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:5341840 (5.3 MB)  TX bytes:805054 (805.0 KB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:4922 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4922 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:373210 (373.2 KB)  TX bytes:373210 (373.2 KB)

使用sudo vi /etc/network/interfaces按照其查询到的网络信息编辑网络连接,添加:

auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address xxx.xxx.xxx.xxx
netmask xxx.xxx.xxx.xxx
gateway xxx.xxx.xxx.xxx

hwaddress ether [your_mac_address] 让网络配置帮顶到某张物理mac网卡上。

把xxx.xxx.xxx设置为你要个性的信息既可,其中
auto eth0  #开机自动连接网络
iface eth0 inet static   #static表示使用固定ipdhcp表述使用动态ip
address 是本机IP地址
netmask 子网掩码
gateway 网关

如果使用nano编辑的话
ctrl+o  #保存配置
ctrl+x  #退出

设置DNS

linux系统的DNS信息是保存在/etc/resolv.conf , 但是在ubuntu中用vim打开这个文件你会发现有如下文字的提示

DO NOT EDIT THIS FILE BY HAND — YOUR CHANGES WILL BE OVERWRITTEN

所以不能直接个性这个文件,这个内容可能会被覆盖

在ubuntu中dns信息是放在/etc/resolvconf/resolv.conf.d/目录下

一般情况下这个目录下有base和head两个文件夹

vim /etc/resolvconf/resolv.conf.d/base

nameserver 8.8.8.8
nameserver 114.114.114.114

保存后执行

resolvconf -u

用以下命令使网络设置生效

service networking restart
sudo /etc/init.d/networking restart

注意必须配置DNS地址,否则局域网可用,但无法上网!

有时需要添加MAC地址,解决网络重启失败:

拷贝ifconfig查询到的HWaddr地址,添加到/etc/network/interfaces,完整配置如下:

auto ens33
iface ens33 inet static
pre-up ifconfig ens33 hw ether 00:0c:29:f2:a4:51
address 172.20.10.2
netmask 255.255.255.0
gateway 172.20.10.30

/etc/resolvconf/resolv.conf.d/base文件配置:

nameserver 192.168.0.1

该地址配置成物理机网关即可

操作:(注意有时需要重启系统之后,重启网络命令才能执行成功,否则提示失败,返回错误码!!)

注意:有时ubuntu安装后的默认ip设置成了和子网ip或网段起始ip一样,会因为冲突而造成无法上网!(表现为浏览器无法上网,VMnet8虚拟网关无法ping通)这时需要在/etc/network/interfaces中改动这个ip为其他,然后重启网络,重启虚拟机,才能生效、上网!!

baigang@baigang-virtual-machine:~$ sudo vi /etc/network/interfaces
[sudo] password for baigang:
baigang@baigang-virtual-machine:~$ sudo vi /etc/resolvconf/resolv.conf.d/base
baigang@baigang-virtual-machine:~$ resolvconf -u
/etc/resolvconf/update.d/libc: 133: /etc/resolvconf/update.d/libc: cannot create /run/resolvconf/resolv.conf_new.2373: Permission denied
run-parts: /etc/resolvconf/update.d/libc exited with return code 2
baigang@baigang-virtual-machine:~$ sudo resolvconf -u
baigang@baigang-virtual-machine:~$ service networking restart
baigang@baigang-virtual-machine:~$ sudo /etc/init.d/networking restart
[ ok ] Restarting networking (via systemctl): networking.service.

8.点击ubuntu设置按钮,使用其中的Displays修改分辨率(这里修改为1280X768),改变ubuntu在物理机屏幕上显示屏幕过小的问题

9.ubuntu安装VMWare-tools灰色或提示CD驱动器问题,参照:(注意安装完成后需要重启生效

https://blog.csdn.net/zjj417/article/details/72530885

10.替换apt源,参照:(注意修改/etc/apt/sources.list文件需要使用sudo,因为非root权限是只读,无法保存!!)

https://www.cnblogs.com/flyinggod/p/7979108.html

安装vim的问题,参照:

https://blog.csdn.net/zsscy/article/details/8628311

https://jingyan.baidu.com/article/046a7b3efd165bf9c27fa915.html

安装浏览器flash播放插件,参照(apt安装成功则直接重启浏览器即可正常浏览flash视频,无需复制任何文件):

https://jingyan.baidu.com/article/3c48dd34a2952ee10be35820.html

https://blog.csdn.net/fesdgasdgasdg/article/details/63683754

https://blog.csdn.net/weixin_40522162/article/details/80287296

11.千万不要安装linux搜狗输入法!!当前环境安装了就把系统弄坏,设置消失,且无法登录!!

12.虚拟机克隆:

注意克隆到不同目录

注意需要在克隆完成后,虚拟机关闭的情况下,平均分配一下原来单个虚拟机占用的内存、CPU资源,否则几个虚拟机同时开启会非常卡,根本无法使用!!

注意需要同时更改克隆虚拟机的ip硬件地址!!如果只更改ip,会因为硬件地址冲突而造成一台虚拟机无法上网!!彼此也无法ping通!!更改方法见上文,然后重启虚拟机才能生效!!

注:RHEL7的克隆,网卡配置问题:生成了自动配置文件

https://zhidao.baidu.com/question/2119849251302740547.html

https://www.linuxidc.com/Linux/2014-09/107375p3.htm

配置ip无效问题:打开图形桌面右上网络图标,将克隆生成的自动配置文件和网络配置文件的硬件MAC地址都改成ifconfig显示的那个,然后重启网络

https://www.aliyun.com/jiaocheng/122603.html

13.rpm详解

rpm安装命令详解(RHEL/CentOS系):

https://www.cnblogs.com/zqwang0929/p/3352237.html

https://blog.csdn.net/lasoup/article/details/78518476

Ubuntu下rpm包安装问题(无法直接安装,需要安装alien进行转换,转换成deb包):

https://www.linuxidc.com/Linux/2017-08/146269.htm

https://blog.csdn.net/xiaoxiaoxuewen/article/details/7550176

https://blog.csdn.net/suleil1/article/details/49471723

14.yum源配置

yum源本地配置和yum源更换(rhel7经实验可以,不适合Ubuntu):

https://www.linuxidc.com/Linux/2017-01/139140.htm

https://blog.csdn.net/kangvcar/article/details/73477730

本地配置:注意该rhel7虚拟机cd-rom中需要装有安装系统时的iso镜像!!

另外注意:有时提示Could not open/read file:///mnt/repodata/repomd.xml,需要重新挂载光盘镜像:

https://blog.csdn.net/moranxue/article/details/44460589

远程yum源配置(使用yum安装出现This system is not registered to Red Hat Subscription Management解决卸载rhel7的yum安装centos7的yum):

https://qingfengjushi1.iteye.com/blog/2282986

http://blog.51cto.com/qingwang/1551228

https://blog.csdn.net/qq_39719589/article/details/81349975

https://blog.csdn.net/ytx2014214081/article/details/78468947

https://blog.csdn.net/indexman/article/details/79570577

linux安装rarlinux解压rar文件和遇见的问题(64位机器安装了32位rarlinux造成失败):

https://blog.csdn.net/u010490688/article/details/79072259

https://www.cnblogs.com/xcloudbiz/articles/5144970.html

其他远程源参考:

http://mirrors.163.com/.help/centos.html

https://www.cnblogs.com/zhangguantaomj/p/6431431.html

https://blog.csdn.net/qq_27754983/article/details/73693061

https://www.cnblogs.com/274914765qq/p/7008847.html

https://www.cnblogs.com/sunshine-H/p/8116701.html

https://blog.csdn.net/qq_33404395/article/details/80235062

参考博文:

https://www.cnblogs.com/yudar/p/4446975.html

https://blog.csdn.net/liuqingsongmsdn2014/article/details/76089871/

https://segmentfault.com/q/1010000006678955/a-1020000006681832

https://jingyan.baidu.com/article/adc815139ddcc4f723bf7339.html

https://blog.csdn.net/u014236541/article/details/78349243/

https://blog.csdn.net/shenzhen_zsw/article/details/74025066

https://www.cnblogs.com/EasonJim/p/7857671.html

原文地址:https://www.cnblogs.com/free-wings/p/9904445.html