torsdag 5 februari 2015

Linux - 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,

1
2
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.

1
dpkg -b dir_tmp some_debian_package_new.deb

You can install your new package using,

1
sudo dpkg -i some_debian_package_new.deb

    

Inga kommentarer: