EzDevInfo.com

macports interview questions

Top macports frequently asked interview questions

How to uninstall all unused versions of a macports package at once

When maintaining macports packages, I prefer to remove old packages when I replace them with new ones. However, over time as packages are upgraded, you end up with problems like:

$ sudo port uninstall -f postgresql83
--->  The following versions of postgresql83 are currently installed:
--->    postgresql83 @8.3.3_0
--->    postgresql83 @8.3.7_0
--->    postgresql83 @8.3.8_1 (active)
Error: port uninstall failed: Registry error: Please specify the full version as recorded in the port registry.

Is there a macports command to remove all versions of a package at once?


Source: (StackOverflow)

Homebrew vs Fink vs Macports? [closed]

I am using Fink to install Unix apps on my mac, I just came across Homebrew and saw some good reviews about Homebrew.

So, my question is:

  1. What package manager do you guys use for Mac?
  2. I use Fink currently, so will the shift from Fink to Homebrew be really worth it?
  3. If 2. is true, then why?

Source: (StackOverflow)

Advertisements

How to install software packages on a Mac? (MacPorts, Fink, anything better?)

On my Mac OS X machine, how would you recommend I install command line software and other packages? I've been using MacPorts and it always seems quite slow, presumably because it has to compile the packages on-the-fly.

I'd much prefer a package management system that has binary packages, saving me the need to compile things every time I want to download something new. I think Fink has binaries for some of the packages, but I usually see MacPorts recommended as the system to use.

Which do you think works better and why? (Or is there another system that I haven't heard of?)


Source: (StackOverflow)

How do you remove MacPorts and all the packages it has installed?

I have installed MacPorts on my Mac OS X Lion, and I would like to remove it. There should be no more trace of MacPorts?

Is there a way to do this?


Source: (StackOverflow)

Using `shred` from the command line

I need to securely erase some files. I have used shred on linux systems before, so I looked around and found that shred is part of the coreutils package in macports. I did port install coreutils to install coreutils, but I still can't find shred in the command line.

How can I get shred to work on my mac's command line? If it matters, I'm using Mac OS X 10.7.5 (Lion)


Source: (StackOverflow)

Install software using a downloaded port file

I want to install some software in Mac using 'port install software-name' but some software come with very big package and I don't have a stable connection. I want to download the port file using a download manager and then have port install the software using the downloaded file. Is it possible? How?


Source: (StackOverflow)

Is it safe to install both Homebrew and Macports on the same machine?

I have MacPorts installed on my iMac with a fair number of ports installed.

I'm interested in trying out Homebrew, though, as I've heard many good things about it, and because I've noticed that it contains more up-to-date versions of several of the tools that I use.

But can the two coexist on the same machine, or do I need to uninstall MacPorts entirely first?

Also, if the two can be installed at the same time, will they be completely independent of each other? One of the features of Homebrew is that is doesn't reinstall new versions of things which are already included in the system (e.g. python). Does this also extend to it not installing versions of things which are already maintained by MacPorts?

What happens if I then subsequently uninstall MacPorts?


Source: (StackOverflow)

How can I clean up my MacPorts installation?

Which command should I run to

  • delete all old port versions
  • delete downloaded files
  • temp files created during build
  • all other stuff which I don't need when I am sure that updated version works fine

I got a suggestion to use

port clean --all all

but it tries to clean ports I don't have, though I tried

port clean --all installed

but it did not delete old inactive versions, then

port -u uninstall

but it got stuck saying that py25-nose (which is active) depends on py25-setuptools (which is inactive).


Source: (StackOverflow)

LSOpenURLsWithRole() failes with error -10810 on Yosemite from within tmux

Trying to open an application from the commandline (Terminal.app), inside tmux (installed through MacPorts, version 1.9a), and getting the following result:

$ open /Applications/Adobe\ Reader.app/
LSOpenURLsWithRole() failed with error -10810 for the file /Applications/Adobe Reader.app.

The same command works fine, from the same terminal, if executed outside tmux.

Enviroment should be read from host; the following is in tmux.conf : set -g update-environment -r

When restarting terminal.app or tmux, it sometimes errors out with a different message at first, (see below) and when tried again, the above error -10810 is given instead.

$ open /Applications/Adobe\ Reader.app/
The window server could not be contacted.  open must be run with a user logged in at the console, either as that user or as root.

I've tried both Apples own apps (Preview, Font Book, Contacts) and third party (Adobe, Evernote etc). No difference. The one app that does seem to work, is finder. (open [dirname], for instance.)


Source: (StackOverflow)

"whereis" and "which" return different paths in Mac OS X

I've got the default OpenSSL 9.8 (Mac OS X 10.6.8) and decided to install the newest version (1.0.1) via MacPorts (sudo port install openssl).

These are console output of which and whereis commands:

$ whereis openssl
/usr/bin/openssl

(this is default system's one)

$which openssl
/opt/local/bin/openssl

(this is installed via MacPorts)

$ openssl version
OpenSSL 1.0.1c 10 May 2012

(there is mac port's version in PATH)

Why are different paths returned for whereis and which, and is this okay? Is there any way to get equal results?


Source: (StackOverflow)

Linux-like top/netstat/etc. on Mac OS X?

Unix utilities on Mac OS X are quite painful to use. port install coreutils +with_default_names and a few other such replacements fix most of them, but it leaves some in broken Mac OS X defaults - most annoyingly top and netstat, but I'm sure I could think of a few more.

I'm guessing that commands like top and netstat are quite OS specific, so just grabbing sources of their Linux equivalents and recompiling won't work.

What's the best equivalent of these and other such commands that works on Mac OS X?


Source: (StackOverflow)

macports gcc select error trying to exec i686-apple-darwin11-llvm-gcc-4.2

I am working on OS X 10.7 (Lion). I have installed gcc 4.7 from macports:

sudo port install gcc47

It seems to be working properly:

$ /opt/local/bin/gcc-mp-4.7 -v
(...)
gcc version 4.7.0 (GCC) 

Now, I am trying to change default compiler by using port select:

$ sudo port select gcc mp-gcc47
Selecting 'mp-gcc47' for 'gcc' succeeded. 'mp-gcc47' is now active.

It copies gcc binary to /opt/local/bin/gcc, which works properly:

$ /opt/local/bin/gcc -v
(...)
gcc version 4.7.0 (GCC) 

It also changes default gcc:

$ which gcc
/opt/local/bin/gcc

But running this default one does not work:

$ gcc -v
gcc-mp-4.7: error trying to exec '/opt/local/bin/i686-apple-darwin11-llvm-gcc-4.2': execvp: No such file or directory

This binary "i686-apple-darwin11-llvm-gcc-4.2" is the original Apple's provided gcc version; I don't know why it tries to look on it in /opt/local/bin, or even why it tries to run it at all. If I create symlink, it simply calls this binary, which is not what I want:

$ sudo ln -s /usr/bin/i686-apple-darwin11-llvm-gcc-4.2 /opt/local/bin
$ gcc -v
(...)
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)

How to solve it, to make gcc working properly, by simply calling "gcc"? As far as I know, there was gcc_select tool in older OS X, but my system does not have it.


Source: (StackOverflow)

Forcing Homebrew and Macports to coexist?

I have a MacOSX system that I've been using for a number of years, and during this time, I have installed quite a few packages via Macports.

I now want to try Homebrew, but it's clear from what I've read here and elsewhere that the default installations of Homebrew and Macports cannot easily coexist.

It is not a viable option for me to uninstall Macports, since so much of my daily MacOSX work involves using various Macports-installed utilities. Furthermore, many of my own, homegrown utilities are now interdependent with Macports. And finally, a lot of executables and shared libraries that I routinely use are now installed under /usr/local, and my system would quickly become unusable if I cleared out that directory tree.

So my question is this: has anyone come up with an alternate way to install Homebrew which can coexist with Macports? Specifically, has anyone figured out how to make Homebrew utilize a directory tree such as /usr/local/homebrew instead of /usr/local?

Thanks in advance for any suggestions or pointers to docs.


Source: (StackOverflow)

"sudo: port: command not found" after installing MacPorts on Snow leopard

I have attempted to install MacPorts in order to upgrade my Rails version so that I can work my way through Agile Web Development with Rails, PragProg (4th, 2011). I have followed the directions in the book, as well as on the MacPorts web site, to perform the install from disk image. It appeared to install correctly, however, running port commands afterwards returned "port: command not found".

I searched Stack Exchange and found this question, so I attempted to install from the command line using "tar xjvf MacPorts-1.9.2.tar.bz2". Again, the install seems to work. I receive the confirmation that MacPorts installed successfully, but I still receive "sudo: port: command not found" error on trying to selfupdate MacPorts (via "sudo port -v selfupdate").

I think that my error lies in not having the correct path set. I followed the advice in this thread, namely, adding a path (/opt/local) in paths.d, but I still get the error.

If it matters, terminal is set to open shells with default login shell (/usr/bin/login). Should I change this to /bin/bash?

So, is this a MacPorts issue, a $PATH issue, or a StupidUser issue?


Source: (StackOverflow)

Macport upgrade fails with subversion-perlbindings conflict

I'm trying to do a port upgrade outdated, but it stops on a package conflict that I'm not able to fix.

Does anyone know how to fix this problem?

sudo port upgrade outdated
--->  Computing dependencies for subversion-perlbindings-5.16
Error: Unable to exec port: Can't install subversion-perlbindings-5.16 because 
conflicting ports are installed: subversion-perlbindings-5.12

Source: (StackOverflow)