man -k never works. There is a substantial and useful part of the core unix help system that seems to be missing from the standard distro.
Can't we just lift the man database right out of slackware or something?
I'm not sure what you mean. Either:
You installed something but the man database isn't updated so man -k isn't showing up any results:
sudo mandb
(Yes root access is required.)
Or manpages are not included in the installation in some programs.
If this then I'm going to assume that this post is for the Artix devs.
for the latter a good example might be:
7zip has no manpages, but p7zip has.
pacman -Fl 7zip | grep 'usr/share/man'
vs
pacman -Fl p7zip | grep 'usr/share/man'
edit: p7zip is only within the omniverse repo
I am not sure how I produced confusion. I appologize.
There is a man pacman for man-pages
flatbush:[ruben]:~$ sudo pacman -Ss man-pages
system/man-pages 6.14-1 [installed]
Linux man pages
and one for a great many languages.
But it is common to use
man -k
that database is empty and highly useful when one wants to explore different tools.
BTW - THIS
sudo mandb
Does fix the problem but this should work out of the box without intervention. Thank you for the tip.
That's debatable.
Prior to the introduction of systemd Arch (AFAIKT) did no automatic updating of mandb. Then with systemd they started using a timer service to update mandb daily. Briefly, in 2016, they switched to a pacman hook (probably because they'd just created pacman hooks and wanted to use them?) before reverting back to the timer (https://gitlab.archlinux.org/archlinux/packaging/packages/man-db/-/commit/3c15b0614a4dd84f2e486f936b2ae76af10822a0)
It could be argued that as an Arch derived distro Artix should mirror Arch's behaviour in updating the mandb periodically or use pacman hooks to do so.
It could also be argued that as an Arch based distro without systemd Artix is simply doing what Arch did before systemd i.e. nothing (caveat 'I think').
If you want your mandb bang up to date after every upgrade a hook in /etc/pacman.d/hooks is probably the way to go.
This will of course slow down the process.
I did not know any of this until just now so I thank you for that.
@mrbrklyn As what Gripped said it's done with soystemd these days and the alternative is that a pacman hook can be set.
Another way of this is to automate this with a daily cron job.
https://wiki.archlinux.org/title/Cron
If you are unaware it's a program that runs programs/scripts repeatedly on a set schedule (every minute, hourly, daily, weekly, monthly, yearly, or a custom schedule like every 1pm, 9pm of every other week in every 2 months for example.)
If the wiki is confusing (for me it is), this is also a good source: https://www.youtube.com/watch?v=7cbP7fzn0D8
This has nothing to do with systemd. Man pages has been a core part of Unix systems since the inception at AT&T (actually I don't know that but I am guessing since it has been taught to me to use them since 1994 or so). If you want to know how sound works, you can run
man -k sound
It is a core part of the unix design How it is implement is a design decision. Not having it implemented at all, that is an error in judgement.
or if you code
man -k printf
To get history right, 'man' is a core piece of old UNIX, while 'man -k' for accessing the database is not quite so.
See for instance man page for man from 7th Ed UNIX (https://man.freebsd.org/cgi/man.cgi?query=man&apropos=0&sektion=0&manpath=Unix+Seventh+Edition&arch=default&format=html), where '-k' does something very different. (Yes, I know that's from 46 years ago. But still. That's oldcore UNIX!)
I for one use 'man' a lot, 'man -k' never. So for me building the database would be a waste of resources. I say let those who want it generate it. I'm not arguing that it wouldn't be a good functionality. I'm sure it is. But not everybody needs it.
Okey-doke.
You can lead a horse to water but you can't make him think....
Neee Neee
Why do cows have bells?
man man
But it does:
On the first sentence in the Cron arch page link I gave above:
I looked into their gitlab site, but I can't find anything that's too old.
In the forums there seems to be implications that Cron was used in tandem with mandb.
https://bbs.archlinux.org/viewtopic.php?id=93244
and it seems to solidify (not conclusive but good enough) gripped's assumption of:
https://bbs.archlinux.org/viewtopic.php?pid=616805#p616805
Checked in my kvm endeavouros:
cat /usr/lib/systemd/system/timers.target.wants/man-db.timer
[Unit]
Description=Daily man-db regeneration
Documentation=man:mandb(8)
[Timer]
OnCalendar=daily
RandomizedDelaySec=12h
Persistent=true
[Install]
WantedBy=timers.target
To understand, in what you're really implying for is that Artix should have already installed Cron by default or something similar that would automate mandb?
I have never seen a working distro since the early 1990s and before without a working man and apropos
until now
You are making yourself look silly again. Just saying.
It is not silly to expect the Man Pages to work correctly out of the box. I don't even know why we are in a side conversation about systemd and the history of Arch. And I have no idea why you are making this personal.
Early Linux versions came, not only, with complete man pages, but a series of HowTo's that were critical learning tools. This was all YEARS befores Judd Vinet started Arch in March 2002. The Howtos taught about terminals, ttys, init systems, socket programming, semiphores, pipes, routing strategy, packet filtering etc etc.
The Man pages would let you find programs to tasks and syntax for core C and C++ programming, not to mention use of Make and autoconf.
If I am no mistaken, cron IS installed by default. Why would it not be? How else do you do routine timely system maintenance like rotating system logs etc?
What's silly is to have it explained how we got to where we are at with the little used 'man -k' & 'man -f' not working, unless you manually update the database, and then state "This has nothing to do with systemd". Because it's handled by systemd on Arch. Handled by nothing on Artix. To me that's a systemd involvement even if indirectly.
I wonder about this: As someone who's used Artix a long time how is it you've only just noticed that 'man -k' & 'man -f' don't work 'out of the box'? One might suspect that it's not actually a feature you use much at all? Or have you just been stewing on this for years, regularly running 'man-k', discovering it still doesn't work, but doing nothing to remedy it. Because that might also be considered a bit silly by some. Certainly by me.
Your original post was
Lift it out of Slackware ?
How about you just read the man page for man ? (bit ironic really)
man mandb
I took no position in whether or not Artix should update mandb automatically. But on consideration I think, if anything, it should be a periodic thing, not a pacman hook, as the later would introduce regular lengthening of the time taken to complete pacman upgrades and installs for a feature used by very few. A cron job would not cover everyone as no cron is installed by default on a base install.
The thread started silly and just gets sillier :)
No I noticed this right away and this might not even be the first time I asked about this. And it has been quite crippling. I am very relieved to have gotten a manual solutions and NOW I can run
man -k openrc
No I am feeling like Jim on Taxi with wild eyes and saying... OOOOHHHH
Look - it has it all!
BTW -
flatbush:[ruben]:~$ sudo pacman -Ss man|wc
4366 21896 194052
and man-db is a separate package from man-pages
So I had to do a quick check on default stable iso releases since my installation is manual (had to do a custom setup for my needs so using my setup isn't the best reference to use). I don't have cronie. I've written scripts for my automation needs.
On the stable Xfce and Plasma s6-init images. Yes cronie is installed, but no entry for mandb in crontab nor in cron.daily folder.
You'll have to take this inquiry to the Artix devs because this matter is OS default setup.
As for the Unix design you've mentioned earlier, that will have to be in another thread. I do not mind talking about it. But a different thread just to keep it organized.
Since the matter has been solved (about man -k not showing anything). There's nothing else for me to say in this matter.
My last cent for you. Just use a daily cron job to automate this. The video link I gave is really easy to absorb. There are other methods(that I can think of), but it'd require you to write a bash(with sudo mandb whitelist) or an init script (I prefer writing a script because I don't have to install cron just for mandb but is less user friendly).
Cheers.
With Debian based systems this is run on updates, possibly only when packages with man pages are updated, but that is pretty much every time. It can take a long time to run, e.g. trying here after not having run it for ages, then again to compare:
$ time sudo mandb
...
109 man subdirectories contained newer manual pages.
29798 manual pages were added.
0 stray cats were added.
482 old database entries were purged.
real 0m28.751s
user 0m0.097s
sys 0m0.092s
$ time sudo mandb
...
0 man subdirectories contained newer manual pages.
0 manual pages were added.
0 stray cats were added.
0 old database entries were purged.
real 0m0.606s
user 0m0.022s
sys 0m0.022s
So it can potentially slow down updates quite a bit. I run it manually before using man -k which I rarely do, although admittedly it's something I only found out about after a few years of using Artix. As mandb is only needed if the man pages are changed, a cron job seems inefficient, and man -k wouldn't give the correct results until the next day if you installed new or updated packages just after it had completed it's daily run. Perhaps there should be some mention of mandb in the Artix wiki under installation or configuration, as there doesn't seem to be at present?
Unless the index only goes back so far Search suggests this is the first time you posted about man pages, at least on this site.
If it was crippling for years I fail to understand why you wouldn't a. read the man page for man & b. just ask ?
I'm glad you have it working now. I also thanked you already because I learnt something I didn't know. But I'll thank you again.
But I do think you could be a little bit more gracious when someone takes the time to explain why something isn't working as expected and gives a possible way to remedy it
Ah - I am sorry if I didn't seem gracious. Thank you for your diligence and help.
I uninstall cron first thing.