Using apt in an RPM world

来源:互联网 发布:2015年中国统计数据库 编辑:程序博客网 时间:2024/05/22 14:57

from: http://dag.wiee.rs/blog/using-apt-in-an-rpm-world

Everytime I am surprised that people don't know that apt-get works on RPM-based distributions and works much better than the alternatives. Especially in a CentOS/RHEL environment where you have various distribution releases running, apt-rpm allows you to use the same apt version and the same apt features across CentOS/RHEL 2.1, 3, 4 and 5.

In an attempt to persuade you to try out apt, let me denounce some myths about the current apt-rpm:

  • works on RPM packages
  • can do multilib (coexist 32bit and 64bit)
  • does check GPG keys on packages
  • can work with repomd repositories (as used by yum)
  • does work a lot faster than yum
  • is being maintained (although could use more hands)
  • has python bindings
  • has a graphical interface (synaptics)
  • handles multiple repositories much better
  • allows to pin packages by version or repository (and manages cross-dependencies)
  • existed years before yum (and was the only depsolver for a few years in the Red Hat world)

Now, because I can say it works great but you may not believe me, let me make it very simple for you to try it out on CentOS. Here is a quickstart guide...

First we start off installing apt from RPMforge. Follow the guide on the CentOS wiki to configure RPMforge for your system. Then do:

yum install apt

(or alternatively install the latest apt RPM package from http://packages.sw.be/apt/for your distribution)

and then edit the file /etc/apt/sources.list.d/os.list and add for CentOS:

repomd http://mirror.centos.org/ centos/$(VERSION)/os/$(ARCH)
repomd http://mirror.centos.org/ centos/$(VERSION)/updates/$(ARCH)
repomd http://mirror.centos.org/ centos/$(VERSION)/extras/$(ARCH)

This adds the official CentOS osupdates and extras repositories.

Now you can use it, for example do:

apt-get update

to update the locally cached metadata, or do:

apt-get upgrade

to upgrade your system with the latest updates, or yet, do:

apt-get install synaptic

to install a package named synaptic. Try:

synaptic

to start synaptic and use the graphical interface (also available from System > Administration > Synaptic Package Management)

There are a few commands that use the locally cached metadata, the following apt-cache commands are used most often:

apt-cache search keyword

to search the local metadata for packages related to keyword, or:

apt-cache policy package

to show the different versions of a certain package that is offered.

PS And let me also add that the project name is apt-rpm, not apt4rpm (a complete different project).

0 0