相信不少小伙伴在学习和开发的时候都需要用到linux系统,这里记录一下在虚拟机中使用Linux Centos7发行版。
虚拟机的安装
在虚拟机中安装centos7
初始化的一些配置
更新本地yum源
1.进入/etc/yum.repos.d目录
cd /etc/yum.repos.d
2.CentOS-Base.repo改名
默认使用的是CentOS-Base.repo,所以我们需要对默认的文件改名
mv CentOS-Base.repo CentOS-Base.repo.back
3.下载repo文件
wget http://mirrors.aliyun.com/repo/Centos-7.repo
4.Centos-7.repo改名
将下载的国内源改名为默认的文件名
mv Centos-7.repo CentOS-Base.repo
5.执行yum源更新命令
yum clean all
yum makecache
6.查看yum源
yum repolist all
如果想要安装图形界面的话,也可以执行如下命令
yum -y groups install "GNOME Desktop"
startx
systemctl set-default graphical.target # 开机默认设置成图形模式
# systemctl set-default multi-user.target # 开机默认设置成命令模式
reboot # 重启
持续更新中************************************************