我使用 root 用戶嘗試了以下操作,但無法在我的雲端伺服器上安裝 yum。
我已經在這裡讀過類似的問題:在 Ubuntu 上安裝 yum
root@localhost:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal
嘗試了以下方法來安裝 yum,但沒有成功。
1.
root@localhost:~# up2date
up2date: command not found
2.
apt-get update
apt-get install yum*
3.
apt-get install rpm -y
apt-get install yum*
4.
apt update -y
apt install -y yum-utils
這是錯誤:
root@localhost:~# yum
Command 'yum' not found, did you mean:
command 'uum' from deb freewnn-jserver (1.1.1~a021+cvs20130302-7build1)
command 'zum' from deb perforate (1.2-5.1)
command 'num' from deb quickcal (2.4-1)
command 'sum' from deb coreutils (8.30-3ubuntu2)
Try: apt install <deb name>
錯誤:
root@localhost:~# apt-get install yum -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package yum
我什至無法dnf
安裝,也不知道如何安裝。我有一個使用 yum 的標準腳本,所以讓 yum 工作會很棒。
root@localhost:~# apt-get install dnf
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package dnf
root@localhost:~# apt install dnf
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package dnf
答案1
不幸的是,yum
它在 Ubuntu 20.04 上不可用,因此最好使用apt
或apt-get
,但在某些情況下(例如遵循範例或說明)您需要使用yum
儲存庫。在這種情況下,我發現的唯一方法是使用aptitude
.您可以簡單地透過以下方式安裝它apt-get
:
sudo apt-get install aptitude
如果 apt-get 找不到它,請更新它並重試。然後您可以使用 GUIaptitude
在終端機 ( ) 中直接執行sudo aptitude
或使用命令列從yum
儲存庫安裝您的軟體包(在我的例子中我安裝了fuse
):
sudo aptitude install fuse
祝你好運
答案2
yum
僅適用於烏班圖仿生從 Universe 儲存庫中,它依賴 2.7 =< python <<2.8。