ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

Ubuntu下安装yum

2021-04-08 11:32:00  阅读:8  来源: 互联网

标签:universe restricted Ubuntu multiverse yum bionic ubuntu main 安装


直接输入yum会报错

Command ‘yum’ not found, but can be installed with:
sudo apt install yum

然后按照提示输入sudo apt install yum, 又会报错

正在读取软件包列表… 完成
正在分析软件包的依赖关系树
正在读取状态信息… 完成
E: 无法定位软件包 yum

显示无法定位软件包
查找原因是因为没有更新包
输入sudo apt-get update,进行更新。又会报错

E: 无法获得锁 /var/lib/apt/lists/lock - open (11: 资源暂时不可用)
E: 无法对目录 /var/lib/apt/lists/ 加锁

既然加了锁,那就把锁给删了。

sudo rm /var/lib/apt/lists/lock

然后就可以sudo apt-get update。
虽然可以正常更新, 你以为这就解决问题了?
其实你会发现这下载更新速度就像没开百度网盘超级会员的你一样,下载速度特别慢,甚至直接丢包了。
所以我们在sudo apt-get update之前,给apt-get换一个源。
先给之前的apt-get源进行备份,以免翻车。

备份sources.list文件
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

打开sources.list文件
sudo gedit /etc/apt/sources.list

删除原内容,添加下列内容
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

保存
做完以上前期工作,就要正式安装yum了

sudo apt-get update
sudo apt install yum
这样就安装完成了!

————————————————
版权声明:本文为CSDN博主「小白白上白」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/hua_you_qiang/article/details/108866334

标签:universe,restricted,Ubuntu,multiverse,yum,bionic,ubuntu,main,安装
来源: https://blog.csdn.net/zdz619676400/article/details/115511045

专注分享技术,共同学习,共同进步。侵权联系[admin#icode9.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有