Emerge must run with absolute path, for example:
/usr/bin/emerge dos2unix
If you get:
!!! Repository 'x-portage' is missing masters attribute in '/usr/portage/metadata/layout.conf'
!!! Set 'masters = gentoo' in this file for future compatibility
setlocale: unsupported locale setting
!!! /etc/portage/make.profile is not a symlink and will probably prevent most merges.
!!! It should point into a profile within /usr/portage/profiles/
!!! (You can safely ignore this message when syncing. It's harmless.)
!!! Your current profile is invalid. If you have just changed your profile
!!! configuration, you should revert back to the previous configuration.
!!! Allowed actions are limited to --help, --info, --search, --sync, and
!!! --version.
You must first run:
/usr/bin/emerge --sync
Then again your emerge:
/usr/bin/emerge dos2unix