0

I tried the following with root user but unable to install yum on my cloud server.

I already read a similar issue here: Installing yum on Ubuntu

root@localhost:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:        20.04
Codename:       focal

tried the following in vain to install 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

Here is the error:

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>

Error:

root@localhost:~# apt-get install yum -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package yum

I cant even get dnf installed nor do I know how to. I have a standard script that uses yum so getting yum to work would be great.

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
Ashar
  • 449
  • 3
  • 10
  • 26
  • Please read the answer you linked again: `yum` was available until 18.04, `dnf` is available since 21.04 so it's simply not possible to install either of those (from official Ubuntu repositories) on 20.04. – Vojtech Trefny Nov 03 '21 at 11:05
  • if it doesn't allow using `yum` or `dnf` then what is the best solution to get the current script to work that has many `yum` commands? – Ashar Nov 03 '21 at 11:26
  • If you have a script with many `yum` commands, and those commands are meant to install packages from `yum` repositories, the script is likely not meant to be run in Ubuntu. You may need to run the script in an operating system it was meant for. – GracefulRestart Nov 03 '21 at 21:12
  • ... or simply install the needed packages with `apt` instead of with `yum` (taking care to change the package names appropriately). – Kusalananda Aug 15 '23 at 09:53

2 Answers2

2

yum is only available for Ubuntu Bionic from universe repository, it depends on 2.7 =< python <<2.8.

GAD3R
  • 63,407
  • 31
  • 131
  • 192
2

Unfortunately yum is not available on Ubuntu 20.04, so it is better to use apt or apt-get but in some cases (like following an example or instruction) you need to use the yum repository. In this case, the only way that I found is use of aptitude. You can install it simply by apt-get:

sudo apt-get install aptitude

if apt-get could not find it, update it and try again. Then you can use the GUI of aptitude by direct execution in terminal (sudo aptitude) or use the command line to install your package from yum repository (in my case I installed fuse):

sudo aptitude install fuse

good luck

Shrm
  • 146
  • 2