LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 05-08-2007, 02:53 AM   #1
Arnaud_B
Member
 
Registered: Jun 2004
Location: New York
Distribution: Debian
Posts: 219

Rep: Reputation: 30
Changing default installation directory


Hi,
I was wondering how I could change the default installation directory used by dpkg. The problem is that I want to install picasa but dpkg installs it in /opt and I want to have it in /usr/local/lib. I can of course manually copy the folder and create the necessary symlink but I would prefer installing with dpkg. Is there any argument I can pass to dpkg to do that?
Thanks in advance for your help,
Best,
A.
 
Old 05-08-2007, 04:06 AM   #2
Dutch Master
Senior Member
 
Registered: Dec 2005
Posts: 1,682

Rep: Reputation: 124Reputation: 124
From the man pages of dpkg:
Quote:
OPTIONS
All options can be specified both on the command line and in the
dpkg configuration file /etc/dpkg/dpkg.cfg. Each line in the
configuration file is either an option (exactly the same as the
command line option but without leading dashes) or a comment (if
it starts with a #).
<snip>

--root=dir | --admindir=dir | --instdir=dir
Change default directories. admindir defaults to
/var/lib/dpkg and contains many files that give informa‐
tion about status of installed or uninstalled packages,
etc. instdir defaults to / and 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. Changing root changes inst‐
dir to dir and admindir to dir/var/lib/dpkg.

Last edited by Dutch Master; 05-08-2007 at 04:08 AM.
 
Old 05-08-2007, 03:41 PM   #3
Arnaud_B
Member
 
Registered: Jun 2004
Location: New York
Distribution: Debian
Posts: 219

Original Poster
Rep: Reputation: 30
Hi,
Thanks for your answer. I actually already tried with what is in the man page of course. However, I guess I'm not reading correctly as this does not work. Do you know how to use the --instdir option? I tried --instdir=/usr/local/lib and tell me that it cannot find the installation packages so I'm a little confused on how this option work. Well I did not have much time to try much but still I'm not sure to understand this option. Have you already used it?
Thanks,
A.
 
Old 05-08-2007, 03:50 PM   #4
Dutch Master
Senior Member
 
Registered: Dec 2005
Posts: 1,682

Rep: Reputation: 124Reputation: 124
No I didn't, as I don't need it. But what's wrong with having it installed in the default location, where the dev's intended it to reside?
 
Old 05-08-2007, 04:22 PM   #5
Arnaud_B
Member
 
Registered: Jun 2004
Location: New York
Distribution: Debian
Posts: 219

Original Poster
Rep: Reputation: 30
well picasa comes directly from google and they apparently use occasionally other standards... you'll never have apt-get putting you a package in /opt AFAIK... but the point is that I have specific partitions for installed programs (/usr and /usr/local) and I don't have any for /opt as I don't use this directory. If it installs in /opt it ends up on my / partition which is intentionally very small as there is almost nothing in in besides /etc and such... all other stuff have their separate partition (/var /tmp /home tec...) so no I don;t want this thing ending up in /opt... I could have set it up like that from the beginning but I have been using the partition model for years and I don;t want to change it for picasa!
Anyway... Any ideas? In the worse case I'll do it manually it works fine.
Thanks,
A.
 
Old 05-08-2007, 04:58 PM   #6
Dutch Master
Senior Member
 
Registered: Dec 2005
Posts: 1,682

Rep: Reputation: 124Reputation: 124
I see your point and looked at from your position I agree with that. I suggest the following command, but no guarantees!
Code:
dpkg -i <packagename> --instdir=/usr/local/lib/
 
Old 05-08-2007, 05:09 PM   #7
Arnaud_B
Member
 
Registered: Jun 2004
Location: New York
Distribution: Debian
Posts: 219

Original Poster
Rep: Reputation: 30
Thanks for your help again :-)
However... I already tried this one... ;-)
Actually I got an idea but not sure how to proceed... the place where a given app is to be installed is specified in the control file no?... So do you think that if I extract the deb, modify the control file and then rebuild the deb it could work?... if yes do you know how to rebuild the deb from the extracted files?
Well I know it sounds a little overkill for that but I would prefer that dpkg keep track of everything on the system... :-)
Thanks,
A.
 
Old 05-08-2007, 05:15 PM   #8
Dutch Master
Senior Member
 
Registered: Dec 2005
Posts: 1,682

Rep: Reputation: 124Reputation: 124
Your line of thought is right, but I can't help you on the .deb rebuild part.
 
Old 05-08-2007, 07:50 PM   #9
JackieBrown
Member
 
Registered: Dec 2004
Location: San Antonio, TX
Distribution: Debian-AMD64 Sid
Posts: 481

Rep: Reputation: 31
or try dpkg -x packagename.deb /usr/local/
 
Old 05-08-2007, 08:07 PM   #10
Arnaud_B
Member
 
Registered: Jun 2004
Location: New York
Distribution: Debian
Posts: 219

Original Poster
Rep: Reputation: 30
yup it's actually what I though doing if I don't find any other option but doing this makes me lose the advantage of having dpkg keeping track of what is installed. But actually I would need this change of directory for just a couple of apps not in the repo because not FOSS so maybe it's ok and anyway this type of apps are not updated that often...
A.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Default File/Directory Modes Harlin Linux - Security 4 02-07-2007 07:13 AM
Changing default terminal login directory mareid Linux - General 1 06-17-2006 10:31 PM
Changing default current directory to / when ftp ckit Linux - Newbie 1 01-27-2004 07:34 PM
changing Up2date default installation directory ! mchenrytl Red Hat 1 09-25-2003 07:27 AM
Changing default directory / vsftpd chrisknight Linux - Software 5 03-27-2003 06:16 AM


All times are GMT -5. The time now is 04:31 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration