Installation of man/mandb for man-pages

Hello,

It would be very nice if you could install mandb from the gate. Since it is not installed from the start, and if one installs it manually even after performing a mandb -c to create/update pages almost all, if not all are still unable to man program. This is I believe due to the fact when installing all the different programs since mandb is not install they do not create associated man page directories. Please take the below for an example.

osmc@WhatDudeBox:~$ dpkg -S timedatectl
systemd: /usr/share/bash-completion/completions/timedatectl
systemd: /usr/bin/timedatectl
systemd: /usr/share/man/man1/timedatectl.1.gz
systemd: /usr/share/zsh/vendor-completions/_timedatectl
osmc@WhatDudeBox:~$ man timedatectl
No manual entry for timedatectl
See ā€˜man 7 undocumentedā€™ for help when manual pages are not available.
osmc@WhatDudeBox:~$ ls -lh /usr/share/man/man1/timedatectl.1.gz
ls: cannot access /usr/share/man/man1/timedatectl.1.gz: No such file or directory

This forces us to perform the below to get them.
sudo apt-get install --reinstall pkg

So to get all packages man pages (if they have them) do the following:
sudo dpkg --get-selections | grep -v deinstall | awk ā€˜{print $1}ā€™ > list.log
for i in $(cat list.log); do sudo apt-get install --reinstall ā€œ$iā€; done

1 Like

Currently we donā€™t include them to save space. You can find man pages online in this day and age. This might change in the future one day.

Sam

Iā€™d like to echo the request for man pages to be installed. Iā€™ve downloaded the build environment, and the necessary changes to have man pages installed amount to ~3 lines of code being changed in 2 files ā€“ Iā€™d be happy to provide if neededā€¦

Iā€™ve pulled down git repository, and Iā€™ve built my own OSMC, that DOES have the man pages installed (my changes make man-db and manpages the FIRST 2 deb packages that are installed after debootstrap when building the filesystem)ā€¦Iā€™ve had absolutely NO issue with lack of space, or other issues with the system.

In this day in age, man pages consuming < 50 MiB of space on a 4 GiB flash drive amounts to a mere 1.25% of the space. This number goes down as one uses a 8 GiB, 16 GiB, 32 GiB flash drives, etc. The point is, the argument that you need to nuke the man pages to save space is no longer valid.

Thank you for OSMC. I think having the man pages installed would make it even better!

-Ryan

1 Like

On NOOBS we just get over 1GB of space to use (before system installation)
With thumbnails, APT archives and userdata this gets very tight.

Sam

Iā€™m looking at the latest ā€˜raspbian liteā€™ image (uncompressed, it is 1.7 GiB)ā€¦The man pages only take 17 MiB of that space. Youā€™re not saving MUCH by removing /usr/share/manā€¦

Unfortunately while we only have limited space via NOOBS, we will keep the man-pages out.
Every bit of space saved matters.

While I understand that space isnā€™t a concern for your specific setup, there are many NOOBS users for whom it will be a problem.

Sam

Understood.

Would you be open to reconsidering if I could find, say 50-60 MiB of OTHER unused / unneeded packages / files ELSEWHERE in OSMC that could be removed INSTEAD of /usr/share/man?

I know I just signed up for this forum yesterday, and I certainly donā€™t intend any disrespect, etcā€¦Given that OSMC development dates back ~10 years, removing arbitrary directories (and providing no ā€˜easyā€™ way to get them back) seemed to me to be a ā€˜datedā€™ way of obtain space.

Ryan

If you can shave 60MB off the root filesystem, youā€™ll make a lot of people happy. Some may have problems though. 99.9% of our users will never need manpages. Those that do consult online manpages.

Removing other packages could lead to this very same post requesting us reinstating something that a user believes should be included. This is slightly ironic.

If you have a proposal to make them installable on demand or want to package them up then we can accept a PR.

The OSMC project was only founded just over three years ago
First stable release was just two years ago.

Sam

I stand correctedā€¦ I saw your blog post ā€œSaying ā€˜good byeā€™ to Apple TVā€ that said ā€˜For almost ten years, weā€™ve been supporting the 1st generation AppleTVā€¦ā€™ and (I know I should never) assumed that you were referring ot OSMCā€¦

Ryan

I wish I had more time to try help regarding this matter. Would contacting NOOB to maybe alter there formatting scheme help to pull weight on this? Iā€™ve only setup a few OSMC boxes mostly for family as Iā€™ve always run RetroPie w/ Kodi installed to stream. But wanted a dedicated Pi instead of using my handmade game boy with the case open for this. I, unfortunately, donā€™t have the time/knowledge at this time to review how theyā€™re made like you did yourself eyeDoc2020 made your own. But 1GB seems ridiculously small. I mean 16GB card costs ~$10 from Microcenter, leaving us with such a small space is kinda dumb in 2017.

We set the partition size for rootfs in NOOBS.

But we have to be considerate and keep in mind that users will install other distributions.

It may be time to revisit as the default NOOBs card has increased in size.

Hereā€™s, more or less, how I did itā€¦

  1. Installed Virtual Box on my 64-bit Windows 10 Pro box.

  2. Created & installed Debian Jessie x64 in a Virtual Box machine. I think I allocated 32GB disk space for the system. I went ā€˜old-schoolā€™ and didnā€™t install ANY desktop environment, only added sshd.

  3. Logged into the Debian Jessie box.

  4. Followed the directions on the OSMC wiki to replicate the osmc git repository:

$ sudo apt-get update
$ sudo apt-get install build-essential git
$ git clone GitHub - osmc/osmc: OSMC (Open Source Media Center) is a free and open source media center distribution
$ cd osmc

  1. Building an Raspberry Pi image of OSMC that one can ā€œddā€ onto a flash card is done in 2 steps. The first step is to build the filesystem tarball. The second step is to copy that tarball to the installer directory and have it create the OSMC imageā€¦

  2. Changes to add / prevent man pages from being removedā€¦

  • edit scripts/common.sh. On my version, I REMOVED line 125, which says:

rm -rf ${1}/usr/share/man/*

  • edit osmc/filesystem/osmc-rbp2-filesystem/build.sh. On my version, line 69 says:

echo -e ā€œInstalling core packagesā€

I inserted the following 2 lines starting on line 70:

chroot ${DIR} apt-get -y install --no-install-recommends man-db manpages
verify_action

  1. Build the filesystem:

$ cd filesystem/osmc-rbp2-filesystem
$ make

This will produce osmc-rbp2-filesystem-<currentdate>.tar.xz that is used in the next step to create the image youā€™ll dd to your flash driveā€¦

  1. Build the image:

$cd ā€¦/ā€¦/installer/target
$cp ā€¦/ā€¦/filesystem/osmc-rbp2-filesystem/osmc-rbp2-filesystem-<currentdate>.tar.xz ./filesystem.tar.xz
$ make

  1. This will take a while (my system took ~45 minutes), and will produce the OSMC image in the ./buildroot-2014.05/output/images directory. Simply use the OSMC_TGT_rbp2_<currentdate>.img.gz file to create the SD card for your device.

That got me a working card with all man pages in tact, so I moved forward with USING the pi device.

Granted there may be 10 people who CARE about this, but it does more closely mirror a debian release with man pages installedā€¦Just my $0.02ā€¦

In order to preserve space on NOOBS, the code to remove the man-db, manpages packages, as well as remove /usr/share/man could be moved to the installer/noobs part of the build system?

Thank very much for the steps eyeDoc2020! Iā€™ll have to get this a shot sometime soon after my LPIC certs.

One small issueā€¦On the resulting image that is built, it doesnā€™t appear EVERYTHING workedā€¦

On boot, I am getting the following message:

Failed to start Disk Manager (legacy version).
See ā€˜systemctl status udisks.serviceā€™ for details

A quick google search leads me to believe that my build has parts of the system ā€œout of syncā€, and none of the suggested ā€œrecipesā€ to fix this appears to be working on the resulting buildā€¦

Is this an easy fix that I canā€™t find, or did I do something wrong in my build steps?

Edit: Never mind. I fixed this by changing /etc/apt/sources.list to use jessie-devel, did a apt update; apt dist-upgrade; and it appears to have fixed the issue (after, I changes /etc/apt/sources.list to use jessie again)ā€¦

Perhaps for the devices with larger default storage, the man pages could be installed. I know this would require multiple images for the same product line, but after that, itā€™s just Debian-style updates, which means if you have the man pages already, youā€™ll get updated ones, and if you donā€™t, you wonā€™t.

Either that, or on the OOB setup for OSMC, you could add a step to optionally install the man pages using the ā€œapt-get install --reinstallā€ method. It could run in the background, and by the time the user gets to an SSH login, they would be there.

That is a great idea. However, the way that the OSMC filesystem is created, there is a ā€œclean-upā€ function that removes ā€œunnecessaryā€ files before creating the tar file that the installer uses to create an OSMC installation image. Anyway, after the filesystem is built, the man pages for all the currently installed DEB packages are arbitrarily eradicated using the ā€œrm -rf /usr/share/man/*ā€ command. Thus, there is no easy way to get them back (short of reinstalling all DEBs that contain man pages).

@sam_nazarko if the man pages are removed using a simple rm -rf then could there not be a dummy package made available which simply downloaded a tar.gz file of the contents of that directory for the default packages and put them back in the appropriate place?

That would allow a one line installation for those who want them and still maintain the space for those who do not. It would be much easier than reinstalling every .deb to get manpages back.

It would have to install man itself as well.

man can be installed by the user anyway with a simple apt-get, the issue is getting the pages that are removed back without having to reinstall every package.