Author Topic: แปลง .rpm เป็น .deb ใน debian ubuntu ครับ โดย alien  (Read 9585 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2145
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
1 Preliminary Note

In this example I use a Debian Sarge system, and I will show how to convert the mysql-zrm rpm
package to a .deb file and install that one. The procedure is the same for Ubuntu.


2 Alien Installation

Alien is available in the normal Debian repositories, so we can install it like this:

apt-get install alien


3 Converting .rpm To .deb

Next we download the current mysql-zrm rpm package (1.1-1 at the time of this writing):

cd /tmp
wget http://www.zmanda.com/downloads/community/ZRM-MySQL/1.1/Linux/MySQL-zrm-1.1-1.noarch.rpm

To convert it into a .deb package, we simply run

alien MySQL-zrm-1.1-1.noarch.rpm

Afterwards, run

ls -l

in the /tmp directory, and you'll see that alien has created the file mysql-zrm_1.1-2_all.deb.
You'll also notice that alien has counted up the version number, it's now 1.1-2 instead of
1.1-1. If you want to keep the original version number, you must use the -k switch:

alien -k MySQL-zrm-1.1-1.noarch.rpm

will create the file mysql-zrm_1.1-1_all.deb.

To install the new .deb file, we use dpkg -i:

dpkg -i mysql-zrm_1.1-1_all.deb

Now mysql-zrm is installed and fully functional (you still might have to edit its configuration file
though).

If you want to save the dpkg -i step, you can have alien install the package. The command

alien -i MySQL-zrm-1.1-1.noarch.rpm

would convert the original rpm package and immediately install it.

You see, converting .rpm files to .deb files is very easy. You can have a look at

man alien

to learn about what else you can do with alien.