Yum is a package management tool used on Red Hat and distributions based on it. It’s used to install new packages and keep them up-to-date. But can you install YUM on other distributions like Ubuntu? That’s the question I will cover in this article.
YUM is not available on the latest Ubuntu versions. In fact, it’s not even included on Red Hat distributions, anymore, as it has been replaced with DNF in all recent versions. It’s not possible to install YUM on Ubuntu, and it doesn’t really make sense to try using it.
I’ll give you more context, so you can clearly understand the main differences between APT, YUM and DNF. I’ll also give you a few tips if you really want to use the YUM commands.
Can you install YUM on Ubuntu?
In short, it’s not possible to use YUM on Ubuntu. The YUM package is no longer available on Ubuntu, and no YUM repository is available to match the latest versions of Ubuntu.
Ubuntu is based on Debian, which is built to use the APT package manager. Ubuntu is composed of a bunch of dpkg packages, hosted on the Ubuntu repositories. It doesn’t really make sense to try switching to a complete different system.
YUM was used on Red Hat or Fedora, and works with RPM packages. It’s not even the same package files on Debian-based and Red Hat-based distributions. It’s like wanting to use the Windows Store on macOS.
Even if you find a way to install YUM on Ubuntu, you’ll need to also find an updated repository and a way to install the RPM packages on Ubuntu, without breaking what is already installed by default. It looks like a tedious task, which doesn’t really make sense if the reason for trying this is just that you’re used to YUM.
YUM vs DNF
In fact, even on Fedora and Red Hat-based recent distributions, YUM is no longer available. It has been replaced a few years ago with DNF.
DNF is an updated and improved version of YUM, meant to be faster and lighter to run. The commands are almost the same as with YUM. So, even on Fedora, it’s not necessarily a good idea to try to install YUM.
While testing things for this article, I noted that DNF is available in the Ubuntu repository, so I tried installing it. It works. Or at least, you can install the main package. I have DNF installed on my test virtual machine, but I can’t do anything with it.
There is a warning with Python, but also DNF is unable to identify my system version, and so to find a repository compatible with it. And I don’t think there is any.
Want to chat with other Raspberry Pi enthusiasts? Join the community, share your current projects and ask for help directly in the forums.
Solutions if you want to use Yum on Ubuntu
So, what can you do if you are switching from a Red Hat-based distribution to Ubuntu, and are lost with the package management system on your new system?
I see only one workaround to avoid loosing too much time in the command line. It’s just a temporary tip for the time you are still trying to use YUM or DNF, but it’s nothing magical.
Alternatively, maybe Ubuntu is not the right distribution for you. There are still excellent distributions based on Red Hat where you can use DNF (and perhaps even YUM for some of them).
Create an alias
The workaround I have for you is to create an alias for the command you are used to type. For example, if you were using YUM all the time previously, you may still try to type it on Ubuntu, even if it doesn’t exist.
Instead of getting errors and having to retype the same syntax with APT, you can create an alias, that will replace “yum <options>” with “apt <options>” each time.
On Linux, you can create aliases for specific command
- Open or create this file:
- Add these lines in the file:
alias yum='apt '
alias sudo='sudo '
The second line is mandatory because most apt commands require administrator privileges. And when you use sudo, it won’t recognize the yum alias.
Another option is probably to add sudo in the first alias, and remove the second line.
- Close your session and start a new one.
Maybe you restart the computer, close the SSH, or Secure Shell Protocol, is a cryptographic network protocol used for securely accessing and... session, or restart the terminal.
The alias won’t work before a new session.
- Now, if you run this command for example:
sudo yum updateIt should work.
It’s just a little trick, but if you are bored to always use “yum” instead of “apt” on your new Ubuntu system, it might be enough for you.
Eventually, you’ll have to adapt and start using apt, but it’s the only thing I have for you if you want to continue using Ubuntu. At least, you won’t be too angry with your computer, it will understand what you mean when you type “yum” :-).
If you’re new to the Linux command line, this article will give you the most important Linux commands to know, plus a free downloadable cheat sheet to keep handy.
Switch to a Red Hat-based distribution
But if you are used to the Red Hat way of doing things, like package management, maybe the right move for you is simply to stay on a Red Hat-based distribution.
Ubuntu might be the most popular Linux distribution currently, but it doesn’t mean it’s the ultimate choice, better than the other options.
Here are a few suggestions for you:
- Fedora: Fedora is like the Ubuntu equivalent for Red Hat users, so it seems an easy choice if you chose Ubuntu but want the Red Hat package manager.
Available for desktop usage, servers or even IoT, you’ll find the right version for you.
You can even install Fedora on Raspberry Pi (click on the link to read my tutorial).
- Rocky Linux: With the end of life of CentOS, Rocky Linux is meant to be the natural successor.
Based on Red Hat Enterprise but rebuild for the community, so it’s free and stable, for any use.
- AlmaLinux: A new distribution, with similar goals to Rocky Linux (CentOS replacement, compatible with RHEL, etc.).
I’m less familiar with it than the others, but it looks promising.
I know, I don’t have a magic solution to your initial question, but I hope that after reading this article, you better understand that installing YUM or DNF on Ubuntu is not a good idea.
You should either get used to APT, try the alias tip, or switch to a better distribution for you.
Overwhelmed with Linux commands?
My e-book, “Master Linux Commands”, is your essential guide to mastering the terminal. Get practical tips, real-world examples, and a bonus cheat sheet to keep by your side.
Grab your copy now.
If you just want to hang out with me and other Linux fans, you can also join the community. I share exclusive tutorials and behind-the-scenes content there. Premium members can also visit the website without ads.
More details here.
Need help building something with Python?
Python is a great language to get started with programming on any Linux computer.
Learn the essentials, step-by-step, without losing time understanding useless concepts.
Get the e-book now.