Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dpkg giving error "Is a directory"

I am trying to create a Debain .deb package. Package is being created successfully but I am getting following error when I try to install it:

 unable to open file '/var/lib/dpkg/tmp.ci//opt': Is a directory

The package directory structure is :

.
└── DEBIAN
    ├── control
    ├── opt
    │   └── myDir
    │       └── myfile
    ├── postinst
    └── preinst

In preinst I've - mkdir -p /opt/myDir postinst is empty

If I try to install package on a different host, I get below error:

package control info rmdir of `opt' didn't say not a dir: Directory not empty

Any ideas?

like image 735
user837208 Avatar asked Oct 16 '11 18:10

user837208


1 Answers

Your directory layout is wrong. It should be like this:

.
├── opt
│   └── myDir
│       └── myfile
└── DEBIAN
    ├── control
    ├── postinst
    └── preinst

After you build your package you can test its format with lintian:

lintian my-package.deb

I had the same problem as you and lintian helped me fix it.

like image 103
cubabit Avatar answered Oct 04 '22 04:10

cubabit