本教程操作环境:linux7.3系统、Dell G3电脑。
linux中yum命令不能用怎么办
[root@localhost ~]# yum -y install gccLoaded plugins: katello, product-id, security, subscription-managerUpdating certificate-based repositories.Unable to read consumer identitySetting up Install ProcessNo package gcc available.Nothing to do
对于习惯使用CentOS的人来说,不能使用这个命令,简直是种折磨
解决过程:
(资料图片)
1、给linux redhat安装Centos镜像
修改repo文件
[root@localhost~]# mv CentOS6-Base-163.repo /etc/yum.repos.d/
*** 把$releasever替换成6
[root@localhost yum.repos.d]# sed -i "s#$releasever#6#g" ./CentOS6-Base-163.repo
2、清除所有缓存
[root@localhost yum.repos.d]# yum clean allLoaded plugins: katello, product-id, security, subscription-managerUpdating certificate-based repositories.Unable to read consumer identityCleaning up Everything
获取yum列表
3、搜索安装
安装gcc
[root@localhost yum.repos.d]# yum -y install gcc
至此,gcc安装完成,并且对于其他的编译环境也可以使用yum安装了。
推荐学习:Linux视频教程
以上就是linux中yum命令不能用怎么办的详细内容,更多请关注php中文网其它相关文章!































































