作者:贞亭钟_432 | 来源:互联网 | 2023-07-19 05:45
1、首先我们先要确定下,机器是否已经安装有gccwin10安装gcc。我们输入gcc看看?很显然,提示命令找不到,显然我们是没有安装的。

2、我们首先需要挂载光盘到挂载点win10安装gcc。mount /dev/cdrom /mnt我这里是挂载到mnt目录。

3、改变目录到挂载目录win10安装gcc。cd /mnt

4、改变目录到CentOS目录(不同发行版不同)cd CentOS

5、输入rpm -ivh gcc然后按下table看看是否有gcc开头的文件

6、可以看到,我们的gcc主程序就是gcc-4xxxx的这个文件我们在rpm -ivh gcc后面加上一个-4然后按下table键补全后面的内容win10安装gcc。

7、按下回车后,依赖包出现了win10安装gcc。可以看到依赖包是glibc-devel版本号>= 2.2.90也就是说,我们在安装gcc之前,需要安装glibc-devel这个包,原因是我们的gcc里面所用到的东西要用到这个包,也就是所谓的依赖关系。

8、那我们就跟着依赖包来安装win10安装gcc。按下方向键的up键,找到上一条命令。

9、很多新手经常装不上rpm包的原因就是依赖包的事,包括我,我以前因为这个依赖包也搞得很头痛win10安装gcc。这里你只要记住一点,不要一个一个去安装依赖包。例如我们现在要装的是gcc第一个出现的依赖包是glibc-devel那么我们的命令是rpm -ivh gcc glibc-devel这样就可以解决这样依赖包的问题。在原来的命令上加上glibc-dev然后按下table键补全。

10、按下回车安装,发现又有glibc-devel的依赖包了win10安装gcc。

11、那么我们还是按下方向键的UP键找到上一条命令,然后在命令的基础上加上新的依赖包名win10安装gcc。

12、把所有依赖包都加上去之后,我们就可以看到这样的一个安装界面了win10安装gcc。

13、装好之后,我们输入一个gcc试试看win10安装gcc。可以看到,已经装好了。
