LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-31-2017, 08:22 AM   #1
MrMeeSeeks
Member
 
Registered: Jan 2017
Posts: 32

Rep: Reputation: Disabled
how to set directories for apt / dpkg


I have repeatedly had the problem of apt or dpkg spilling programs all over my filesystem, and I don't really see the point to this.

Latest example would be mySQL, which was distributed over /etc, /usr and /lib.

Now, is it possible to force apt or dpkg to keep an installation in one coherent directory subtree, will this screw up an installation - which might after all depend on absolute paths or something - and if so, is there any way other way than going through the source to know in advance, and if not: how do I do it?

Or, as most of what I've read so far to me indicates that this is generally not possible, can I at least get them to tell me where exactly they dumped all the stuff and which directories they set up? Going through the output seldom helped.
 
Old 01-31-2017, 08:27 AM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693
The point? All programs do this. They put their configuration files in /etc, library files in /lib and executables in /usr/bin or /usr/sbin. They also put their logs in /var/log. There are some new package things that will be trying to do the container approach - see flatpak http://flatpak.org/

Install it into a coherent tree? From source you could use chroot and install it into a chroot environment.

See what files are installed in a package with:
Code:
dpkg -c <packagename>
 
Old 01-31-2017, 08:30 AM   #3
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,001
Blog Entries: 3

Rep: Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632
There's method to the madness. See the manual page for hier(7) for an explanation. Having the different types of files in different locations allows them to potentially be mounted in different mount points with different options. Further it makes backup easy. You have your data somewhere under /var and you have your configuration files under /etc, each with different backup schedules. With that, you don't need to back up the programs themselves, just a list that can be fed into dpkg for installation on any fresh machine.

Looking ahead, at least at Ubuntu, you might read about Snappy and snaps. That has a different model from APT, one that you might find interesting.

Don't worry. Though too much M$ Windows exposure does seem to cripple the ability to learn and work with computers, it is not an insurmountable handicap. There's just a lot of unlearning that has to happen. Hang in there.
 
2 members found this post helpful.
Old 01-31-2017, 08:35 AM   #4
nodir
Member
 
Registered: May 2016
Posts: 222

Rep: Reputation: Disabled
Code:
whereis mysql
came to my mind, but the previous anwser, dpkg -c <pkg>, is probably the better one.

I also agree that there ain't much point in it, that pretty much all programs to it similar to this (and not only for debian, as far GNU/Linux is concerned, but also for other Unix[-like] operating systems).

I think graft does it different, but that is far being widely used yet: https://directory.fsf.org/wiki/Graft
(and would avoid one of the main gems of debian, the package-management).
 
Old 01-31-2017, 08:35 AM   #5
MrMeeSeeks
Member
 
Registered: Jan 2017
Posts: 32

Original Poster
Rep: Reputation: Disabled
Well that was weirdly inspiring yet insulting.
Thanks for the brief explanation and especially the reading material.
 
1 members found this post helpful.
Old 01-31-2017, 08:35 AM   #6
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Linux Directory Structure (File System Structure) Explained with Examples
 
2 members found this post helpful.
Old 01-31-2017, 09:08 AM   #7
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Builds character and experience?
 
Old 01-31-2017, 11:41 AM   #8
MrMeeSeeks
Member
 
Registered: Jan 2017
Posts: 32

Original Poster
Rep: Reputation: Disabled
Okay, still, this drives me crazy.
Somewhat off the topic now, but: the Oracle Documentation for example talks about "the installation directory" which would "usually" be somewhere in /usr/local - where there is nothing mysql-related at all on my system - to initialize the data directory by setting up a folder mysql-files, which I find in /var/lib after installation via apt. Which seems like pretty much something entirely different than /usr/local to me, although admittedly fits better.

And the documentation just routinely refers to files, folders and scripts without any hint to where they are at all, or points to /usr/var which doesn't even exist. Well okay, there's no point or question here, just annoys me - especially since the distribution of the files does not appear to be that strict and coherent after all.

'whereis mysql' gives me mysql: /usr/bin/mysql /usr/lib/mysql /etc/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz
- some of these are in fact commands, but /etc/mysql is just a folder. So, what's the rationale here?
 
Old 01-31-2017, 11:54 AM   #9
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Some basics are necessary, I think.
http://rlworkman.net/howtos/rute/
 
Old 01-31-2017, 12:18 PM   #10
nodir
Member
 
Registered: May 2016
Posts: 222

Rep: Reputation: Disabled
Quote:
Originally Posted by MrMeeSeeks View Post
Okay, still, this drives me crazy.
Somewhat off the topic now, but: the Oracle Documentation for example talks about "the installation directory" which would "usually" be somewhere in /usr/local - where there is nothing mysql-related at all on my system - to initialize the data directory by setting up a folder mysql-files, which I find in /var/lib after installation via apt. Which seems like pretty much something entirely different than /usr/local to me, although admittedly fits better.
/usr/local as installation prefix is nothing unusual, but it is not used on debian and debian based systems.
In that case you would end with similar directories, only here:
Code:
$ ls /usr/local/
bin	etc	include	info	lib	libdata	libexec	llvm37	man	openssl	sbin	share	var
As you see: bin, etc, var, man ... all there, only at a different location.

Quote:
- some of these are in fact commands, but /etc/mysql is just a folder. So, what's the rationale here?
It was already explained above.

I don't think it is necessary to think that much about such questions when using a binary distribution like debian (or debian-based).
The packagemanagers do it the right way, that is what they are there for, and the understanding will come with time (or not, it really ain't necessary to know all of it).
 
Old 01-31-2017, 12:34 PM   #11
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,679

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Quote:
Originally Posted by MrMeeSeeks View Post
- some of these are in fact commands, but /etc/mysql is just a folder. So, what's the rationale here?
A "folder" is just another file, as is a device. OK, sadly perhaps, Linux doesn't go that far but that's the aim.
I see from your earlier posts you're able to get over an apparent insult (which was not meant that way) so I would just suggest reading more until you're less annoyed about _nix style stuff.
 
Old 01-31-2017, 12:51 PM   #12
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
I have in the past, also installed a repo version and then nuked it to orbit with my own files.
apache2 about a year ago, failed due to /etc/apache2 not being "present".

The one thing I rely on is where Ubu/Deb and Co. put things.
I like apt. It works for me.
what package puts what where? Why worry about it?
I use to, gave up. Smarter people than I wrote this thing, who am I to argue?

Coherence comes later'ish.

Peace!
 
Old 01-31-2017, 12:56 PM   #13
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
The /usr/local/ is mostly reserved for things NOT installed by the distro. Distro installed things tend to omit the /local/ part.

$ dpkg -x <package.deb>

You can extract any package to any location really. But it doesn't mean it's installed. Although many things can be used from any location with various environment variables and other compensations.
 
Old 01-31-2017, 01:50 PM   #14
MrMeeSeeks
Member
 
Registered: Jan 2017
Posts: 32

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Habitual View Post
I have in the past, also installed a repo version and then nuked it to orbit with my own files.
apache2 about a year ago, failed due to /etc/apache2 not being "present".

The one thing I rely on is where Ubu/Deb and Co. put things.
I like apt. It works for me.
what package puts what where? Why worry about it?
I use to, gave up. Smarter people than I wrote this thing, who am I to argue?

Coherence comes later'ish.

Peace!
Well I honestly have yet to install a single application via apt, which just works fine "off the shelve". That's one of the reasons I have difficulties operating with programs over which I have no overview.
Thanks for the text, has been quite enlightening so far, although barely relevant for my current problems.

Quote:
Originally Posted by 273
A "folder" is just another file, as is a device. OK, sadly perhaps, Linux doesn't go that far but that's the aim.
I see from your earlier posts you're able to get over an apparent insult (which was not meant that way) so I would just suggest reading more until you're less annoyed about _nix style stuff.
Well, but the point of the 'whereis' is to put out paths to binaries n stuff, isn't it? I mean, else it'd just be find.
Apart from that - I was joking, obviously, about being insulted, and I agree with you - actually have been doing little else those past three days. Just quite a number of problems and a vast field. But I am quite amazed.
 
Old 01-31-2017, 02:16 PM   #15
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,679

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Quote:
Originally Posted by MrMeeSeeks View Post
Well, but the point of the 'whereis' is to put out paths to binaries n stuff, isn't it? I mean, else it'd just be find.
Apart from that - I was joking, obviously, about being insulted, and I agree with you - actually have been doing little else those past three days. Just quite a number of problems and a vast field. But I am quite amazed.
There is that...
Sorry, I felt the need to repeat a meme -- glad you saw through it .
 
  


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
apt-get dpkg error 5%dpkg akhund_bilal Debian 17 01-16-2022 08:25 PM
APT/dpkg errors! /var/lib/dpkg/status bassclarinet Debian 16 12-01-2011 09:24 AM
[SOLVED] DPKG/apt-get broken - GLIBC_2.6 not found (required by dpkg) Alize Linux - Software 15 05-23-2011 04:25 AM
dpkg: dpkg - error: PATH is not set basis1980 Linux - Software 1 12-07-2007 04:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration