OS X 10.7 (Lion) and MacPorts 2.0 upgrade

So I recently upgraded to the latest release of os x 10.7 (lion) and i have a few issues with lion itself … such as …

Lion

lion issues

  • you can only burn a dvd BEFORE you install
  • backward scrolling will take getting used to
  • merge folders only works when copying :(
  • not sure i prefer mission control over spaces
  • new gestures are nice
  • safari 5.1 is very fluid
  • i will probably never use launchpad
  • full screen apps are weird

MacPorts

but on to mac ports …

you will notice that macports is no longer working , updates fail etc.

$ sudo port selfupdate
--->  Updating the ports tree
--->  Updating MacPorts base sources using rsync
MacPorts base version 1.9.2 installed,
MacPorts base version 2.0.0 downloaded.
--->  MacPorts base is outdated, installing new version 2.0.0
Installing new MacPorts release in /opt/local as root:admin; permissions 0755; Tcl-Package in /Library/Tcl

Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: shell command failed (see log for details)

lets try and get a little more detail of the error …

$ sudo port -v selfupdate 
--->  Updating the ports tree
Synchronizing local ports tree from rsync://rsync.macports.org/release/ports/
receiving file list ... done
./

sent 59 bytes  received 533000 bytes  355372.67 bytes/sec
total size is 29300489  speedup is 54.97
Creating port index in /opt/local/var/macports/sources/rsync.macports.org/release/ports

Total number of ports parsed:   0 
Ports successfully parsed:  0 
Ports failed:           0 
Up-to-date ports skipped:   8197

--->  Updating MacPorts base sources using rsync
receiving file list ... done
./
deleting config.log

sent 42 bytes  received 6707 bytes  13498.00 bytes/sec
total size is 2952435  speedup is 437.46
MacPorts base version 1.9.2 installed,
MacPorts base version 2.0.0 downloaded.
--->  MacPorts base is outdated, installing new version 2.0.0
Installing new MacPorts release in /opt/local as root:admin; permissions 0755; Tcl-Package in /Library/Tcl

checking build system type... i386-apple-darwin11.0.0
checking host system type... i386-apple-darwin11.0.0
checking target system type... i386-apple-darwin11.0.0
checking MacPorts version... 2.0.0
checking for sw_vers... /usr/bin/sw_vers
checking for defaults... /usr/bin/defaults
checking for xcode-select... no
checking Mac OS X version... 10.7
checking Xcode version... 3.2.3
checking for gcc... /usr/bin/llvm-gcc-4.2
checking whether the C compiler works... no
configure: error: in `/opt/local/var/macports/sources/rsync.macports.org/release/base':
configure: error: C compiler cannot create executables
See `config.log' for more details
shell command "cd /opt/local/var/macports/sources/rsync.macports.org/release/base && CC=/usr/bin/llvm-gcc-4.2 ./configure --prefix=/opt/local --with-tclpackage=/Library/Tcl --with-install-user=root --with-install-group=admin --with-directory-mode=0755 --enable-readline && make && make install" returned error 77
Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: shell command failed (see log for details)

the c compiler complains about not being valid …
since lion is a whole new architecture it is worth looking at the macports migration guide

if you try and install macports 2.0 first you will get an error that you need xcode 4.1

apparently you need to install a whole new version of xcode which is now free and only available in the mac app store.

http://developer.apple.com/

you will want to install xcode and then a new pkg of macports.

you may also need to uninstall and reinstall all your old ports.

first let’s see if we can just upgrade our ports …

$ sudo port -fun upgrade outdated
Password:
--->  Computing dependencies for apache2
--->  Cleaning apache2
--->  Unable to uninstall apache2 @2.2.19_0+preforkmpm, the following ports depend on it:
--->    php5 @5.3.6_0+apache2+fastcgi+pear
Warning: Uninstall forced.  Proceeding despite dependencies.
--->  Deactivating apache2 @2.2.19_0+preforkmpm
--->  Unable to deactivate apache2 @2.2.19_0+preforkmpm, the following ports depend on it:
--->    php5 @5.3.6_0+apache2+fastcgi+pear
Warning: Deactivate forced.  Proceeding despite dependencies.
--->  Cleaning apache2
--->  Uninstalling apache2 @2.2.19_0+preforkmpm
--->  Cleaning apache2
--->  Computing dependencies for apache2
--->  Fetching archive for apache2
--->  Fetching apache2
--->  Verifying checksum(s) for apache2
--->  Extracting apache2
--->  Applying patches to apache2
--->  Configuring apache2
Error: Target org.macports.configure returned: configure failure: shell command failed (see log for details)
Log for apache2 is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_www_apache2/apache2/main.log
--->  Computing dependencies for apr-util
--->  Dependencies to be installed: libiconv
--->  Configuring libiconv
Error: Target org.macports.configure returned: configure failure: shell command failed (see log for details)
Error: Failed to install libiconv
Log for libiconv is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_textproc_libiconv/libiconv/main.log
Error: The following dependencies were not installed: libiconv
Error: Unable to upgrade port: 1
To report a bug, see <http://guide.macports.org/#project.tickets>

looks like a few ports have problems, such as apache2, apr, libiconv, etc …

uninstall and re-installing ports

after several attemts to upgrade and install gawk / libiconv i just gave up and followed the migration instructions.

  1. force uninstall everything that is installed
  2. clean all ports
  3. re-install needed ports

we can save a list of our installed ports for later use by doing the following command recommended in the macports upgrade guide

$ port -qv installed > myports.txt

also see … http://systems.takizo.com/2011/07/22/os-x-lion-macports-1/

also here is a list of current macport problems with lion


Reinstall ports

To reinstall your ports:

Save the list of installed ports:

port -qv installed > myports.txt

Uninstall all installed ports:

sudo port -f uninstall --follow-dependents installed

Clean any partially-completed builds:

sudo port clean all

Browse myports.txt and install the ports that you actually want to use (as opposed to those that are only needed as dependencies) one by one, remembering to specify the appropriate variants:

sudo port install portname +variant1 +variant2 …

Note that if you have specified variants which are not the default, you may need to install ports in an order other than the alphabetical order recorded in myports.txt.

One Comment

  1. Posted August 2, 2011 at 8:20 am | Permalink

    Thanks! Great tutorial :)

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*