Linux·Ubuntu安装yum

Linux·Ubuntu安装yum

安装常出现报错:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package yum

解决办法:

(1)将原本的文件内容复制一份。备份

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup

(2)使用如下命令打开 /etc/apt/sources.list

sudo edit /etc/apt/sources.list

(3)在 /etc/apt/sources.list第一行添加

deb http://archive.ubuntu.com/ubuntu/ trusty main universe restricted multiverse

按A键盘进入编辑状态,再添加以上内容后 按ESC键盘退出编辑状态 再输入 :wq 保存退出编辑

(4)重新运行命令

sudo apt-get update

(5)执行安装yum的命令

sudo apt-get install yum

可能遇到的问题:(缺少包)

The following packages have unmet dependencies:
 yum : Depends: python-libxml2 but it is not going to be installed
       Depends: python-rpm but it is not going to be installed
       Depends: python-sqlite but it is not going to be installed
       Depends: python-sqlitecachec but it is not going to be installed
       Depends: python-urlgrabber but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

解决办法:

缺少什么安装什么

例:

sudo apt-get install python-sqlitecachec
sudo apt-get install python-urlgrabber

安装完后 重复第4步骤 继续安装

1,118 Views
分享你的喜爱
linwute
linwute

我要像梦一样自由,像大地一样宽容;
在艰辛放逐的路上,点亮生命的光芒;
我要像梦一样自由,像天空一样坚强;
在曲折蜿蜒的路上,体验生命的意义;

留下评论

您的邮箱地址不会被公开。 必填项已用 * 标注