Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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).
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?
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).
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,679
Rep:
Quote:
Originally Posted by MrMeeSeeks
- 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.
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?
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.
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.
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,679
Rep:
Quote:
Originally Posted by MrMeeSeeks
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 .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.