Modify dependencies, add/remove files of debian(.deb) package

Many times it is possible to get around package dependency problems in ubuntu, debian, mint or any other debian based distribution by adding or removing files, making changes to control file or modifing dependencies of a debian package.

Obtain the .deb you want to modify and create a temporary directory. To uncompress the debian package into the temporary directory,

dpkg-deb -x some_debian_package.deb dir_tmp
dpkg-deb --control some_debian_package.deb dir_tmp/DEBIAN

Note: Use the package you want to modify in the place of some_debian_package.deb and temporary directory you created in the place of dir_tmp.

Now perform the changes you want to make. Once you are done with your modification, you can repack your changes into a new debian package.

dpkg -b dir_tmp some_debian_package_new.deb

You can install your new package using,

sudo dpkg -i some_debian_package_new.deb


Ravi Teja is a technology entrepreneur with interest in Embedded Systems, Software engineering, Operating Systems, Web development, Cloud computing, Machine learning, etc.

More Posts - Website

Follow Me:
LinkedInGoogle Plus