CentOS 7 系统安装初始化之yum,linux系统使用起步

一、下载如下python-[]及yum-[ ],四个安装包,并用如下命令安装

http://mirrors.163.com/centos/7/os/x86_64/Packages/

rpm -ivh --force --nodeps python-iniparse*

rpm -ivh --force --nodeps yum-metadata-parse*

rpm -ivh --force --nodeps yum-3.4.3-168.el7.*

rpm -ivh --force --nodeps yum-plugin-fastestmirror-*

rpm -ivh --force --nodeps yum-cron-3.4.3*

二、配置阿里巴巴YUM源

1、备份本机yum配置文件:CentOS-Base.repo

cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2、下载阿里巴巴YUM源

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.repo3

3、升级、清除、生成yum缓存(本地缓存必须的yum仓库源里的包资源,本机使用)

yum upgrade # 升级yum

yum clean all # 清除系统所有的yum缓存

yum makecache # 生成yum缓存

三、配置阿里巴巴epel-7.repo的YUM源

alibaba epel:

wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo

yum upgrade # update the yum

yum clean all # 清除系统所有的yum缓存

yum makecache # 生成yum缓存

四、配置清华大学的repo的YUM源:复制CentOS-Base.repo:下所有内容,替换原CentOS-Base.repo里全部内容,按步骤操作,记得备份此文件

Qinghua repo:

cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

vim /etc/yum.repos.d/CentOS-Base.repo

CentOS-Base.repo:

CentOS-Base.repo

The mirror system uses the connecting IP address of the client and the

update status of each mirror to pick mirrors that are updated to and

geographically close to the client. You should use this for CentOS updates

unless you are manually picking other mirrors.

If the mirrorlist= does not work for you, as a fall back you can try the

remarked out baseurl= line instead.

base

name=CentOS-$releasever - Base

baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever\&arch=$basearch\&repo=os

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#released updates

updates

name=CentOS-$releasever - Updates

baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/updates/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever\&arch=$basearch\&repo=updates

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful

extras

name=CentOS-$releasever - Extras

baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever\&arch=$basearch\&repo=extras

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages

centosplus

name=CentOS-$releasever - Plus

baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever\&arch=$basearch\&repo=centosplus

gpgcheck=1

enabled=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

yum upgrade # update the yum

yum clean all # 清除系统所有的yum缓存

yum makecache # 生成yum缓存

五、配置RPM-GPG-KEY-EPEL-7文件

cd /etc/pki/rpm-gpg

wget https://archive.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7

六、安装如下支持软件包

yum install -y htop

yum install -y epel-release

七、安装NTFS硬盘格式支持:即windows下的硬盘,加载显示在linux的CentOS 7系统里

yum install ntfs-3g

备注:打开NTFS格式的磁盘时,如果是用户账户,则需要输入root账户密码。此为CentOS 7的安全管理。

相关推荐
Charlene Fung1 小时前
vs code远程自动登录服务器,无需手动输入密码的终极方案(windows版)
运维·服务器·vscode·ssh
麟城Lincoln1 小时前
【RHCSA-Linux考试题目笔记(自用)】servera的题目
linux·笔记·考试·rhcsa
碣石潇湘无限路1 小时前
【部署与总结】从本地运行到公网服务器的全过程
运维·服务器
linux修理工1 小时前
ipmitool 使用简介(ipmitool sel list & ipmitool sensor list)
运维·服务器
寻月隐君1 小时前
保姆级教程:Zsh + Oh My Zsh 终极配置,让你的 Ubuntu 终端效率倍增
linux·后端·命令行
XM-54581 小时前
2025微信小程序wxapkg解包全攻略
linux·运维·小程序
朗晴2 小时前
文本编辑器VIM的使用方法!
linux·运维·服务器
小林up2 小时前
github push:ssh: connect to host github.com port 22
运维·ssh·github
梁bk5 小时前
[Nginx]反向代理和负载均衡
运维·nginx·负载均衡
2401_8260976210 小时前
JavaEE-Linux环境部署
java·linux·java-ee