Warning: This blog entry was written two or more years ago. Therefore, it may contain broken links, out-dated or misleading content, or information that is just plain wrong. Please read on with caution.
Many times I have needed a tgz package for my slackware server only to find that it is only available in .rpm or .deb format. After alot of googling I found some simple solutions. Here they are.
Note: While these methods will convert the data as you need, be aware that the packages have been built for an alternative distribution and may not work as expected.
Convert .rpm to .tgz
This is the simplest of them all. Slackware comes with a handy utility called oddly enough "rpm2tgz".Simply run this on your rpm file and thats it.
Convert .rpm to tar.gz
Alternatively if you need a tar.gz file just run "rpm2targz" on your rpm file
Convert .deb to tgz
This took a little more time to figure out. The easiest solution I found is to first install the "deb2tgz" utility which can be downloaded from http://code.google.com/p/deb2tgz/. Then once again run the relevent command.
Convert .deb to tar.gz
It turns out that deb files are simply "ar" archives which contain the following files.
The file we are interested in is the "data.tar.gz" file. To extract it we simply use the "ar" command. This leaves us with the three files above from which we select the data.tar.gz file which we can list or extract as normal using the tar command.
//extract deb file using ar
ar vx mypackage.deb
//list all files in the resultant tar.gz file
tar -tzvf data.tar.gz
//extract the tarball
tar -xzvf data.tar.gz
There you have it, four simple ways of converting rpm/deb into slackware usable packages.