Saturday, November 06, 2010

Install a package from Debian repository for Ubuntu

You can directly use Debian repository. But Debian packages may or may not be compatible with Ubuntu. So you take your own risks by doing so. Another way is to download source and build the package, which is described below.

1) Add a line to /etc/apt/sources.list

    deb-src repo-url

2) Update package index

    sudo apt-get update

3) Install dependencies: (These dependencies are downloaded from Ubuntu repository, not Debian repository)

    sudo apt-get build-dep pkg_name

4) Download source and build package

    apt-get -b source pkg_name

Now you should have a pkg_name.deb file generated in current directory.

5) Install the package

    sudo dpkg -I pkg_name.deb

6) Revert /etc/apt/sources.list file by removing the line added in step 1).

7) Rebuild package index

    sudo apt-get update

 

You are done!

No comments: