收藏:Portupgrade更新

原文:http://www.unix-center.net/bbs/viewthread.php?tid=13855&extra=page%3D1

 

无可否认,FreeBSD的ports太强大了,自动解决依赖关系,需要的底层依赖包一个不漏地从网络拖下来,解包,编译,链接。一层一层地累上来,构建一个强大的软件组件。 可是在升级软件包的时候,如果单纯性简单地cd /usr/ports/your_desired_software_component_directory/ && make install clean有的时候会因为系统已经安装的一些被依赖的组件的版本过低而出现一些错误信息,例如,我在编译tsclient的时候就会遇到以下问题:


wqpbsd# pwd
/usr/ports/net/tsclient
wqpbsd# make install clean
===>   tsclient-0.150_4 depends on executable: gmake - found
===>   tsclient-0.150_4 depends on file: /usr/local/bin/automake-1.9 - found
===>   tsclient-0.150_4 depends on file: /usr/local/bin/autoconf-2.62 - found
===>   tsclient-0.150_4 depends on file: /usr/local/bin/libtool - found
===>   tsclient-0.150_4 depends on file: /usr/local/bin/intltool-extract - found
===>   tsclient-0.150_4 depends on file: /usr/local/libdata/pkgconfig/gnome-mime-data-2.0.pc - found
===>   tsclient-0.150_4 depends on executable: pkg-config - found
===>   tsclient-0.150_4 depends on file: /usr/local/libdata/pkgconfig/gnome-doc-utils.pc - found
===>   tsclient-0.150_4 depends on shared library: intl - found
===>   tsclient-0.150_4 depends on shared library: esd.2 - found
===>   tsclient-0.150_4 depends on shared library: atk-1.0.0 - found
===>   tsclient-0.150_4 depends on shared library: gconf-2.4 - found
===>   tsclient-0.150_4 depends on shared library: glib-2.0.0 - found
===>   tsclient-0.150_4 depends on shared library: gnome-desktop-2.11 - not found
===>    Verifying install for gnome-desktop-2.11 in /usr/ports/x11/gnome-desktop
===>  Installing for gnome-desktop-2.26.1
===>   gnome-desktop-2.26.1 depends on file: /usr/local/libdata/pkgconfig/gnome-python-2.0.pc - found
===>   gnome-desktop-2.26.1 depends on file: /usr/local/bin/python2.5 - found
===>   gnome-desktop-2.26.1 depends on file: /usr/local/libdata/pkgconfig/xpm.pc - found
===>   gnome-desktop-2.26.1 depends on file: /usr/local/etc/mtree/BSD.gnome.dist - found
===>   gnome-desktop-2.26.1 depends on file: /usr/local/libdata/pkgconfig/gnome-mime-data-2.0.pc - found
===>   gnome-desktop-2.26.1 depends on executable: pkg-config - found
===>   gnome-desktop-2.26.1 depends on file: /usr/local/lib/gio/modules/libgiofam.so - found
===>   gnome-desktop-2.26.1 depends on file: /usr/local/libdata/pkgconfig/gnome-doc-utils.pc - found
===>   gnome-desktop-2.26.1 depends on shared library: intl - found
===>   gnome-desktop-2.26.1 depends on shared library: esd.2 - found
===>   gnome-desktop-2.26.1 depends on shared library: atk-1.0.0 - found
===>   gnome-desktop-2.26.1 depends on shared library: gconf-2.4 - found
===>   gnome-desktop-2.26.1 depends on shared library: glib-2.0.0 - found
===>   gnome-desktop-2.26.1 depends on shared library: gnomevfs-2.0 - found
===>   gnome-desktop-2.26.1 depends on shared library: gtk-x11-2.0.0 - found
===>   gnome-desktop-2.26.1 depends on shared library: art_lgpl_2.5 - found
===>   gnome-desktop-2.26.1 depends on shared library: bonobo-2.0 - found
===>   gnome-desktop-2.26.1 depends on shared library: bonoboui-2.0 - found
===>   gnome-desktop-2.26.1 depends on shared library: glade-2.0.0 - found
===>   gnome-desktop-2.26.1 depends on shared library: gnome-2.0 - found
===>   gnome-desktop-2.26.1 depends on shared library: gnomecanvas-2.0 - found
===>   gnome-desktop-2.26.1 depends on shared library: gnomeui-2.0 - found
===>   gnome-desktop-2.26.1 depends on shared library: IDL-2.0 - found
===>   gnome-desktop-2.26.1 depends on shared library: xml2.5 - found
===>   gnome-desktop-2.26.1 depends on shared library: xslt.2 - found
===>   gnome-desktop-2.26.1 depends on shared library: ORBit-2.0 - found
===>   gnome-desktop-2.26.1 depends on shared library: pango-1.0.0 - found
===>   Generating temporary packing list
===>  Checking if x11/gnome-desktop already installed
pkg_info: package oss-freebsd7-v4.1-1052-i386 has no origin recorded
===>   An older version of x11/gnome-desktop is already installed (gnome-desktop-2.22.3)
      You may wish to ``make deinstall'' and install this port again
      by ``make reinstall'' to upgrade it properly.
      If you really wish to overwrite the old port of x11/gnome-desktop
      without deleting it first, set the variable "FORCE_PKG_REGISTER"
      in your environment or the "make install" command line.
*** Error code 1

Stop in /usr/ports/x11/gnome-desktop.
*** Error code 1

Stop in /usr/ports/net/tsclient.
*** Error code 1

Stop in /usr/ports/net/tsclient.
wqpbsd#
其实安装完系统以后第一次编译tsclient遇到一堆的Error code 1错误。这往往会让初学者不知所措并对ports的设计产生某种怀疑。make install clean方式的ports安装不会自动删除系统已经安装的软件,因此在安装一个新软件的时候往往需要费一些周折。

ports从设计上来说,技术是非常先进的。其出错信息也非常完善,已经提示并给出详细的解决方案:
卸载低版本的组件然后重新安装本组件,自动将已经删除的组件下载、编译、安装。如果这样的错误只有一个还好,如果有很多也是比较花费时间的。

最好的办法是使用portupgrade,这个工具需要手动安装,在/usr/ports/ports-mgmt/portupgrade下,make install clean即可。
当需要更新一个软件和其依赖的组件的时候,使用portupgrade -R should_be_upgraded_software_component_name就 会自动更新指定的软件,如果指定的软件的新版本需要更新依赖的组件到更新的版本,也会自动更新,下载、编译、连接后会删除就版本的依赖组件,然后安装新的 组件,然后继续安装其他组件,直到将最上层指定的should_be_upgraded_software_component_name更新到最新的版 本。

详细信息请参考 portupgrade的手册页。
posted @ 2009-07-16 09:35  81  阅读(301)  评论(0编辑  收藏  举报