1.官网下载虚拟机软件VMware,下载RedHat镜像文件(需要注册账号,x86_64版本DVDiso)
2.安装虚拟机软件,并新建系统。参考https://www.jb51.net/article/127530.htm
3.直接以root身份进入RedHat系统(切换用户,选其他,输入用户名root,再输入密码),这样可以方便的操作文件夹,没有权限的问题。
4.重新配置yum源。RedHat的yum源是需要付费使用的,可以用免费版本CentOS的yum进行替代。yum 主要功能是更方便的添加/删除/更新RPM 包,自动解决包的倚赖性问题,便于管理大量系统的更新问题,比如减少配置环境变量等操作。进入终端进行操作。redhat6的yum已经停止维护了,应该不要再使用低版本了。(参考文章:redhat7 重新配置yum源_xianjie0318的博客-CSDN博客
redhat设置yum源_逆水划小船-CSDN博客)
4.1)备份原有的yum源,然后删除原有源。在yum文件夹下操作
cd /etc/yum
mv redhat.repo redhat.repo.bak
rpm -aq | grep yum|xargs rpm -e --nodeps
4.2)查看系统版本和位数,找到对应的安装包版本下载
uname -a
cat /etc/redhat-release
4.3)在网易镜像下载对应的安装包
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metaata-parser-1.1.4-10.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-168.el7.centos.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-10.el7.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-4.11.3-45.el7.x86_64.rpm
4.4)安装软件包
rpm -Uvh rpm-4.11.3-45.el7.x86_64.rpm --nodeps
rpm -Uvh python-urlgrabber-3.10-10.el7.noarch.rpm --nodeps
rpm -ivh yum-3.4.3-168.el7.centos.noarch.rpm yum-metadata-parser-1.1.4-10.el7.x86_64.rpm yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm
4.5)更改yum源 ,使用网易的CentOS镜像源
cd /etc/yum.repos.d
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
4.6)在/etc/yum.repos.d文件夹中,更改CentOS7-Base-163.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-$7 - Base - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=os
baseurl=http://mirrors.163.com/centos/7/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$7 - Updates - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=updates
baseurl=http://mirrors.163.com/centos/7/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-$7 - Extras - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=extras
baseurl=http://mirrors.163.com/centos/7/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$7 - Plus - 163.com
baseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
4.7)清除缓存,并更新。
yum clean all
yum makecache
5.利用yum安装java jdk,eclipse开发环境(参考:在CentOS 8/RHEL 8系统上安装Eclipse IDE开发环境_Linux编程_云网牛站)
5.1)安装Java jdk
Linux机器上运行Eclipse IDE需要Java,您可以使用以下命令轻松安装Java:
yum -y install java-11-openjdk-devel
安装Java后,请使用Java命令行工具确认版本。
java -version
openjdk version "11.0.8" 2020-07-14 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.8+10-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.8+10-LTS, mixed mode, sharing)
eclipse需要javajdk11及以上版本的,如果版本不对,要更改默认版本,使用alternatives命令,并选择11版本。
alternatives --config java
5.2)安装eclipse
选择在线安装的方式,这样不需要手动去设置桌面快捷方式等。下载安装包->解压->进入文件夹->打开安装程序
wget http://ftp.yz.yamagata-u.ac.jp/pub/eclipse/oomph/epp/2020-09/R/eclipse-inst-linux64.tar.gz
tar xvf eclipse-inst-linux64.tar.gz
cd eclipse-installer/
./eclipse-inst
5.3)在线 installer eclipse。