28

I'm setting up a Linux Red Hat web server. apt-get isn't installed, but yum is. However, yum cannot find the apt package.

When I run apt-get, I get a message from the shell saying that the command apt-get couldn't be found. When I try yum install apt or yum install apt-get I get a message saying yum couldn't find the package and there was nothing to do

I suspect that it's probably a case of editing a sources list (as with apt) to add the source that apt is available from, but I a) don't know where this source list would be, and b) don't know what source would provide apt...

If anyone could enlighten me, it would be greatly appreciated

Omer Dagan
  • 14,868
  • 16
  • 44
  • 60
Philip Mais
  • 299
  • 1
  • 3
  • 4

4 Answers4

10

If you have a Red Hat server use yum. apt-get is only for Debian, Ubuntu and some other related linux.

Why would you want to use apt-get anyway? (It seems like you know what yum is.)

Michael
  • 8,920
  • 3
  • 38
  • 56
  • And remember, it's harder to use 'apt' as a verb ;) http://forums.fedoraforum.org/archive/index.php/t-1034.html – dianovich Mar 18 '11 at 21:17
  • Re: Why would you want to use apt-get anyway? One of reasonable example is if you want to build a tool which operate on many different repositories (rpm, deb, etc) and you run something like `apt .. --download-only` on RH, to just collecting dependencies, and you work on files, not installing them. – Sławomir Lenart Mar 01 '23 at 21:36
4

If you insist on using yum, try yum install apt. As read on this site: Link

Yuri
  • 2,008
  • 17
  • 36
  • Any enlightment on the downvote would be highly appreciated. I am just answering the question, rather than giving advice on sticking with yum? – Yuri Mar 18 '11 at 21:12
  • 1
    Poster has already tried this and the information contained in the link is vague - do you really want to add repos to your sources without either a) disabling them and only using them on a case by case basis or b) only allowing them to update packages of interest – dianovich Mar 18 '11 at 21:13
  • @ddawber Now I see, I've read the post 3-4 times and somehow I only picked up the `yum install apt-get`, and completely missed my proposal. Thanks for the comment. – Yuri Mar 18 '11 at 21:16
  • I guess I want to use apt as it's what I'm used to with ubuntu... I take it yum usage is pretty much the same? – Philip Mais Mar 18 '11 at 21:24
  • @philip-mais: Not very acquainted with the program, but what I gather from [the manpage](http://linux.die.net/man/8/yum) it looks pretty similar. – Yuri Mar 18 '11 at 21:27
  • @Philip Mais Never try to use a different package manager than the default. Anyway, the commands you need are `yum install`, `yum update`, `yum remove` (use with caution), `yum history` (shows history of transactions), `yum history info` (shows what happened in a particular transaction), and `yum history undo` (undoes an entire transaction, ie undoing installing packages + their dependencies. – alternative Mar 19 '11 at 11:39
1

I think you're running into problems because RedHat uses RPM for managing packages. Debian based systems use DEBs, which are managed with tools like apt.

PPC-Coder
  • 3,522
  • 2
  • 21
  • 30
-3

wget http://dag.wieers.com/packages/apt/apt-0.5.15lorg3.1-4.el4.rf.i386.rpm

rpm -ivh apt-0.5.15lorg3.1-4.el4.rf.i386.rpm

wget http://dag.wieers.com/packages/rpmforge-release/rpmforge-release-0.3.4-1.el4.rf.i386.rpm

rpm -Uvh rpmforge-release-0.3.4-1.el4.rf.i386.rpm

maybe some URL is broken,please research it. Enjoy~~

william
  • 13
  • 1