How to make Apple X11 the default X11 app? - macos

I have OS X mavericks. Yesterday I installed xQuartz but then decided that I want to make Apple's X11 the default X11 eninronemnt. I check the website of xQuartz where it said I should run the following commands:
(XQuartz.app) launchctl unload -w /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
(Apple's X11.app) launchctl unload -w /System/Library/LaunchAgents/org.x.startx.plist
(MacPorts' X11.app) launchctl unload -w /Library/LaunchAgents/org.macports.startx.plist
The first command runs correctly, but the last two gives me that there's no such file or directory error. So now how can I make Apple's X11 the default?!

From XQuartz's faq:
Uninstall (Snow Leopard or Later)
XQuartz does not replace the system X11 on Snow Leopard, so you can go
back to the Apple-provided X11.app rather easily. Just launch X11.app
rather than XQuartz.app to get the older server. If you want to make
Apple's X11.app the default server (owning the launchd $DISPLAY
socket), then you should disable the
org.macosforge.xquartz.startx.plist as described in the first
question. After logging out and back in, Apple's X11.app will be
default. If you still want to remove XQuartz.app from your system, you
can do that with these two steps:
launchctl unload /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
sudo launchctl unload /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist
sudo rm -rf /opt/X11* /Library/Launch*/org.macosforge.xquartz.* /Applications/Utilities/XQuartz.app /etc/*paths.d/*XQuartz
sudo pkgutil --forget org.macosforge.xquartz.pkg
Please file a bug report
to let us know why you reverted to the system X11.app, so we can
address the problem in a future release.

Apple's X11 is no longer supported in Mavericks. You can run it but it may not work. Only xQuartz has been updated and supported up to Mavericks. The old apple's x11 no longer comes with the operating system. As a matter of fact, you can't install it unless you have access to an old install disk or obtain the file from someone else. Apple even suggests to install XQuartz instead. So unless you managed to install apple's old x11 by hand, that file shouldn't exist.

Related

Unistall Vim Mac Os High Sierra 10.13.6

I don't know why I ever wanted to install it on my machine.
Please can someone help me unistall it?
Haven't found anywhere tips or resources on how to do that.
I have Homebrew installed and I have already tried
brew uninstall --force vim
and
brew uninstall macvim
brew installs software in /usr/local/bin/.
In /usr/bin (since OS X El Capitan) you can only find applications that have been shipped with macOS itself, so /usr/bin/vim is part of the system and can't be uninstalled.
Tools like brew or macports should use /usr/local or /opt to prefix their installation paths.
The whole /usr directory except /usr/local is under Integrity Protection, which means that you cannot change its content even with sudo.
[...]System Integrity Protection is designed to allow modification of these protected parts only by processes that are signed by Apple and have special entitlements to write to system files, such as Apple software updates and Apple installers.[...]
System Integrity Protection includes protection for these parts of the system:
/System
/usr
/bin
/sbin
Apps that are pre-installed with OS X
Paths and apps that third-party apps and installers can continue to write to include:
/Applications
/Library
/usr/local
I don't know why I ever wanted to install it on my machine.
Well, it was already there so yeah, why did you install another one?
Please can someone help me unistall it?
We certainly can… if you tell us how you installed it as the exact method will be different if you installed it from source, via MacPorts, via homebrew, or any another method. If you even installed it, that is.
FWIW, Vim has always been installed at /usr/bin/vim on Mac OS X since forever. If $ ls -l /usr/bin/vim ends with /usr/bin/vim you can stop worrying now as your system is pretty much OK. If not, show us the whole line so that we can go further.

How to install gdb on MacOS terminal Sierra

I searched online about how to install gdb on macOS Sierra 10.12.2 but failed on the methods I could find. Then I figure out the following way which is easy and works fine on my machine. hope it may help you too:)
download the most recent GDB from https://www.sourceware.org/gdb/download/
expand the gdb-7.12.1.tar.xz file: tar xopf gdb-7.12.1.tar.xz
cd gdb-7.12.1 in terminal to open the gdb folder
then follow the instructions in the README file in the gdb folder, or simply follow the following steps:
./configure, wait for the terminal
make and wait again (which can take some time)
sudo make install
Now gdb is installed at /usr/local/bin/
Note that you might want to try/use LLDB (lldb) instead. This is now the default (don't know about 10.12, but on 10.13 it is installed, when you install the Xcode utilities). It even comes with a nice curses GUI, but otherwise a shell very similar to GDB.
You can also use homebrew to get gdb in mac os:
install-gdb-macos-sierra
Surprised no one mentioned:
brew install gdb
How to install brew?

Glut Error on Mac with Haskell Program

I am trying to run a Haskell program which has to use GLUT (to draw shapes) but I get this error message :
*** Exception: user error (unknown GLUT entry glutSetOption)
My program works and GLUT lauches when I run it on Linux
So I only get this problem from my Mac..
As user2141650 suggested in a comment, this seems to be caused by a discrepancy between the default macOS GLUT and freeGLUT. Since version 2.7.0.12, Haskell GLUT automatically picks freeGLUT if it's installed. Here's how I managed to install freeGLUT:
Install XQuartz:
brew cask install xquartz or
install the .dmg from xquartz.org.
brew install freeglut
After I installed XQuartz and freeGLUT with brew, my program still couldn't open the display. As suggested in this Reddit thread, I did the following:
launchctl load -w /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
restarted my computer
Maybe the launchctl command would have been enough, or maybe restarting the computer would have done it, or maybe all that isn't necessary if you install XQuarts using the .dmg file. I don't know. Good luck!

confused about macports

I am using MacBook Pro Mac OS 10.5 with related version of XCode. I am new to this development environment. I am learning macports, and I read information about macports from http://www.macports.org/. But I am still confused what macports is after reading information from this site.
I am previous working on Windows and Linux, could anyone let me know what macports is (in easy words) and what is the similar item on Windows/Linux?
thanks in avdance,
George
macports is a way of getting executables and other compiled code installed on your computer without having to work out the details of compiling/linking each apllication.
It is equivalent to a package manager under Linux and other Unicies. There is no direct equivalent under Windows.
It is just a convenient way to install a lot of *nix soft on your mac book. They are installed separately (not overwriting) from binaries/daemons/libs already installed on your mac (by default in folder /opl/local). Also they are much fresher than those installed on your mac.
For example 10.6 ships with bash 3.2, but after running sudo port install bash, you will get version 4.x (to make it your default shell add /opt/local/bin/bash to file /private/etc/shells, run chsh -s /opt/local/bin/bash and reopen terminal).
Note other os x package managers: fink and homebrew (superuser question)

QtCreator - Debugging as superuser on Mac OS

I'd like to debug an application in QtCreator on Mac OS which reads directly from hard disk (/dev/rdisk0). If I run this app from Terminal using sudo ./MyApp, it's working, however when I debugging it under QtCreator, it fails due to lack of permissions.
I tried to launch QtCreator itself from terminal using "sudo open QtCreator.app", but it didn't help.
Please suggest how to get around it.
Serge.
Assuming you installed QtCreator into /Developer/Applications, you probably have to do:
sudo /Developer/Applications/Qt/QtCreator.app/Contents/MacOS/QtCreator
If QtCreator is a Carbon application, then you might need to execute:
sudo -b /System/Library/Frameworks/Carbon.framework/Versions/Current/Support/LaunchCFMApp /Developer/Applications/Qt/QtCreator.app
See also: Open GUI applications as root - Mac Forums.

Resources