# Debian package: dpkg with --instdir option



## nehajain (May 6, 2010)

In Linux ( RHEL 3) any Linux package(rpm) can be installed to user defined directory rather than the default location by using the following command.

%rpm –ivh –relocate old/default_dir=NEWDIR <packagename>

I found that in Debian this can done by using the –instdir option with dpkg utility. But whenever I tried to install any package on Debian using –instdir to my specified directory , package getting installed into the default path. Also it throws two different errors when I run the command in following 2 ways ::

Case 1 
# dpkg -i <pkgname.deb> --instdir=/home/test

Error: 
dpkg: error processing --instdir=/home/test (--install):
cannot access archive: No such file or directory

Case 2: 
# dpkg --instdir=/home/test –i <pkgname.deb>

Error: 
dpkg (subprocess): unable to execute new pre-installation script: No such file or directory
dpkg: error processing <pkgname.deb> (--install):
subprocess pre-installation script returned error exit status 2
dpkg (subprocess): unable to execute new post-removal script: No such file or directory
dpkg: error while cleaning up:
subprocess post-removal script returned error exit status 2
Errors were encountered while processing: <pkgname.deb>


Can anyone please let me know the exact procedure to install any package into different location on Debian.

Thanks in advance
NJ


----------

