shell - Installed package does not been used by system because existing package in different path -


situation

i using zsh (oh-my-zsh).

homebrew install new packages @ /usr/local/bin/, however, packages preinstalled on mac os, git, vim, emacs.

when installed lastest version of these program using brew, newly installed program never used becuase existing 1 located @ /usr/bin has higher precedence.

my current solution manually delete old version of program in /usr/local/bin/ , newly installed program works.

question

is there way set program installed using brew execute first before preinstalled program?

providing suggestions , references on package control on mac os appreciated.

answer

@tripleee provides working solution below accepted answer.

note: in case not have .zlogin file can create using

$ touch .zlogin 

and use favoirte edito add path .zlogin file.

$ brew doctor 

can rest of things you.

you can modify own personal path own heart's content. simple fix add

path=/usr/local/bin:$path 

to .bash_login, .zlogin (for zsh) or similar.

having second copy of /usr/local/bin later in path , large harmless, if like, can fix with

path=/usr/local/bin:${path//:\/usr\/local\/bin:/:} 

instead. (if comes last, need remove pair of colons.)

removing stuff /usr/bin extremely risky practice. don't that.


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -