this post was submitted on 28 May 2025
1928 points (98.6% liked)

memes

15012 readers
5029 users here now

Community rules

1. Be civilNo trolling, bigotry or other insulting / annoying behaviour

2. No politicsThis is non-politics community. For political memes please go to [email protected]

3. No recent repostsCheck for reposts when posting a meme, you can only repost after 1 month

4. No botsNo bots without the express approval of the mods or the admins

5. No Spam/AdsNo advertisements or spam. This is an instance rule and the only way to live.

A collection of some classic Lemmy memes for your enjoyment

Sister communities

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 4 points 2 days ago (2 children)

I just tried this with Samba (so dpkg -L samba and dpkg -S samba, and I also tried adding grep "smb.conf" and running it with sudo) and I was unable to find the share config file.

It's located under /etc/samba/smb.conf but that command was returning a path under my local user. This is on Ubuntu

[–] [email protected] 1 points 2 days ago* (last edited 2 days ago) (1 children)

dpkg -S requires a full path like the example I gave. dpkg -L samba should work fine. What is the error you got?

[–] [email protected] 1 points 2 days ago (2 children)

No error or anything, but it just doesn't have the /etc/samba/smb.conf file. Just doesn't have it.

dpkg -S samba does find /usr/share/samba/smb.conf which isn't the right file either.

[–] [email protected] 2 points 1 day ago* (last edited 1 day ago) (1 children)

This is a good argument for shipping an empty config file.

Your point stands, but this also isn't completely unintuitive. There is pattern there: you installed samba and the config is in /etc/samba/. System level installs will almost always install their config in /etc/ and the sub directory will typically match the name somewhat.

There is likely a general thought that if you're going to administer a samba server, you'll also be comfortable with conventions and man pages. Although, funnily enough, in the particular case of samba, man smb.conf doesn't show the path lol

[–] [email protected] 1 points 1 day ago (1 children)

That's the thing though, when you install Samba it does create an empty config file at \etc\samba\smb.conf, or at least I've never created one

[–] [email protected] 2 points 1 day ago* (last edited 1 day ago)

I see why it does this now. Debian does

CONFIG=/etc/samba/smb.conf
# stuff
ucf --three-way --debconf-ok /usr/share/samba/smb.conf "$CONFIG"

in the postinit inside the .deb file to create the /etc/samba/smb.conf file. They do it this way so they don't nuke an already created file. I take back that they should be shipping an empty file, this way is better, but it also means you'll never be able to query it without some changes to the packaging tools.

The man page should mention the path though that's a bit lame.

[–] [email protected] 2 points 2 days ago* (last edited 1 day ago) (1 children)

You're confusing the command again

 -L, --listfiles package-name...
               List files installed to your system from package-name.
 -S, --search filename-search-pattern...
               Search for a filename from installed packages.

dpkg -S /my/file/path

Finds which, installed, package installed the file.

dpkg -L samba | grep .conf

Greps through the list of files installed by a given package.

If the file you want isn't in there then it wasn't installed by the package itself (could be created on the fly by the binary for example), in which case obviously the package system can't track it.

[–] [email protected] 1 points 2 days ago (1 children)

Oh I see, this command didn't really do what I wanted it to do then. I just wanted to be able to see the locations of any files associated with a program. If I knew the file path I could just find them haha

[–] [email protected] 2 points 2 days ago* (last edited 2 days ago) (1 children)

dpkg -L PACKAGE_NAME does what you want. In my initial reply I mentioned that dpkg -S is the inverse.

[–] [email protected] 1 points 2 days ago* (last edited 2 days ago) (1 children)

Here is the entire output I get when I get that command.

username@server:~$ dpkg -L samba /usr/share/doc/samba/examples /usr/share/doc/samba/examples/LDAP /usr/share/doc/samba/examples/LDAP/README /usr/share/doc/samba/examples/LDAP/get_next_oid /usr/share/doc/samba/examples/LDAP/ol-schema-migrate.pl /usr/share/doc/samba/examples/LDAP/samba-nds.schema /usr/share/doc/samba/examples/LDAP/samba-schema-FDS.ldif /usr/share/doc/samba/examples/LDAP/samba-schema-netscapeds5.x.README /usr/share/doc/samba/examples/LDAP/samba-schema.IBMSecureWay /usr/share/doc/samba/examples/LDAP/samba.ldif /usr/share/doc/samba/examples/LDAP/samba.schema /usr/share/doc/samba/examples/LDAP/samba.schema.at.IBM-DS /usr/share/doc/samba/examples/LDAP/samba.schema.oc.IBM-DS /usr/share/doc/samba/examples/logon /usr/share/doc/samba/examples/logon/genlogon /usr/share/doc/samba/examples/logon/genlogon/genlogon.pl /usr/share/doc/samba/examples/logon/mklogon /usr/share/doc/samba/examples/logon/mklogon/mklogon.conf /usr/share/doc/samba/examples/logon/mklogon/mklogon.pl /usr/share/doc/samba/examples/logon/ntlogon /usr/share/doc/samba/examples/logon/ntlogon/README /usr/share/doc/samba/examples/logon/ntlogon/ntlogon.conf /usr/share/doc/samba/examples/logon/ntlogon/ntlogon.py /usr/share/doc/samba/examples/printing /usr/share/doc/samba/examples/printing/VampireDriversFunctions /usr/share/doc/samba/examples/printing/prtpub.c /usr/share/doc/samba/examples/printing/readme.prtpub /usr/share/doc/samba/examples/printing/smbprint.sysv /usr/share/lintian /usr/share/lintian/overrides /usr/share/lintian/overrides/samba /usr/share/man /usr/share/man/man1 /usr/share/man/man1/log2pcap.1.gz /usr/share/man/man1/mvxattr.1.gz /usr/share/man/man1/oLschema2ldif.1.gz /usr/share/man/man1/profiles.1.gz /usr/share/man/man1/sharesec.1.gz /usr/share/man/man1/smbcontrol.1.gz /usr/share/man/man1/smbstatus.1.gz /usr/share/man/man8 /usr/share/man/man8/eventlogadm.8.gz /usr/share/man/man8/nmbd.8.gz /usr/share/man/man8/pdbedit.8.gz /usr/share/man/man8/samba-bgqd.8.gz /usr/share/man/man8/samba-gpupdate.8.gz /usr/share/man/man8/samba.8.gz /usr/share/man/man8/samba_downgrade_db.8.gz /usr/share/man/man8/smbd.8.gz /usr/share/samba /usr/share/samba/admx /usr/share/samba/admx/GNOME_Settings.admx /usr/share/samba/admx/en-US /usr/share/samba/admx/en-US/GNOME_Settings.adml /usr/share/samba/admx/en-US/samba.adml /usr/share/samba/admx/ru-RU /usr/share/samba/admx/ru-RU/GNOME_Settings.adml /usr/share/samba/admx/samba.admx /usr/share/samba/mdssvc /usr/share/samba/mdssvc/elasticsearch_mappings.json /usr/share/samba/update-apparmor-samba-profile /var /var/lib /var/lib/samba /var/lib/samba/printers /var/lib/samba/printers/COLOR /var/lib/samba/printers/IA64 /var/lib/samba/printers/W32ALPHA /var/lib/samba/printers/W32MIPS /var/lib/samba/printers/W32PPC /var/lib/samba/printers/W32X86 /var/lib/samba/printers/WIN40 /var/lib/samba/printers/x64 /usr/share/bug/samba/presubj /usr/share/bug/samba/script

Now, if I grep those commands, I get these outputs

username@server:~$ dpkg -S samba | grep "smb.conf" samba-common: /usr/share/samba/smb.conf samba-common: /usr/share/doc/samba-common/examples/smb.conf.default python3-samba: /usr/lib/python3/dist-packages/samba/gp/gp_smb_conf_ext.py

username@server:~$ dpkg -L samba | grep "smb.conf" username@server:~$

And these are copy and pasted straight from my terminal.

[–] [email protected] 2 points 2 days ago* (last edited 2 days ago) (1 children)

Like I said, it obviously can only track files installed by the package, if the conf was generated by the executable after, or if you created it, the package system cannot know about it.

Also, you're still using -S wrong. It takes a file path as argument, not a package name. And does the opposite of -L by showing you which installed package, if any, owns an existing file.

[–] [email protected] 2 points 2 days ago (1 children)

And like I said

this command didn't really do what I wanted it to do then

I just want to do something like find {package name} | grep "config.conf" or something like that. I normally know what the program is called, I just don't know where it is located.

[–] [email protected] 0 points 1 day ago* (last edited 1 day ago) (1 children)

No it does exactly that. The issue is that the config you are looking at was not created by a package.

[–] [email protected] 0 points 1 day ago* (last edited 1 day ago) (1 children)

That person wants to find a file used by a certain package.

You gave them a command to find a file shipped in a certain package.

Those are not the same things so no, you did not gave them what they wanted, as they clearly demonstrated by showing you that a file that they know is used by a certain packaged is not listed by the command you gave them when applied to that package.

You de facto did not solve that person's problem yet have repeatedly insisted you did:

Are you an LLM?!

[–] [email protected] 1 points 1 day ago* (last edited 1 day ago) (1 children)

Re read their original.messsage. they specifically asked for, and I quote, "install paths". You're going to have to work on reading comprehension before accusing people of being LLMs.

Meanwhile, every single time they replied they used the command wrong... Provided the wrong value for the arguments. Despite the original instructions. Yeah, it didn't work for them. That's a skills issue.

[–] [email protected] 0 points 1 day ago* (last edited 1 day ago) (1 children)

From their original post.

I’ve been using Linux daily for over a year now and I still have a hard time tracking down config files and install paths.

(empahsys mine)

To which you responded, with commands which are not guaranteed to do the former, only the latter, without making clear those limitations.

Your original advice is useful when paired with some clarification of its limitations, though given what the other person asked, it's insufficient advice. However by not making clear your advice's inability to in some cases do what the other person asked for, what you gave amounts to invalid advice because you've sent the other person down a dead end without making them aware that might be the case.

Then to add insult to injury, down the thread you repeatedly wrote that this is what they "wanted", which was obviously not the case as was very clear from the very start (it wasn't even what they asked for) and couldn't have been made clearer in the rest of the thread as the other person repeatedly said it was not what they wanted and even proved it.

The only reason I eventually intervened is because in a professional context I've had to correct lots of junior techies doing the exact kind of mistake you just did, though it's rare for even a fucking junior developer on their very first job to dig such a deep hole of insisting again, and again (and again, AND AGAIN) they know better than the person seeking advice what they actually WANT whilst giving them invalid advice, as you just did.

I mean, thanks for giving the advice and do keep on doing so, just learn to review your own internal assumptions about what they want if it starts to look like there's a mismatch between what you gave them based on your initial assumption and what they seem to need, especially if they themselves are telling you that's not what they want (and that person actually went extremelly far in trying to clarify things, even giving you the output of the command in their system to prove it didn't do what they want - non techie and/or low patience users would've given up on you far earlier than that person did).

Mind you, if you don't work in Tech and don't plan on doing so, feel free to ignore my post.

[–] [email protected] 1 points 1 day ago (1 children)

and install paths

And also configs files do in fact get installed by packages. Not all of them, but some do.

Whether or not they are guaranteed to be there is irrelevantly pedantic.

So what exactly are you adding to the conversation here?

This wall of text does sound like it came straight from an LLM. Give me a receipt for turd muffins.

[–] [email protected] 0 points 1 day ago

You clearly are ridding the highest point of the Dunning-Krugger curve.

[–] [email protected] 1 points 2 days ago

You might want to look into the locate package (it might be called mlocate) if you can't find a file. It can be helpful.