0

It seems that I've removed head manually from my /usr/bin/ a couple of months ago. Now that I chance to need it I don't have it. How do I reinstall it without reinstalling the whole distro? My environment: Ubuntu 20.04 LTS Desktop.

2
10

You can re-install head by re-installing the package which contains it; from a terminal window, run

sudo apt reinstall coreutils

(In older versions of apt, pre-1.8.0~rc1, run sudo apt install --reinstall coreutils instead.)

You can determine which package is involved by running

dpkg -S bin/head
2
  • I was going to suggest packages.ubuntu.com as another option. However, for some reason, the "packages that contain files named like this" search doesn't find anything with the keyword "/usr/bin/head", but gives exactly that file if I search for "/bin/head" instead... (??)
    – ilkkachu
    Sep 27 at 14:37
  • @ilkkachu right, files are moving around with the /usr merge, it’s safer to look for bin/head. Sep 27 at 14:38

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