I'm creating a program for Ubuntu that involves creation of files within the folder where the code is present.
What I want to know is: When a .deb package is installed, where do the contents go?
If a program makes modifications to or creates new files within the /...
directory, does it require root privileges?
Ubuntu – Does an application need root permissions if it modifies files in the “/” directory
application-developmentdebdirectorypermissions
Best Answer
Strictly, the directory:
/
is the "root" directory of all directories. That includes all sub- directories, so includes yourhome
directory as well.You need additional privileges for all directories outside
~
(yourhome
directory), so either you need to:sudo
privilegesoutside your personal
home
directory.A
.deb
installer, to install items globally for all users, will therefore need t be run withsudo
privileges, since it installs files and executables outside yourhome
directory.When a .deb package is installed, where do the contents go?
Although there are quite strict rules for using directories outside your home directory, there is no easy answer to that; it depends on the application, its role and what kind of application it is. See also here and here (among others).
If you want to get an impression on where files are installed, look inside an unzipped
.deb
installer of a simple application. It contains a scaled version of your system and shows where the files will be "projected" to.