Creating deb Packages From tar.bz File In Ubuntu

Creating deb packages in Ubuntu from tar.bz is possible using the “alien” command. The alien command converts an RPM or source package file into a Debian package file, or can install an RPM file directly. Creating deb packages with alien is not recommended for replacing important system packages like init, libc, or other things essential for your system’s functioning, because some distributions set up these packages differently. But for other packages that are not yet available in Ubuntu or Debian, you can create deb packages with the alien command.

Install Alien

Before creating deb packages you need to install alien. If you haven’t installed it yet, run the following command from your terminal:

sudo apt-get install alien

It will take a while to finish. After it finishes you will be ready to create deb packages from tar.bz or RPM files.

Creating deb Packages With Alien

To create deb packages with alien, use the following format:

alien [--to-deb|-d] [options] file [...]

For example:

alien --to-deb  -V file.tar.bz #Will create file.deb with verbose
alien -d  -V file.tar.bz #Will create file.deb with verbose

Besides converting from tar.bz files, alien can also convert from RPM packages:

alien --to-deb  -V package.rpm

It also works with multiple options:

alien --to-deb --to-rpm --to-tgz --to-slp bar.rpm

That command will create 3 package formats: deb, rpm and tgz.

Writer’s Note:
This is not the recommended way to install software packages in Ubuntu. If at all possible, install packages from Ubuntu’s repositories using Add/Remove, apt-get, or the Synaptic Package Manager. Package dependency conflicts may occur when attempting to install RPM packages. But if you have no other choice you can use alien with caution. And don’t run alien on tar files with source code in them, unless you want the source code installed in your root directory when you install the package!

More details:
Creating deb packages with alien manual