如何使用macport安装软件?

如何使用macport安装软件?
$ sudo port install linkchecker
--->  Computing dependencies for openssl
--->  Verifying checksum(s) for openssl
Error: No checksum set for openssl-1.0.0f.tar.gz
Error: Target org.macports.checksum returned: Unable to verify file checksums
Log for openssl is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_devel_openssl/main.log
Error: Unable to upgrade port: 1
Error: Unable to execute port: upgrade python27 failed
To report a bug, see <http://guide.macports.org/#project.tickets>

看起来端口一开始就没有处于干净的状态?

[编辑1]sudo port -d selfupdate

我在防火墙后面,可能不允许rsync

$ sudo port -d selfupdate
Password:
--->  Updating the ports tree
DEBUG: Synchronizing ports tree(s)
Synchronizing local ports tree from file:///opt/local/var/macports/sources/svn.macports.org/trunk/dports/
DEBUG: /usr/bin/svn update --non-interactive /opt/local/var/macports/sources/svn.macports.org/trunk/dports
DEBUG: changing euid/egid - current euid: 0 - current egid: 0
U    /opt/local/var/macports/sources/svn.macports.org/trunk/dports/python/py-pyqt4/Portfile
U    /opt/local/var/macports/sources/svn.macports.org/trunk/dports/python/py-mhash/Portfile
U    /opt/local/var/macports/sources/svn.macports.org/trunk/dports/python/py-tweepy/Portfile
U    /opt/local/var/macports/sources/svn.macports.org/trunk/dports/python/py-pyttsx/Portfile
U    /opt/local/var/macports/sources/svn.macports.org/trunk/dports/python/py-docx/Portfile
U    /opt/local/var/macports/sources/svn.macports.org/trunk/dports/python/py-clint/Portfile
 U   /opt/local/var/macports/sources/svn.macports.org/trunk/dports/gnome/gnucash-devel
Updated to revision 88813.
Creating port index in /opt/local/var/macports/sources/svn.macports.org/trunk/dports
Adding port aqua/Readown
Failed to parse file archivers/arj/Portfile: invalid command name "get_canonical_archflags"
Failed to parse file archivers/gzip/Portfile: invalid command name "installs_libs"
Failed to parse file archivers/ucl/Portfile: invalid command name "get_canonical_archflags"
Failed to parse file archivers/unzip/Portfile: invalid command name "installs_libs"
Failed to parse file archivers/upx/Portfile: invalid command name "get_canonical_archflags"
Failed to parse file archivers/xdelta/Portfile: invalid command name "get_canonical_archflags"
Failed to parse file archivers/zip/Portfile: invalid command name "installs_libs"
Failed to parse file archivers/zoo/Portfile: invalid command name "get_canonical_archflags"
.
.
.

[编辑2]sudo port clean --all openssl

sudo port clean --all openssl没有用。

$ sudo port install linkchecker
--->  Computing dependencies for openssl
--->  Verifying checksum(s) for openssl
Error: No checksum set for openssl-1.0.0f.tar.gz
Error: Target org.macports.checksum returned: Unable to verify file checksums
Log for openssl is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_devel_openssl/main.log
Error: Unable to upgrade port: 1
Error: Unable to execute port: upgrade python27 failed
To report a bug, see <http://guide.macports.org/#project.tickets>
$ sudo port clean --all openssl
--->  Cleaning openssl
$ sudo port install linkchecker
--->  Computing dependencies for openssl
--->  Fetching openssl
--->  Attempting to fetch openssl-1.0.0f.tar.gz from http://www.openssl.org/source/
--->  Verifying checksum(s) for openssl
Error: No checksum set for openssl-1.0.0f.tar.gz
Error: Target org.macports.checksum returned: Unable to verify file checksums
Log for openssl is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_devel_openssl/main.log
Error: Unable to upgrade port: 1
Error: Unable to execute port: upgrade python27 failed
To report a bug, see <http://guide.macports.org/#project.tickets>
$

[EDIT3] tarball 安装也不起作用

$ more /opt/local/etc/macports/sources.conf
#  MacPorts system wide sources configuration file
#  $Id: sources.conf 42662 2008-11-28 23:18:50Z [email protected] $

<snip>   

#  To get the ports tree from the master MacPorts server in California, USA use:
#      rsync://rsync.macports.org/release/ports/
#  To get it from the mirror in Trondheim, Norway use:
#      rsync://trd.no.rsync.macports.org/release/ports/
#  A current list of mirrors is available at http://trac.macports.org/wiki/Mirrors
#rsync://rsync.macports.org/release/ports/ [default]
#http://www.macports.org/files/ports.tar.gz [default]
file:///opt/local/var/macports/sources/svn.macports.org/trunk/dports/ [default]
$ sudo vim /opt/local/etc/macports/sources.conf
$ sudo port -d sync
DEBUG: Synchronizing ports tree(s)
Synchronizing local ports tree from http://www.macports.org/files/ports.tar.gz
No updates for http://www.macports.org/files/ports.tar.gz
$ more /opt/local/etc/macports/sources.conf
$ sudo port install linkchecker
--->  Computing dependencies for openssl
--->  Fetching openssl
--->  Attempting to fetch openssl-1.0.0f.tar.gz from http://www.openssl.org/source/
--->  Verifying checksum(s) for openssl
Error: No checksum set for openssl-1.0.0f.tar.gz
Error: Target org.macports.checksum returned: Unable to verify file checksums
Log for openssl is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_www.macports.org_files_ports_devel_openssl/main.log
Error: Unable to upgrade port: 1
Error: Unable to execute port: upgrade python27 failed
To report a bug, see <http://guide.macports.org/#project.tickets>

答案1

您的 Portfile 似乎已损坏:您的 openssl 端口没有校验和變數集。

清洁--全部操作没有任何帮助,因为它清理了 distfile(正在构建的端口的实际档案)和工作目录,而不是 Portfile。

你可以通过运行以下命令检查当前 Portfile 中是否有校验和设置:

port cat openssl | grep checksums ; echo $?

A1输出意味着 Portfile 已损坏。

恢复文件的最简单方法是删除它,然后重新同步,在 rsync 或 svn 上(我不确定单个 tarball)。因此,在 sources.conf 中切换回 svn,即恢复文件:///输入并运行:

sudo port -d sync; sudo rm $(port dir openssl)/Portfile; sudo port -d sync

中的错误编辑2意味着你的 port 命令不知道 portfile 中使用的程序,也就是说它已经过时了。我不确定为什么自我更新没有更新。

相关内容