Getting Apt To Work On RedHat
Apt is Debian's Package Management System, and installing it on
RedHat has some profound advantages, in that it will find all the
RPMs and handle dependencies and basically just make package
installation and upgrades a breeze.
Note that the method presented here still uses RPM files on the
back end (and I wouldn't suggest trying anything else on
RedHat).
Basic Installation
-
Go to http://apt.freshrpms.net/
and get the appropriate version for your system. Easiest
way to get it: "cd /tmp", "wget <url of rpm>".
-
If you're not sure of your version, use rpm -v and compare
to what's on that site.
-
NOTE ON RH AS 2.1 Oddly enough, despite what you
might expect, RedHat Advanced Server 2.1 seems to be closer
to RH 7.2 then 7.3. If you go with 7.3 in your apt sources
list, it will want to upgrade a lot of stuff.
-
Run "rpm -i <the apt rpm file you downloaded>".
Signature Checking Of RPMs Whilst Using Apt
This section describes how to get apt to check that an rpm has
an official RedHat signature. It can be skipped if you don't care
about that sort of thing, but I wouldn't reccommend it.
-
Get official RedHat GPG public key from the
redhat public key page. The fingerprint of the
security@redhat.com key is CA 20 86 86 2B D6 9D FC 65 F6 EC
C4 21 91 80 CD DB 42 A6 0E. But don't take my word for it;
run Google and check. Copy the key to a file.
-
Run "gpg --import <the redhat key file>". If you get
an invalid armor error, make sure there's a blank line between
the comment and the text block. In later versions of rpm
(4.2.1 at least), you should instead run "rpm --import
<keyfile>"
-
Put aptrpm-1 into /usr/local/bin.
Make sure to 'chmod 755' it.
This is originally from
the
apt4rpm sourceforge cvs page, with the amazingly
important change that rpm is now called by absolute path
when doing the signature checking (duh!). It's also
modified to print out the actual signature check output from
the "rpm -K" call.
-
Put apt.conf into /etc/apt. This
tells apt to use aptrpm-1 instead of the normal apt program,
and has configuration to tell aptrpm-1 to do the signature
checking, since the basic apt program has no idea what rpm
signatures are.
-
From now on, everytime you install a package, you should
see a line like:
/var/cache/apt/archives/vim-minimal_1%3a6.1-18.7x.2_i386.rpm: md5 gpg OK
If you don't, stop using apt until you know why. Come
pester me or something.
Basic Apt Usage
-
When it's installed, run "apt-get update". Then run
"apt-get update" again.
-
To find a package, "apt-cache search ", where
can be a regex.
-
To
install a package, "apt-get install ", for
example "apt-get install gcc". This will find all the
dependencies and present with a list of what it needs to
install and/or remove to get the latest version of what
you've asked for.
-
To
upgrade all the packages on the system, "apt-get upgrade".
This can also take a single package.
-
Occasionally run "apt-get update" to get the latest package
information.