配置apt国内镜像源
/etc/apt/sources.list
echo "
deb https://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse"
> /etc/apt/sources.list
安装yum
apt update
apt upgrade
apt-get install build-essential
apt-get install yum
异常处理
Q1: NO_PUBKEY
把这些PUBKEY加入到apt-key即可。
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C
Q2: 解决依赖问题
the following package have unmet dependencies:
python-rpm:Depends:rpm-common(=4.14.2.1+dfsg1-1) but 4.16.1.2+dfsg1-3 is to be installed
E: Unable to correct problems, you have held broken packages.
apt install aptitude -y
aptitude install yum # aptitude会自动给出依赖问题的解决方案,自己选择一下就ok了
只要推荐方案中有 11) yum [Not Installed],就选no;否则选yes
Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:
Keep the following packages at their current version:
-
libpython2-stdlib [Not Installed]
-
python [Not Installed]
-
python-libxml2 [Not Installed]
-
python-minimal [Not Installed]
-
python-pycurl [Not Installed]
-
python-rpm [Not Installed]
-
python-sqlite [Not Installed]
-
python-sqlitecachec [Not Installed]
-
python-urlgrabber [Not Installed]
-
python2 [Not Installed]
-
yum [Not Installed]