How to install *.deb package using Dpkg to specific directory.

I have to install two packages (libidb and python-idb and both are depended to each other ) from third party.So,we can not get access of source code. I have tried with these following method to install and i got error also:

> > sumitkumars@administrator-Lenovo-U410:~$ sudo dpkg -i libidb-0.12.0-0b81d72-0.amd64.deb --instdir=/home/sumitkumars/mydir
> [sudo] password for sumitkumars: (Reading database ... 186372 files
> and directories currently installed.) Preparing to unpack
> libidb-0.12.0-0b81d72-0.amd64.deb ... Unpacking libidb (0.12.0) over
> (0.12.0) ... dpkg: error processing archive
> --instdir=/home/sumitkumars/mydir (--install): cannot access archive: No such file or directory Setting up libidb (0.12.0) ... Errors were
> encountered while processing: --instdir=/home/sumitkumars/mydir

then i tried with this:

sumitkumars@administrator-Lenovo-U410:~$ sudo dpkg-deb -x libidb-0.12.0-0b81d72-0.amd64.deb /home/sumitkumars/mydir/

It is not giving error but it was not working with its another depency(python-idb)

I have added python also because it is unable to bind with "libidb".

4 Answers

dpkg-deb -x $DEBFILE $TARGET_DIRECTORY
# Example
dpkg-deb -x somedeb.deb /home/yung/test

Source

2

A .deb is just an archive, like a zip file

You can manually extract it ;

sudo apt install binutils
ar x your.deb

You then extract the .tar or whatever is in the .deb

tar xvf control.tar.gz
tar data.tar.gz

You can then manually copy the files to wherever you wish, I would use /usr/local so they are on your path, up to you.

You may need to read / run the config files and install scripts as well, cant say from what you have posted.

4

There is no need to extract the package contents of these two packages, only because they are dependent on each other.

Just give both packages at once when installing

dpkg -i libidb-0.12.0-0b81d72-0.amd64.deb python-idb-<version>.amd64.deb
2

In all other answers recommending decompressing archive -- that is not the same as installing! One of the notable differences is that postinst script is not run when using -x. The only satisfactory answer to the OPs question is this option, straight from man pages:

 --instdir=dir Change default installation directory which refers to the directory where packages are to be installed. instdir is also the directory passed to chroot(2) before running package's installation scripts, which means that the scripts see instdir as a root directory. (Defaults to «/»)

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like