So, I recently acquired a brand new Nokia N900 phone off of an online auction site for a fairly reasonable price. The N900 is a Linux phone, and it came out a long time ago, but it's only just now within my budget.

I've spent the past day struggling with it. Its version of apt is particularly frustrating.

The point I'm at now is, I can't get dpkg to properly configure a package because of how some guy at Nokia decided the phone shouldn't have any files whatsoever in /usr/share/doc. Apparently. And the --configure of this particular package demands that a file be put into /usr/share/doc and then "optified", which is a Nokia Linux term I don't really understand, but seems mainly to have to do with treating /opt/maemo as if it were the root directory when it comes to certain types of files.

Needless to say, this documentation can not be "optified"... I don't really care why, I just want to be able to:

  • Decompress the .deb file myself.
  • Look at the script that tells dpkg where to put things.
  • Modify the script and/or move those files around myself.
  • Do whatever else is necessary so that the right files are in the right place, myself.
  • Inform the list of packages that this package has been 'installed'.
  • Get on with my life, knowing a lot more about .debs than I currently do.

3 Answers 3


You could modify the .deb file by hand, and then install it as if were the original one.

You could take a look to the official reference

The steps I did in some moment in the past, could be summarized as:

  1. Create a working directory:

    mkdir work
    cd work
  2. Make sure that a copy of the .deb file is in that directory.

  3. Decompress the .deb file:

    ar x $DEB_FILE
  4. Remove the .deb file from here:

    rm $DEB_FILE
  5. Decompress the data file:

    mkdir data
    cd data
    tar zxf ../data.tar.gz
    cd ..
  6. Decompress the control file:

    mkdir control
    cd control
    tar zxf ../control.tar.gz
    cd ..
  7. Do whatever change you have to do, for example, modify at least one of the files inside control directory:

    • control/preinst
    • control/postinst
    • control/prerm
    • control/postrm
  8. Update into control/md5sums the md5 checksums of the files you modified.

  9. Compress again the .deb file:

    cd control
    tar zcf control.tar.gz *
    mv control.tar.gz ..
    cd ..
    rm -rf control
    cd data
    tar zcf data.tar.gz *
    mv data.tar.gz ..
    cd ..        
    rm -rf data
    ar r $DEB_FILE debian-binary control.tar.gz data.tar.gz

You can find the postinst scripts in /var/lib/dpkg/info. Fix the script so it doesn't fail, and have dpkg configure the package again. No need to bother with manually unpacking the package.


You could use a tool like deb2targz to uncompress .deb file and manually move files to proper locations.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.