I don't use Ubuntu so I don't know the command to install the glibc-source package. For agrep have you tried running
which grep in a terminal window to see if it exists (maybe as a symlink to agrep)? There's also the
LFS Live CD which contains everything you need, so you could do it that way.