To avoid using sudo when installing packages, change the owner recursively on /usr/local directory: sudo chown -R `whoami` /usr/local