I installed the g2 graphical library on my mac using the terminal for a school assignment and now that I'm done with it I'd like to know how to remove it. Are there like commands I can run on the terminal? Are all the files in one folder and all I have to do is delete that folder?

I'm very picky when it comes to these things and if I can't delete it I'll probably end up reinstalling the whole OS (I know I'm crazy) so any help is appreciated.

Also if this is not the right place to post this question I'd appreciate it if you could point me in the right direction.

Thank you!

EDIT 1: I installed the library by following these instructions:

  1. Extract package with gzip -dc g2-xxxx.tar.gz | tar xvf -

  2. Run './configure'

  3. Run 'make depend'

  4. Optionally edit src/g2_config.h to fine-tune g2 behavior (only if you know what are you doing)

  5. Run 'make'

  6. Run 'make install' or copy libg2.a and g2.h, g2_X11.h, g2_gd.h, and g2_PS.h to the default locations for library and include files.

  7. cd to demo directory and run 'make demo' to compile demo applications

  8. To rebuild documentation run 'make doc' (html, PS and pdf manual should be already included into documentation).

EDIT 2: I ran the command suggested by @scottishwildcat in his answer below and got the following output:

Makefile:101: warning: overriding commands for target `libg2.so'

Makefile:98: warning: ignoring old commands for target `libg2.so'

make: *** No rule to make target `uninstall'. Stop.

  • 1
    How did you install it? From a .pkg file? By compiling the source code? It's hard to give the best answer without that information.
    – calum_b
    Commented Nov 29, 2016 at 18:09
  • 1
    @scottishwildcat I'll update the question, I'm not really that tech savvy when it comes to these things.
    – Pedro
    Commented Nov 29, 2016 at 18:15
  • @Pedro Did you also install png/perl support or only the plain g2 libs?
    – klanomath
    Commented Nov 29, 2016 at 18:20
  • @klanomath I honestly have no idea, all I did was follow the above instructions. Oh, and I also installed Code::Blocks at which point I installed the command line tools for Xcode found in the app store.
    – Pedro
    Commented Nov 29, 2016 at 18:24

2 Answers 2


First off, there's likely no harm in leaving the library installed on your system. It doesn't consume any processor or memory resources by itself (though it does take up some small amount of disk storage space).

My assumption is that you've installed the g2 library into default locations. According to the g2 website, the following files were installed:

  • libg2.a (may be called libg2.so or libg2.dylib on your particular flavor of OS)
  • g2.h
  • g2_X11.h
  • g2_GIF.h
  • g2_PS.h

The first file, the executable code, should've been installed into /usr/lib or /usr/local/lib. The rest — header files for development — should've been installed into /usr/include or /usr/local/include. To 'uninstall' the library, just delete the files in the above list from these paths.

  • I tested it in a 10.11 VM with file system monitoring and the files were installed to /usr/local/lib (libg2) and /usr/local/include (the header files) . g2_X11.h wasn't installed at all.
    – klanomath
    Commented Nov 29, 2016 at 19:18

So it sounds like you possibly downloaded the tarball from here, unzipped it, then did something like this in the terminal:

% ./configure
% make install

Does that sound about right?

If so, the 'proper' way is to go back into the terminal, navigate to the directory in which you ran 'make install', and then run:

% make uninstall

That should delete everything that the original 'make install' command installed. If you get some error messages about insufficient permissions, you may need to run 'sudo make uninstall' instead, and enter your account password when prompted.

If that works, you can then just delete everything that was created when you unzipped the original source file.

EDIT: Upon further inspection, it appears that the g2 makefiles do not include an 'uninstall' target, so unfortunately this method won't work. The only alternative I can suggest is to follow the instructions in your question up to and including the 'make install' step again... the output from that command usually lists all the files that it has created, which you can then manually delete.

  • I did as you suggested and updated the question with the terminal output.
    – Pedro
    Commented Nov 29, 2016 at 18:31
  • @Pedro Yes, sorry about that -- now that I've looked at the source files, it appears they did not include an 'uninstall' option. I've updated my answer with another suggestion.
    – calum_b
    Commented Nov 30, 2016 at 0:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .