- 使用国内镜像
(1)备份镜像URL的地址
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo vi /ect/apt/sources.list
(2)将之前url给删掉,替换镜像源
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
(3)进行更新
sudo apt-get update
sudo apt-get upgrade
(4) 出现问题
ubuntu@primary:~$ sudo apt install yum
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
yum : Depends: python-rpm but it is not going to be installed #第一个问题
Depends: rpm (>= 4.4.1) but it is not going to be installed #第二个问题
E: Unable to correct problems, you have held broken packages.
sudo apt-get purge yum # 先删除
然后再下载 sudo apt-get install yum












网友评论