"No such file or directory" while installing a .deb package

4.8k views Asked by At

I've a really strange behavior with a .deb package.

When I try to install using dpkg -i package.deb, I get this error:

iPadAir:/tmp root# dpkg -i packagename.deb
(Reading database ... 4239 files and directories currently installed.)
Preparing to replace packagename 0.0.0-0 (using packagename.deb) ...
Unpacking replacement packagename ...
dpkg: error processing packagename.deb (--install):
unable to create `PACKAGENAME/AviarySDKResources.bundle/AviaryContentPackCompiledDatabase.sqlite': No such file or directory
dpkg-deb: subprocess paste killed by signal (Broken pipe: 13)
Errors were encountered while processing:
 packagename.deb

But .deb file contains a different path! The right path is /Library/Application Support/PACKAGENAME:

iPadAir:/tmp root# dpkg-deb -c packagename.deb
drwxr-xr-x dok/staff         0 2014-11-20 12:46 ./
drwxr-xr-x dok/staff         0 2014-11-20 12:46 ./Library/
drwxr-xr-x dok/staff         0 2014-11-20 12:46 ./Library/Application Support/
drwxr-xr-x dok/staff         0 2014-11-20 12:46 ./Library/Application Support/PACKAGENAME/
drwxr-xr-x dok/staff         0 2014-11-20 12:46 ./Library/Application Support/PACKAGENAME/AviarySDKResources.bundle/
-rw-r--r-- dok/staff    184320 2014-11-20 12:46 ./Library/Application Support/PACKAGENAME/AviarySDKResources.bundle/AviaryContentPackCompiledDatabase.sqlite

Using debug (1100, 'cause I need only filesystem output) I got even strange situation:

iPadAir:/tmp root# dpkg -D1110 -i packagename.deb
D000010: ensure_pathname_nonexisting `/var/lib/dpkg/tmp.ci'
(Reading database ... 4239 files and directories currently installed.)
[....]
[All directories are correctly processed and created...]
[....]
D000010: tarobject ti->Name=`./Library/Application Support/PACKAGENAME/AviarySDKResources.bundle/AviaryColorPalatte.plist' Mode=644 owner=501.20 Type=48(-) ti->LinkName=`' namenode=`/Library/Application Support/PACKAGENAME/AviarySDKResources.bundle/AviaryColorPalatte.plist' flags=2 instead=`<none>'
D000100: setupvnamevbs main=`/Library/Application Support/PACKAGENAME/AviarySDKResources.bundle/AviaryColorPalatte.plist' tmp=`/Library/Application Support/PACKAGENAME/AviarySDKResources.bundle/AviaryColorPalatte.plist.dpkg-tmp' new=`/Library/Application Support/PACKAGENAME/AviarySDKResources.bundle/AviaryColorPalatte.plist.dpkg-new'
D000100: tarobject nonexistent
D000010: ensure_pathname_nonexisting `/Library/Application Support/PACKAGENAME/AviarySDKResources.bundle/AviaryColorPalatte.plist.dpkg-new'
D000010: ensure_pathname_nonexisting `/Library/Application Support/PACKAGENAME/AviarySDKResources.bundle/AviaryColorPalatte.plist.dpkg-tmp'
D000100: tarobject NormalFile[01] open size=479
D000100: tarobject new - no backup
D000100: tarobject done and installed
D000010: tarobject ti->Name=`PACKAGENAME/AviarySDKResources.bundle/AviaryContentPackCompiledDatabase.sqlite' Mode=644 owner=501.20 Type=48(-) ti->LinkName=`' namenode=`/PACKAGENAME/AviarySDKResources.bundle/AviaryContentPackCompiledDatabase.sqlite' flags=2 instead=`<none>'
D000100: setupvnamevbs main=`/PACKAGENAME/AviarySDKResources.bundle/AviaryContentPackCompiledDatabase.sqlite' tmp=`/PACKAGENAME/AviarySDKResources.bundle/AviaryContentPackCompiledDatabase.sqlite.dpkg-tmp' new=`/PACKAGENAME/AviarySDKResources.bundle/AviaryContentPackCompiledDatabase.sqlite.dpkg-new'
D000100: tarobject nonexistent
D000010: ensure_pathname_nonexisting `/PACKAGENAME/AviarySDKResources.bundle/AviaryContentPackCompiledDatabase.sqlite.dpkg-new'
D000010: ensure_pathname_nonexisting `/PACKAGENAME/AviarySDKResources.bundle/AviaryContentPackCompiledDatabase.sqlite.dpkg-tmp'
dpkg: error processing packagename.deb (--install):
 unable to create `PACKAGENAME/AviarySDKResources.bundle/AviaryContentPackCompiledDatabase.sqlite': No such file or directory
D000010: cu_installnew `/PACKAGENAME/AviarySDKResources.bundle/AviaryContentPackCompiledDatabase.sqlite' flags=2
D000100: setupvnamevbs main=`//PACKAGENAME/AviarySDKResources.bundle/AviaryContentPackCompiledDatabase.sqlite' tmp=`//PACKAGENAME/AviarySDKResources.bundle/AviaryContentPackCompiledDatabase.sqlite.dpkg-tmp' new=`//PACKAGENAME/AviarySDKResources.bundle/AviaryContentPackCompiledDatabase.sqlite.dpkg-new'
D000100: cu_installnew not restoring
D000100: unlinkorrmdir `//PACKAGENAME/AviarySDKResources.bundle/AviaryContentPackCompiledDatabase.sqlite.dpkg-new' rmdir No such file or directory
D000010: cu_installnew `/Library/Application Support/PACKAGENAME/AviarySDKResources.bundle/AviaryColorPalatte.plist' flags=52
D000100: setupvnamevbs main=`//Library/Application Support/PACKAGENAME/AviarySDKResources.bundle/AviaryColorPalatte.plist' tmp=`//Library/Application Support/PACKAGENAME/AviarySDKResources.bundle/AviaryColorPalatte.plist.dpkg-tmp' new=`//Library/Application Support/PACKAGENAME/AviarySDKResources.bundle/AviaryColorPalatte.plist.dpkg-new'

As you see dpkg try to create a directory PACKAGENAME in 'root' directory instead of '/Library/Application Support'. I tried to rebuild my debian package but nothing change (and yes, debian package have correct path in tar archive).

Can someone help me ?

Tnx a lot

PS: even if you see iPadAir, I tried same dpkg commands on ubuntu box. Same error :(

2

There are 2 answers

0
thomasstephn On

If someone stops by because facing the same issue:

dpkg-deb: error: unable to create temporary directory: No such file or directory

It might be because the /tmp folder is not accessible properly. It got deleted by accident on a server and so dpkg-deb had no place to store temp files.

So just restore it:

mkdir /tmp
chmod 1777 /tmp
0
DoK On

After weeks of research, I finally found that I was using a buggy version of dpkg-deb (1.13.25). After updating to latest one (1.14.25 at the moment) all errors disappeared!