Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have inadvertently overwritten file /usr/bin/ld. How can I reinstall this file?

share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

dlocate is quite useful in this case to know for which package it came from:

$ dlocate /usr/bin/ld
binutils: /usr/bin/ld.gold
binutils: /usr/bin/ld.bfd
binutils: /usr/bin/ld
libc-bin: /usr/bin/ldd

As it can be seen above, /usr/bin/ld is available through binutils package. Hence, you should be able to get it back by reinstalling that package:

$ sudo apt-get install --reinstall binutils
share|improve this answer
    
...or one can use dpkg -S /usr/bin/ld instead of dlocate. –  arrange Dec 11 '11 at 18:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.