首页 未分类

1.sudo 配置问题

若开始是使用非root用户进入系统,需要先对sudo进行配置才能使用sudo

1.1 打开terminal,输入su - 进入root用户:

su -

1.2 输入 vim /etc/sudoer

vim /etc/sudoers

在root ALL=(ALL) ALL下一行添加:我的用户名为hsm所以添加

hsm ALL=(ALL) ALL

保存

2.注册redhat

注册redhat,解决yum不能使用的问题

2.1 打开网址

https://developers.redhat.com/auth/realms/rhd/login-actions/registration?client_id=account&tab_id=gi8s4jqIdOU

用教育邮箱注册帐号
然后登录

然后打开RedHat的Terminal,输入:

subscription-manager register --username=[用户名] --password=[密码] --auto-attach

显示下图就所哦名安装好啦

3.yum换源

3.1 远程仓库

要是使用官方源感觉下载很慢的话,可以考虑换CentOS

首先删除本地yum

rpm -aq | grep yum | xargs rpm -e --nodeps
rpm -aq | grep python-iniparse | xargs rpm -e --nodeps

检查是否卸载

rpm -aq | grep yum
rpm -aq | grep python

下载yum安装包

wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-3.4.3-163.el7.centos.noarch.rpm
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-52.el7.noarch.rpm

安装yum包

rpm -ivh python-iniparse-0.4-9.el7.noarch.rpm yum-metadata-parser-1.1.4-10.el7.x86_64.rpm yum-3.4.3-163.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.31-52.el7.noarch.rpm

添加源

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

添加

[base]
name=CentOS-$releasever - Base
baseurl=https://mirrors.aliyun.com/centos/7/os/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=https://mirrors.aliyun.com/centos/7/updates/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7

[extras]
name=CentOS-$releasever - Extras
baseurl=https://mirrors.aliyun.com/centos/7/extras//$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7

[centosplus]
name=CentOS-$releasever - Plus
baseurl=https://mirrors.aliyun.com/centos/7/centosplus//$basearch/
gpgcheck=1
enabled=0

清除本地缓存

yum clean all
yum makecache

3.2 换本地源

配置本地源:

(1)将rehl镜像文件拷贝到系统中

(2)将镜像挂载到/mnt/yum 命令为mount 镜像.iso /mnt/yum

(3)编辑yum源配置文件

[yum]

name=yum

baseurl=file:///mnt/yum/

gpgcheck=0

enable=1

(4)通过 yum repolist命令检查源是否正常

安装mysql:

再终端输入

yum update #更新资源包

yum install mysql #安装mysql

systemctl start mysqld.service #开启mysql服务

systemctl status mysqld.service #检查mysql服务状态



文章评论