2

I am working a Ruby project and I have to install this gem xmlparser. It asks me a lot of dependencies that must be resolved before installing the gem. One of them is the expat and some guys on the interwebs suggested

yum install expat-devel

But when I run it the console aks me to run and check

yum repolist all

Then it says: repolist: 0

What do I have to do to add a repo so that YUM can get packages from it?!

1
  • 2
    Ubuntu natively uses deb packages, not rpm. yum is for the redhat rpm variant. aptitude install ruby-xmlparser is probably what you want.
    – wurtel
    Nov 11 '15 at 10:52
8

You don't. yum is the package management tool on RHEL-derived distributions and Fedora, Ubuntu uses apt instead.

You need to learn what that package is called in the Ubuntu repos and install it with apt-get.

0

You have to add the repo by terminal or create the repo file in the directory /etc/yum/repos.d as we find /etc/yum.repos.d/ in RHEL or CentOS but in Ubuntu it will be path /etc/yum/repos.d/

For example, you want to install google-chrome in Ubuntu by yum so these are steps:

Create file "google-chrome.repo" in the directory "/etc/yum/repos.d" Write these lines into that file and save it.

[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub

This should work fine with your situation.

-1

That is indeed possible.

Try:

sudo apt install yum*

or

sudo apt-get install yum*

after this, add your favourite or required repos to the system like epel or rpmforge or any other repos by usual way with yum command in place of apt.

Repo is just a place from where you can install or fetch the package or tarball so no matter what you use in whatever system you're using. But this will be the case that some programs will be configured automatically according to RHEL config. This config thing is just my assumption, not sure if that is happening all the time. But we can change it anytime. Like in some Linux destros, Apache or PHP installed to /opt/. Where in cross repo usage (as in yum used in ubuntu instead of apt-get), it might take change as parent package provider config rather than system's native config tradition.

Comment if you find any further help or other issues causing you trouble related to this.

3
  • 3
    Running apt install yum* is a terrible idea.
    – Erica Kane
    Jun 21 '17 at 14:59
  • I agree but in some cases there seems not to be a workaround... i.e. I am trying to run the php debugger in a Cloud9 environment, on a Lightsail Ubuntu server. AWS docs explain that I should install a yum package, I've already installed xdebug ubuntu package but it doesn't work...
    – ManuelJE
    Nov 20 '18 at 15:24
  • 1
    Installing YUM in order to install RPM packages is generally a bad idea - all kinds of things can go wrong when the package can't assume the base architecture of the operating system. Specifically, anything that relies on GLIBC would not even install because YUM won't be able to find its exported symbols, and trying to solve this by installing glibc from YUM would either ruin your system or just not work. That being said (after all the caveates) there are use cases in which this is a legitimate behavior, like the one I just had to implement, which is why I upvoted this answer.
    – Guss
    Jan 6 '19 at 10:05

Not the answer you're looking for? Browse other questions tagged or ask your own question.