快速安装CentOS及Python

1、安装CentOS镜像

1.1下载镜像

镜像下载链接:点击下载

1.2安装系统

VMware安装系统不演示了,安装时候选择mini安装,最简化安装。
如果是CentOS8 安装时候碰到让选择Install Source,可以使用阿里云的镜像。

https://mirrors.aliyun.com/centos/8-stream/BaseOS/x86_64/os/

这个镜像不一定会一直存在,如果不存在了自己去网上重新找一个

2、配置网络

2.1、选择Vmware网卡连接方式

我这选择了桥接模式,勾上复制物理网络连接状态
网络连接

2.2、设置VMware桥接模式绑定的网卡

选择网卡

2.3、 配置CentOS的网卡

执行命令: vi /etc/sysconfig/network-scripts/ifcfg-ens33
修改以下配置,IP配置为宿主机的同网段。网关和掩码设置成相同。
配置网卡

3、配置yum源

3.1、删除原始yum源

cd /etc/yum.repos.d
rm -rf *.repo

3.2、配置国内yum源

参考:https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.3e221b11HvRhdj

CentOS7参考:https://blog.csdn.net/qq_33180069/article/details/113859801

3.3、安装epel

dnf -y install epel-release
dnf clean all
dnf makecache
dnf repolist

4、安装python、pip

4.1、安装python

yum install python3
alternatives --set python /usr/bin/python3
同时会安装pip3

4.2、修改pip3源、创建pip软链接

mkdir ~/.pip
touch ~/.pip/pip.conf
vi ~/.pip/pip.conf

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn # trusted-host 
ln -s /usr/bin/pip3 /usr/bin/pip

国内镜像有以下这些 自行选择:
http://pypi.douban.com/simple/ 豆瓣
http://mirrors.aliyun.com/pypi/simple/ 阿里
http://pypi.hustunique.com/simple/ 华中理工大学
http://pypi.sdutlinux.org/simple/ 山东理工大学
http://pypi.mirrors.ustc.edu.cn/simple/ 中国科学技术大学
https://pypi.tuna.tsinghua.edu.cn/simple 清华

5、上传/下载 文件

5.1、使用SecureCRT连接CentOS

安装软件:
yum -y install lrzsz
上传文件(输入命令之后会出现选择框):
rz
下载文件(目录为CRT工具会话选项中的路径):
sz [filename]
路径

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值