[Terminal] - Do applications know where to install?

New to Debian (Or Linux in general)? Ask your questions here!

[Terminal] - Do applications know where to install?

Postby RedPieDad » 2017-12-08 08:28

I used the:
Code: Select all
apt-get install sudo
to install "sudo". And I used
Code: Select all
apt-get install synaptic
to install "synaptic package manager". Do these packages automatically know the "correct/optimal" directory to install at with the "apt-get" command? And lets say I wanted to change the directory of the installation, what command(s) at installation would I use to alter it's configured folder path?
RedPieDad
 
Posts: 12
Joined: 2017-12-08 08:17

Re: [Terminal] - Do applications know where to install?

Postby Ardouos » 2017-12-08 09:35

RedPieDad wrote:I used the:
Code: Select all
apt-get install sudo
to install "sudo". And I used
Code: Select all
apt-get install synaptic
to install "synaptic package manager". Do these packages automatically know the "correct/optimal" directory to install at with the "apt-get" command?

Yes.

It is dpkg that unpacks the package. whether you decide use the command line tool or Synaptic is personal preference.
RedPieDad wrote:And lets say I wanted to change the directory of the installation, what command(s) at installation would I use to alter it's configured folder path?

You can change the directory where the file is installed through dpkg. AFAIK you can only change dpkg's root directory where it installs software.

from its man page:
--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 /)

It is not something I would recommend though. Unless you know what you are doing.

https://linux.die.net/man/1/dpkg
Also: https://www.linuxquestions.org/question ... ry-552180/
User avatar
Ardouos
 
Posts: 991
Joined: 2013-11-03 00:30
Location: Elicoor II

Re: [Terminal] - Do applications know where to install?

Postby michapma » 2017-12-08 12:38

RedPieDad wrote:And lets say I wanted to change the directory of the installation, what command(s) at installation would I use to alter it's configured folder path?

Instead of asking how to do this, tell us what it is you really want to do. In other words, what do you hope to achieve by this? For instance, do you need to manage space on different partitions? If so, there are better ways to do it.
User avatar
michapma
 
Posts: 539
Joined: 2008-05-04 20:49
Location: Prague

Re: [Terminal] - Do applications know where to install?

Postby debiman » 2017-12-09 10:00

also don't forget to run
Code: Select all
apt-get update
and preferably also
Code: Select all
apt-get upgrade
BEFORE installing things.
User avatar
debiman
 
Posts: 2411
Joined: 2013-03-12 07:18

Re: [Terminal] - Do applications know where to install?

Postby steve_v » 2017-12-09 13:45

RedPieDad wrote:Do these packages automatically know the "correct/optimal" directory to install at with the "apt-get" command?

All package installation tools call dpkg, and dpkg installs files in the appropriate system directories automatically based on the directory structure in the package itself.

RedPieDad wrote:And lets say I wanted to change the directory of the installation, what command(s) at installation would I use to alter it's configured folder path?

Firstly, you don't. There's no reason to do this unless you are installing software manually from a non-debian package - in which case you specify the installation path when compiling the software.
Putting a package or application in it's own directory is a Windoze thing. In Debian (or any Linux/Unix based OS) files are located by what they do, not what application they belong to - binaries go in /usr/bin, libraries go in /usr/lib, other stuff goes in /usr/share, etc.
Changing this would require rebuilding all the packages you want to move. That's a lot of buggering about for zero benefit. Why would you want to do this?
steve_v
 
Posts: 695
Joined: 2012-10-06 05:31
Location: New Zealand


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable