linux实战--(1)--操作系统软件安装及配置

版权声明:编码不易,禁止转载 https://blog.csdn.net/u_ascend/article/details/86256975

1、基于vmware安装

写一串干干净净的linux系列文章

作为一名程序员,linux总是与我们相生相伴,而大多数人使用的windows平台。那么我们就需要虚拟机来模拟各种linux环境了。本文介绍了使用vmware和centos在个人电脑上创建虚拟机环境的前世今生。

软件:
vmware12 链接:https://pan.baidu.com/s/1an5G9g3R-NLCA2ceMrVOIA 提取码:bu3m
centos7 链接:https://pan.baidu.com/s/1O6zgTSqJDqPCBGgaQEhL3w 提取码:3s6j

安装过程我就不仔细描述了,下面是centos安装过程中的简单配置

建议安装过程使用NAT模式,这样可以共享主机的ip不占用公共网段的资源,也防止了别人的机器与自己的机器相互冲突

在这里插入图片描述

hostname adeng
用户
root 123456
adeng 123456
想让外部网络访问虚拟机,需要配置映射端口
在这里插入图片描述

2、基于Hyper-V安装

安装过程参考:ubuntu18–(1)–安装篇 ,只是选择的镜像不同而已。

主要目录规划
黑色为目录,绿色为文件
opt
····install
········apache-maven-3.5.4
········soft
············apache-maven-3.5.4-bin.tar.gz
············jdk-8u172-linux-x64.rpm
········docker
····project
········java
········python

3、配置yum源

国内主要的yum源(163、阿里云、epel)
三选一吧

3.1、 阿里云镜像源

# 备份源仓库
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.origin
# 下载源
# CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
# 或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

# CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
# 或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

# CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
# 或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

# 生成缓存
yum clean all # 或者 rm -rf /var/cache/yum
yum makecache

3.2、 163镜像源

# 备份源仓库
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.origin
# 下载源
# CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS5-Base-163.repo

# CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo

# CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

# 生成缓存
yum clean all # 或者 rm -rf /var/cache/yum
yum makecache

3.3、 EPEL源

epel源(Extra Packages for Enterprise Linux)是由 Fedora 社区打造,为 RHEL 及衍生发行版如 CentOS等提供高质量软件包的项目。装上了 EPEL,就像在 Fedora 上一样,可以通过 yum install 软件包名,即可安装很多以前需要编译安装的软件、常用的软件或一些比较流行的软件,比如现在流行的nginx、htop、ncdu、vnstat等等,都可以使用EPEL很方便的安装更新。

直接通过执行命令安装: yum install epel-release

若失败,可尝试如下

# 备份源仓库
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.origin
# 下载源
# CentOS 5
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-5.repo
# 或者官方
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm

# CentOS 6
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
# 或者官方
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm

# CentOS 7
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
# 或者官方
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

看这里,看这里
文章总目录:博客导航
参考文章:https://blog.csdn.net/u_ascend/article/details/86256975

猜你喜欢

转载自blog.csdn.net/u_ascend/article/details/86256975