Red Hat更换Centos6源

RedHat使用自带的yum源是需要注册的,不想注册的可以替换本地源使用

工控机型号: QOTOM 190G4-M

系统: Red Hat Enterprise Linux Server release 6.7 (Santiago) x86_64

Red Hat Enterprise Linux ISO 镜像下载:

https://wanghualang.pipipan.com/dir/13133650-26232498-a8efb3/

软件包下载地址:

x86 地址:http://mirrors.163.com/centos/6/os/i386/Packages/

x86_64 地址:http://mirrors.163.com/centos/6/os/x86_64/Packages/

替换centos6源

  1. 卸载yum源

    1
    rpm -qa|grep yum|xargs rpm -e --nodeps
  2. 安装yum软件包

    1
    2
    3
    4
    5
    rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm

    rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

    rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
  3. 更改yum源

    编辑CentOS6-Base-163.repo文件,存放到/etc/yum.repo.d

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    [base]
    name=CentOS-6 - Base - 163.com
    baseurl=http://mirrors.163.com/centos/6/os/$basearch/
    #mirrorlist=http://mirrorlist.centos.org/?release=6$releasever&arch=$basearch&repo=os
    gpgcheck=1
    gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

    #released updates
    [updates]
    name=CentOS-6 - Updates - 163.com
    baseurl=http://mirrors.163.com/centos/6/updates/$basearch/
    #mirrorlist=http://mirrorlist.centos.org/?release=6$releasever&arch=$basearch&repo=updates
    gpgcheck=1
    gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

    #additional packages that may be useful
    [extras]
    name=CentOS-6 - Extras - 163.com
    baseurl=http://mirrors.163.com/centos/6/extras/$basearch/
    #mirrorlist=http://mirrorlist.centos.org/?release=6$releasever&arch=$basearch&repo=extras
    gpgcheck=1
    gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

    #additional packages that extend functionality of existing packages
    [centosplus]
    name=CentOS-6 - Plus - 163.com
    baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/
    #mirrorlist=http://mirrorlist.centos.org/?release=6$releasever&arch=$basearch&repo=centosplus
    gpgcheck=1
    enabled=0
    gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

    #contrib - packages by Centos Users
    [contrib]
    name=CentOS-6 - Contrib - 163.com
    baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/
    #mirrorlist=http://mirrorlist.centos.org/?release=6$releasever&arch=$basearch&repo=contrib
    gpgcheck=1
    enabled=0
    gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
  4. 清除缓存文件及目录

    1
    yum clean all
  5. 获取yum列表

    1
    yum makecache

图形界面安装

  1. 查看当前系统运行级别

    1
    runlevel
  2. 查看桌面环境的组件

    1
    yum grouplist|more
  3. 安装GNOME图形界面

    1
    2
    yum groupinstall “X Window System”  -y
    yum groupinstall “Desktop” -y

安装成功后输入startx,或者init 5, 即可切换到图形界面(临时生效)
修改/etc/inittab文件中的id:3:initdefault将3改为5(永久生效)

卸载图形化界面

利用组卸载命令 yum groupremove + 组包名即可,其中组包名就是我们之前上面安装的。

------ 本文结束------