0

(Similar, but not identical (rpm -V reports no problems) to Reinstalling packages with missing/corrupt files)

I didn't pay attention and some RPM packages were installed with option --excludedocs in SLES 15 SP2 by mistake (actually rpm.install.excludedocs=yes was set in /etc/zypp/zypp.conf). As a consequence manual pages are missing.

Now rpm -q -s pkg reports some files as not installed, and I wonder whether there is a command that adds just the missing docs for a package, specifically not overwriting any configurations files that might have been modified. Something like the non-existing rpm -U --force --docsonly|--justdocs pkg.

U. Windl
  • 1,095
  • 7
  • 21

1 Answers1

1

You can extract the rpm archive content to a directory then copy the needed man & docs to their relative paths :

mkdir rpm_extract 
cd rpm_extract 
rpm2cpio <path_to_your_rpm>.rpm | cpio -idmv
cp -r --preserve=all  usr/share/man/* /usr/share/man
cp -r --preserve=all usr/share/doc/* /usr/share/doc
Reda Salih
  • 1,724
  • 4
  • 9
  • The tricky part is (considering online updates) that you'll have to get the RPM files first. So maybe use `zypper install --download-only package_name`, but that won't download a package that is installed already. So the better command is `zypper download package_name`. And at the end you probably want to run `zypper clean` to remove the packages downloaded before. – U. Windl Nov 18 '20 at 07:11
  • And the other thing is to "guess" the right path after download. The path may be variable depending on whether there was an update to the package or not. For example the path may be `/var/cache/zypp/packages/Basesystem_Module_15_SP2_x86_64:SLE-Module-Basesystem15-SP2-Pool/x86_64/bash-4.4-9.10.1.x86_64.rpm`. – U. Windl Nov 18 '20 at 07:20
  • Yes that's exact :) my answer was based on the title using rpm. – Reda Salih Nov 18 '20 at 11:15
  • If this helped you please don't forget to mark it as resolved. – Reda Salih Nov 18 '20 at 12:26