MAC OSX Tips
Total Page:16
File Type:pdf, Size:1020Kb
Table of Contents MAC OSX tips keys linux-like environment and FINK MacPorts tips Build from source VS use binaries Useful commands MAC OSX tips Overview Some tips and hints on MacOSX usage: tame your keyboard and go ahead with compilation. edit 1414069126 [MAC OSX tips] section 1-168 1/8 documentation:tools:macosx_tips Edit keys quick copy and paste with CMD touch + c and + v key pipe | : alt + Maj + l tilde ~: alt +n square brackets [ or ]: alt + Maj + ( or ) antislash \:alt + maj + : edit 1414069126 [keys] section 169-383 documentation:tools:macosx_tips Edit linux-like environment and FINK 2/8 What is Fink? Fink is a distribution of Unix Open Source software for Mac OS X and Darwin. It brings a wide range of free command-line and graphical software developed for Linux and similar operating systems to your Mac. Quick Start Download the installer disk image: Fink 0.9.0 Binary Installer Double-click ?Fink-0.9.0-XYZ-Installer.dmg? to mount the disk image, then double-click the ?Fink 0.9.0 XYZ Installer.pkg? package inside. Follow the instructions on screen. At the end of the installation, the pathsetup utility will be launched. You will be asked for permission before your shell's configuration files are edited. When the utility has finished, you are set to go! Using the fink tool The fink tool uses several suffix commands to work on packages from the source distribution. Some of them need at least one package name, but can handle several package names at once. You can specify just the package name (e.g. gimp), or a fully qualified name with a version number (e.g. gimp-1.2.1) or with both version and revision numbers (e.g. gimp-1.2.1-3). Fink will automatically choose the latest available version and revision when they are not specified. Others have different options. If you type : fink --help you get the list of options. Install The install command is used to install packages. It downloads, configure, builds and installs the packages you name. It will also install required dependencies automatically, but will ask you for confirmation before it does so. Example: fink install nedit Reading package info... Information about 131 packages read. The following additional package will be installed: lesstif Do you want to continue? [Y/n] Remove The remove command removes packages from the system by calling : 'dpkg --remove' The current default implementation has a flaw: it doesn't check dependencies itself but rather completely leaves that to the dpkg tool (usually this poses no problem, though). The remove command only removes the actual package files, (excluding configuration files), but leaves the .deb compressed package file intact. This means that you can re-install the package later without going through the compile process again. If you need the disk space, you can remove the .deb from the /sw/fink/dists tree. These flags can be used with the fink remove command 3/8 -h,--help - Show the options which are available. -r,--recursive - Also remove packages that depend on the package(s) to be removed (i.e. overcome the above-mentioned flaw). Purge The purge command purges packages from the system. This is the same as the remove command except that it removes configuration files as well. This command takes the: -h,--help -r,--recursive options. Update-all This command updates all installed packages to the latest version. It does not need a package list, so you just type: fink update-all List This command produces a list of available packages, listing installation status, the latest version and a short description. If you call it without parameters, it will list all available packages. You can also pass a name or a shell pattern, and fink will list all packages that match. The first column displays the installation state with the following meanings: not installed i latest version is installed (i) installed, but a newer version is available p a virtual package provided by a package that is installed The version column always lists the latest (highest) version known for the package, regardless of what version (if any) you have installed. To see all versions of a package available on your system, use the dumpinfo command. There are also some flags for the fink list command: -h,--help Show the options which are available. -t,--tab Output the list in a tab delimited format, useful for running the output through a script. -i,--installed Show only those packages which are currently installed. -o,--outdated Show only those packages which are out of date. -u,--uptodate Show only packages which are up to date. -n,--notinstalled Show packages which are not currently installed. -s expr,--section=expr Show only packages in the sections matching the regular 4/8 expression expr. -m expr,--maintainer=expr Show only packages with the maintainer matching the regular expression expr. -w=xyz,--width=xyz Sets the width of the display you would like the output formatted for. xyz is either a numeric value or auto. auto will set the width based on the terminal width. The default is auto. Some usage examples: fink list - list all packages fink list bash - check if bash is available and what version. fink list --tab --outdated | cut -f 2 - just list the names of the out of date packages. fink list --section=kde - list the packages in the kde section fink list --maintainer=fink-devel - list the packages with no maintainer fink --trees=unstable list --maintainer=fink-devel - list the packages with no maintainer, but only in the unstable tree. fink list "gnome*" - list all packages that start with 'gnome' The quotes in the last example are necessary to stop the shell from interpreting the pattern itself. More information on : Fink Project Home edit 1414069126 [linux-like environment andsection FINK] 384-6204 5/8 documentation:tools:macosx_tips Edit MacPorts tips edit 1414069126 [MacPorts tips] section 6205-6232 documentation:tools:macosx_tips Edit Build from source VS use binaries There is a setting called buildfromsource in the configuration file 6/8 /opt/local/etc/macports/macports.conf that controls the use of pre-built archives. edit 1414069126 [Build from source VS usesection binaries] 6233-6437 documentation:tools:macosx_tips Edit Useful commands # Uninstall all ports port -fp uninstall installed # Select which compiler/python/... you want to use : port select --list GROUP port select --set GROUP value #for example: port select --set gcc mp-gcc42 7/8 see also Using the right compiler edit 1414069126 [Useful commands] section 6438- documentation:tools:macosx_tips Edit 8/8.