I have:
$ /Applications/Emacs.app/Contents/MacOS/Emacs --version
GNU Emacs 24.3.1
$ /usr/bin/emacs --version
GNU Emacs 22.1.1
How do I get rid of the second installation of Emacs?
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.
Sign up to join this communityI have:
$ /Applications/Emacs.app/Contents/MacOS/Emacs --version
GNU Emacs 24.3.1
$ /usr/bin/emacs --version
GNU Emacs 22.1.1
How do I get rid of the second installation of Emacs?
The second emacs
came with OS X. For files that are logged in the package database, you can use pkgutil
:
$ pkgutil --file-info /usr/bin/emacs
volume: /
path: /usr/bin/emacs
pkgid: com.apple.pkg.BSD
pkg-version: 10.9.0.1.1.1306847324
install-time: 1382483268
uid: 0
gid: 0
mode: 555
A list of packages can be obtained via pkgutil --packages
. However, note that—again—this only covers items in the package database.
You should not modify items that are part of the core operating system. If you prefer a locally-installed program to override one that came with the operating system, you should adjust your PATH
to prefer that program before system paths such as /usr/bin
are checked.
One way to do this is to have /usr/local/bin
be first in your path and link your /Applications
version of emacs to /usr/local/bin
so that it will be called first unless a program explicitly calls /usr/bin/emacs
The file /usr/bin/emacs
is installed as part of Mac OS X. It is generally not a good idea to change or modify files that are installed as part of the default OS installation; other programs can rely on their presence.
Utilities installed as part of the operating system can be invoked by other programs with the expectation that the version installed will match the operating system spec. Removing them or replacing them with a different version could cause other programs to fail to operate as designed.
/usr/bin/emac
with a symlink to /Applications/Emacs.app/Contents/MacOS/Emacs
, right?
PATH
to prefer your Emacs.app
version instead.
/usr/bin/emacs
to invoke the default version. You can safely install your own programs in /usr/local/bin
. If you want your own programs to preempt the system versions, make sure /usr/local/bin
is earlier in your path than /usr/bin
and /bin
, but be warned that this creates a security hole if someone with admin privileges on your system installs a /usr/local/bin
version of some other program with unexpected results.