Are you typing the dollar sign? Because if you are, that explains the problem. '$sudo' would be a variable, and it is apparently empty, so the end result is ' yum update' which then results in the permission error. Whenever you see
it means that you should type the command in as a non-root user. You do NOT type the dollar sign. Similarly, when you see
it means that you need to run the command as the ROOT user. Prefixing the command with sudo usually takes care of this. Again, you do NOT type the pound/hashtag symbol. In this case, it would treat it as a comment, since that symbol indicates a comment in bash.