Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.
share|improve this question

4 Answers 4

up vote 3 down vote accepted

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
    
share|improve this answer

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.

share|improve this answer

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

share|improve this answer

Optified means to move files to opt and to another partition. The problem with this device is that the root partition is so small. Anyway I think you need the ar package to create and unpack the dpkg (.deb) files.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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