I killed ports, how to repair?

Let me be clear here what happened.

Somehow, the /usr/local/lib folder got erased during a hard drive failure (RAID-5 ftw), and caused a system blank. I just restored the OS to the point where I can log in, but don't have full system backups. I only backed up the important files (www data, mysql databases, etc.)

Now, my question is, that pkg_info still shows the list of packages it thinks are installed. However, some are missing files.

Example:
pkg_info says that apache 2.2.16 is installed
Try to make install in /usr/ports/www/apache22
Get an error that says it thinks apache is already installed, but can't continue because files are missing.

So is it possible, for portsnap to go check which files are missing from installs, and reinstall my missing files?
 
Code:
checking for C compiler default output file name... configure: error: C compiler cannot create executables

Does anyone know of a way to fix this? I cannot even reinstall anything. I have tried getting gcc clang binutils by using pkg_add but still no success (version mismatches etc.).

I have some jails that are still working, however still unsure what broke and when. Maybe I can just update my jail and just copy all the files over onto root install?
 
if you can pkg_info then simply redirect it to a file. Then delete your ports (I believe the command is pkg_deinstall or pkg_delete -a or * ).

Then view the file and install all the ports that you had before.
 
I was not wanting to have rebuild everything from scratch again I just lose to many program settings. What is the exact package/port/location for the C compiler? I can not seem to remove binutils or update it.

Code:
pkg_delete: no such package 'binutils' installed

Code:
The newest available package (binutils-2.22)
       is older than the version in ports (binutils-2.22_1)

I might just try and build my own package from jail to suit installed dependencies I have installed
or I might just try my coping files from updated jail as I am pretty sure its a corrupted file and not a setting.

(fsck ran a few weeks back due to power failure but I am sure I compiled something after wards)

The only other thing I had done since was play around with wifi settings and try and get ELF working with SVR4 but the FreeBSD 9 kernel didn't want to build with its setting so no changes were ever made.

*edit*

I ran a hash check to see if I could find a problem

Code:
freebsd-update -r 9 IDS
Code:
/usr/libexec/cc1 has SHA256 hash 58a4b2316d6ee8e1f27c622a71958079443ac2f118e9428509291b0e79e3e70c, but should have SHA256 hash 40a6a26db513e7c3d130e24a9a49e2306252e2c27a7b3563b24675378b692d9d.

It looks like that was indeed my problem

Thankfully I had a jail with good files /usr/libexec/ folder was indeed corrupted overwritten files and compiling started working again

now to run a full update / rebuild of everything to make sure its all 100% again

Anyhow thanks for the reply.
 
In such case, I'd use either # portmaster -af, either
# foreach pkg (`ls /var/db/pkg`); pkg_delete $pkg; end && sh ~/install-everything.sh
also, pkg_info is pretty slow and in case when you need only package names, # ls /var/db/pkg serves better.
 
There is a faster way to rebuild all ports at the end of the portmaster man page. But with the compiler executable being corrupted, there are some lower-level worries to address first.
 
I ran cvsup I noticed it repaired a few more things. I am still unsure how cvsup was deinstalled yet again and because I could not build any ports I had no way to get it back on until the compiler issue was solved. The HDD tests fine (500 gig USB) .

I was using portmanager to rebuild ports I will use the portmaster method next time. fsck seems to always mess things up for me. Even if system is cleanly shutdown it thinks it was not (assuming it because its USB).

Lately I have been doing a ZFS snapshot daily so if fsck does run on the array I can just revert to snapshot prior to fsck touching it.

Thanks for the portmaster method.
 
MasterCATZ said:
I ran cvsup I noticed it repaired a few more things. I am still unsure how cvsup was deinstalled yet again and because I could not build any ports I had no way to get it back on until the compiler issue was solved. The HDD tests fine (500 gig USB) .

Don't use cvsup, it was made obsolete years ago. csup(1) is the current version. It does not check for problems, it makes sure your local copy of the ports tree is up to date. It does not compare that with what has been installed.

fsck seems to always mess things up for me. Even if system is cleanly shutdown it thinks it was not (assuming it because its USB).

Something is really wrong there. Please start new, appropriately-titled threads to address these problems.
 
Back
Top