Installing apt-get on redhat

49,796

Solution 1

You don't need to replace your package management tool just because a package seems to be missing.

Each package management tool is tightly integrated with its distribution, and this is no different with CentOS. apt is well integrated with Debian and its derivatives, and even if they (Debian, Ubuntu, Mint, Knoppix...) use the same tool for package management, their packages are linked and configured with specific package versions that in some cases will work only with specific dependencies that that distribution has.

What you need is to install the dev package of glib specific for redhat-alike OSs:

yum install glib2-devel.x86_64

The caveat here is that you will have to find an equivalent package, that can have a different name on your distribution. Knowing how to search packages on the distribution you are using is some well spent time on knowledge.

How did i found that this was the name:

[root@ftp ~]# yum search glib2| grep dev
glib2-devel.i686 : A library of handy utility functions
glib2-devel.x86_64 : A library of handy utility functions
spice-glib-devel.i686 : Development files to build Glib2 applications with
spice-glib-devel.x86_64 : Development files to build Glib2 applications with

And showing the package info, you can see that it seems to be the same library dev package:

[root@ftp ~]# yum info glib2-devel.x86_64
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.brisanet.com.br
 * extras: centos.brisanet.com.br
 * rpmforge-extras: apt.sw.be
 * updates: centos.brisanet.com.br
Available Packages
Name        : glib2-devel
Arch        : x86_64
Version     : 2.28.8
Release     : 9.el6
Size        : 300 k
Repo        : base
Summary     : A library of handy utility functions
URL         : http://www.gtk.org
License     : LGPLv2+
Description : The glib2-devel package includes the header files for the GLib library.

Also, if you are not familiar with package searching, this online tool can help you to find packages on most common Linux Distributions: Linux Packages Search

Solution 2

TL;DR apt usually doesn't work out of the box with Enterprise Linux based distros and you won't find many repos that work for you anyway.

If you are having trouble finding the software you want on Red Hat, it is because your repositories don't have the packages. What you want to look into is adding different repositories. For Red Hat Enterprise Linux, the first repo to usually add is Extra Packages For Enterprise Linux (EPEL) hosted at The Fedora Project. You will likely find a LOT of what you are missing in that repo.

More information:

While it is certainly possible to install the apt package management utilities on an Enterprise Linux system, that does not mean you will be able to do anything with it once you are done.

The issue here is the apt utility is a program that works with published directories of software packages (repositories is the usual name for me, but it can vary). Yum, rpm, dnf, emerge, etc. are all utilities on varying *NIX distributions that do the same thing. But they don't offer the software themselves, they are configured to query the repositories and provide packages from them. The other issue is that the common repositories you find online are often created with configured to work with the native package management utilities for the OS they are offering software for. You could probably configure apt on your RHEL7 system to query the Debian repos, but the software likely would be incompatible with your system because of the differences in how Debian and Red Hat build, layout, structure, and configure their operating systems. It's like trying to install Mac OS X software on your Linux system. They are both technical *NIX based, but they vary widely in how they function.

Solution 3

I am asking this question because I'm having some difficulty installing a plugin for pidgin (pidgin-sipe) because yum install libglib2.0-dev is failing, which is evidence to me that having apt-get might be a worthwhile investment.

Short answer: not really, no.

There's a port of apt for rpm, namely apt-rpm. It was usable until relatively recently, but as far as I know, Red Hat and its derivatives don't support it, so it may not be so now. Development seems to have stalled since 2008, which isn't promising. Also, apt-rpm cannot be used with yum repositories, so it's not useful unless someone has built rpm repositories that can be used with apt.

There was also a variant called apt4rpm created by Connectiva, but that seems to have been even less used than apt-rpm.

Installing Debian's own apt on a Red Hat system is a waste of time, even if it installs successfully. dpkg is available for Red Hat, or at least it used to be. But trying to set up a parallel Debian-like system using dpkg and apt would be a complete non-starter, I think.

I recall using apt-rpm on a Red Hat system around 2006 for basic system adminstration. If memory serves, it was a CentOS installation. It still worked quite well then. But this is 2017, and my guess would be that apt-rpm is now effectively dead.

In any case, I doubt using apt on a Red Hat system, even if it was available and functional, would make much difference to your experience. The reason why apt works well on Debian and its derivatives isn't because of any magical quality apt possesses. It's mostly because of Debian's famous quality control, though the Debian package management tools (dpkg, apt etc.) can take some of the credit for being well designed and implemented.

It you want the "apt experience", use Debian.

Solution 4

It is possible to do this, but very difficult, generally recommended against, and almost certainly unnecessary.

What you've asked is how to install the Debian package management system on a Red Hat system.

The package management system tracks what packages are installed in a system, facilitating installation and updates of packages, tracking dependencies, and avoiding conflicts between packages. Particularly for the latter two reasons, different package management systems are fundamentally incompatible with each other; trying to use two different systems simultaneously will, without very careful supervision, quickly render your system unusable, because you would effectively be trying to install two different Linux distributions on top of each other.

When one maps the family tree of Linux distributions, the primary branching point is the choice of package management system. The two most common systems are the Debian package management system, DPKG, and the Red Hat Package Management system, RPM. "apt-get" is a front-end for using the DPKG system, and it requires the rest of the toolset to work; likewise, "yum" is a front-end for using the RPM system.

It is sometimes possible to convert a package from one system to the other. alien is an application for doing this. Note that it's almost never mentioned without warning that it isn't reliable.

If the problem you want to solve is that you want to install a specific application on a Red Hat system, then you may find it works better to use a package from another Linux distribution that uses RPM; rpmfind can help you search. It's slightly more reliable to find a source RPM and rebuild it on your system; that reduces the likelihood of problems with dependencies on specific compiled binaries. Or, you can bypass package management by finding the source tarball for the application and compiling it.

If the problem you want to solve is having more packages available in general, then you should bear in mind that Red Hat Enterprise Linux, by design, has an emphasis on stability, and its official repositories are relatively limited. You may prefer using the closely related Fedora Linux, which has a far larger selection of packages in its official repositories, or you may want to switch to Debian or one of its derivatives.

Share:
49,796

Related videos on Youtube

ajsmart
Author by

ajsmart

Hey guys, I speak Japanese. I'm in no way perfect, but I can get around the country on my own easily enough.

Updated on September 18, 2022

Comments

  • ajsmart
    ajsmart over 1 year

    Is it possible to install apt-get on redhat? I'm under the impression that you can't, but I just wanted to be sure. If it is possible, life would be MUCH easier when installing various programs, especially because yum really doesn't have as many programs available it seems.

    Here's what I've tried (just for the record):

    I've been trying to install apt-get following these instructions, but redhat doesn't have dpkg, so I'm back to square 1.

    I am asking this question because I'm having some difficulty installing a plugin for pidgin (pidgin-sipe) because yum install libglib2.0-dev is failing, which is evidence to me that having apt-get might be a worthwhile investment.

    Any suggestions?

    • ajsmart
      ajsmart almost 7 years
      For future reference, I also discovered that yum install pidgin-sipe works as well. Turns out I didn't need a manual install after all, but it was a great learning experience anyway.
  • ajsmart
    ajsmart almost 7 years
    So, to clarify, you're essentially saying that I don' t need apt IF I have the repositories added to my system? (Thanks for the link!)
  • Admin
    Admin almost 7 years
    You just need to find the package that is "equivalent" to your distro. Take a look at my answer @ajsmart
  • 0xSheepdog
    0xSheepdog almost 7 years
    Correct! Apt is a tool for pulling packages, commonly used by Debian based distros. Rpm, Yum, and Dnf are a family of tools used by Enterprise Linux. The repos they use are also different, but not because of the tools but because of the OS family the repos is serving software for. Good luck and let us know if you need more.
  • ajsmart
    ajsmart almost 7 years
    I encounter this problem a lot, but is there an equivalent for everything? I mean, if the repos are different, it implies to me that each will have programs/features the other doesn't have.
  • user11212623
    user11212623 almost 7 years
    Most common cli packages ( glib, linux-utils, iputils2, dos-utils, nmap, tcpdump and lots of more) and Graphical interfaces are packaged on distributions, so yeah, chance is big that if you have a package available on Debian you might have it on CentOS or on it's community repos ;)
  • Admin
    Admin almost 7 years
    But this will not change the op needs for a libglib2.0-dev package... and installing apt will not make the package change names... It will still be apt-get install glib2-devel.x86_64, and the effort spent on install apt could better be used to search the package...
  • Alen Milakovic
    Alen Milakovic almost 7 years
    Care to explain the downvote?
  • Admin
    Admin almost 7 years
    Removed the downvote. Your first version of the answer was somehow leading that install apt-rpm could be a solution ;)
  • Alen Milakovic
    Alen Milakovic almost 7 years
    @nwildner: I don't see where I ever implied that.
  • bgvaughan
    bgvaughan almost 7 years
    It is the case that different Linux distributions have different priorities, and this is reflected in what packages are available. If this is a problem you encounter a lot, it may be the case that another Linux distribution has priorities more like yours. distrowatch.com may be helpful for comparisons.
  • user11212623
    user11212623 almost 7 years
    But in this question specific case, glib dev related stuff is something you can find on most distributions...
  • ajsmart
    ajsmart almost 7 years
    @bgvaughan I would have chosen a different distribution, but this is work related. Sadly, I don't really have a choice. The only supported corporate version of Linux is RHEL, but if I had a choice, I would have chosen Ubuntu, or one of its derivatives.