How to edit .deb control files

I need to edit deb files sometime – usually I need to change the dependencies, like a few days ago, when I wanted to install python-pyopencl on a Debian unstable, but without the Nvidia dependencies. After some ducking (people who use Google are “googling”, I used Duck Duck Go so I suppose I “ducked”) I found a simple solution:

The .deb files have embedded inside them a “control” file. It is basically a text file which describes version, dependencies, conflict, suggests and so on. If someone wants to remove a dependency or a conflict, he needs to unpack the deb file (it’s a normal archive, actually), edit the control file and then repack the .deb file.

This is not really that complicated (you need to run 3 commands), but I found out a very useful script on the Ubuntu Forums. I modified it to use the $EDITOR environment variable, if it exists, and I changed his name to debcontroledit.

Download here my version of debcontroledit.

It’s really easy to use:

$ debcontroledit package.deb

The editor specified in $EDITOR will be started (or nano if $EDITOR is not defined) with the control file open. You can make any changes you need (changing dependencies, conflicts…) and if you save the file, the script will create a file called “package.modified.deb”, which you can install instead of your original deb file.

I hope it will be useful for you too – it saved me a lot of package management problems.

Comments? You know what to do with the box below!

Image credit: Đurađ Radojičić.

TwitterFacebookLinkedInGoogle ReaderYahoo MessengerEmailGoogle GmailYahoo MailPrintShare

Related posts:

  1. How to delete unreadable files from NTFS
  2. How to change files in a initrd image
  3. De ce ai nevoie de un editor pentru situl companiei
  4. Ubuntu annoyances – two arping packages

Leave a Reply

Your email address will not be published. Required fields are marked *

*


× eight = 40

CommentLuv badge