今天在服务器安装dpkg时,出现 NO package dpkg available
如下所示:

[root@host /]# yum -y install dpkg

Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
Setting up Install Process
No package bind available.

原因:Centos中有一个配置文件专门存各种软件下载信息,用yum安装时会自动找到软件镜像站点。输入以下路径看下:

ls  /etc/yum.repos.d/

看到一个文件

CentOS-Base.repo

输入命令行

cat CentOS-Base.repo

可以看到一些配置文件


首先备份/etc/yum.repos.d/CentOS-Base.repo

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

查看版本号:cat /etc/redhat-release

下载对应版本repo文件, 放入/etc/yum.repos.d/(操作前请做好相应备份)

CentOS5

CentOS6

运行yum makecache生成缓存。


评论区

发表评论

必填

选填

选填

必填

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。