[NTLUG:Discuss] Rebuild installed packages

ntlug at thorshammer.org ntlug at thorshammer.org
Sat Dec 15 19:56:15 CST 2007


> I am, on the other hand, very interested in the solution to this issue
> and look forward to future post.

    I managed to fix this with the help of these commands:

 dpkg -S [filename] - Search installed packages for one that contains filename
 dpkg -L [package]  - List the files in the package
 aptitude reinstall [package] - Reinstall the package

    First I used the fact that each deb will list the directory for a file in it's file list. Doing a dpkg -S /usr/share/man/man1 got me a list of all packages that had that directory in them. I then fed that list of packages to dpkg -L to get the actual man page file (by grepping /usr/share/man/man1/*.gz from dpkg -L [package]). This gave me a list of all the man page files that should be in /usr/share/man/man1. I then wrote a loop that tried to ls each file and would print out the file if it could not ls it. This gave me a list of the missing man pages that I deleted. I then fed that list back through dpkg -S to get a list of packages that contain the missing man pages. I then wrote another loop that did an aptitude reinstall on each package. Man pages repaired.


> > For anyone who feels "hamstrung" by the sudo mechanism for executing commands as root, I might
> > recommend the following:
> > sudo -s

    Personally I use "sudo su -", which probably accomplishes the same thing. The only time I got burned by the sudo thing was when I changed the name for my only account without updating /etc/sudoers. I couldn't sudo with the new name and I hadn't set a root password. Luckily I rebooted using the "boot: init=/bin/sh" trick and was able to add the new username to the sudoers file.

    From that point on I just remember to set a root password and use the above sudo command when I need to type more than 2 commands as root.

Robert Thompson



More information about the Discuss mailing list