OpenBSD 如何比较packages 和ports里面软件的版本?

OpenBSD的安装、升级、更新等日常问题。

版主: chenjun天地乾坤

回复
f5b
锆 Zr
帖子: 643
注册时间: 2011-10-22 20:43

OpenBSD 如何比较packages 和ports里面软件的版本?

帖子 f5b » 2011-12-01 9:31

在FreeBSD中,有

The following is a typical invocation of the pkg_version command, which checks the installed packages against the local ports index file: % pkg_version -v

OpenBSD中有类似功能么?

例如,我安装了OpenBSD 5.0 release,然后通过packages安装了很多软件。
现在下载了stable版的port源代码,发现个别软件需要更新,现在我想清查,到底还有哪些软件需要更新。

头像
leo
帖子: 2465
注册时间: 2010-01-21 3:27

回复: OpenBSD 如何比较packages 和ports里面软件的版本?

帖子 leo » 2011-12-01 11:09

我记得直接

代码: 全选

# pkg_add -u
就可以更新全部软件包了,如果需要更新某个软件,在后面加上软件包名称。

f5b
锆 Zr
帖子: 643
注册时间: 2011-10-22 20:43

回复: OpenBSD 如何比较packages 和ports里面软件的版本?

帖子 f5b » 2011-12-01 11:45

pkg_add -u 的前提是:

你安装了packages,还设定了PKG_PATH=ftp:/a.b.c
且a.b.c上面有比你安装的packages更新版本的安装文件

头像
leo
帖子: 2465
注册时间: 2010-01-21 3:27

回复: OpenBSD 如何比较packages 和ports里面软件的版本?

帖子 leo » 2011-12-01 12:28

我是根据你的如下描述,猜测你需要更新软件包。
f5b 写了:...
例如,我安装了OpenBSD 5.0 release,然后通过packages安装了很多软件。
现在下载了stable版的port源代码,发现个别软件需要更新,现在我想清查,到底还有哪些软件需要更新。
如果你只是想检查哪些软件包更新了,我还真不知道OpenBSD有类似FreeBSD下pkg_version的命令,我一般不自定义软件包,所以直接自动更新,不关心具体哪些软件包更新了。
我一般要了解软件包的更新信息就上http://www.openports.se, 或许Porter指南里有相关的知识。

头像
acheng
锌 Zn
帖子: 581
注册时间: 2011-07-07 21:52

回复: OpenBSD 如何比较packages 和ports里面软件的版本?

帖子 acheng » 2011-12-05 22:12

我的了解是OpenBSD上没有这样的命令。

一个release出来以后,和这个release“相应的”软件包也不会再更新了。想要更新的话只能等下一个release,然后升级系统及软件包。

release和stable属于两个分支。stable的ports一般是不能用于release版本的系统的。要使用stable,参考:http://www.openbsd.org/stable.html

头像
leo
帖子: 2465
注册时间: 2010-01-21 3:27

回复: OpenBSD 如何比较packages 和ports里面软件的版本?

帖子 leo » 2011-12-06 3:46

acheng兄说得好,这点我还真忽略了,抱歉,没注意楼主提到的使用的是RELEASE版。

使用不同分支的PORTS是不妥,尽管不见得肯定出现问题,但是最好别这样用。如果使用的是release版, 可以直接用FTP上的ports.tar.gz里的源代码即可,不过OpenBSD 5.0/4.9已经有补丁了,建议楼主尽快update/upgrade到stable/current。此外即便OpenBSD的版本尚未发布补丁,一般强况下ports也应该使用对应的版本。

有关PORTS升级——
每个OPENBSD版本发布后,对应的ports版本相对稳定,一般不会对ports版本升级,只会提供ports的安全性更新(修补),例如出现p1,p2,p3....等。

f5b
锆 Zr
帖子: 643
注册时间: 2011-10-22 20:43

回复: OpenBSD 如何比较packages 和ports里面软件的版本?

帖子 f5b » 2011-12-06 7:57

acheng 写了:我的了解是OpenBSD上没有这样的命令。

一个release出来以后,和这个release“相应的”软件包也不会再更新了。想要更新的话只能等下一个release,然后升级系统及软件包。

release和stable属于两个分支。stable的ports一般是不能用于release版本的系统的。要使用stable,参考:http://www.openbsd.org/stable.html
system
userland
ports
三个级别都有对应的release,stable(patch brunch),和current版


http://www.openbsd.org/faq/faq15.html#NoFun

Because no intrusive changes are made in -stable, it is possible to use a -stable ports tree on a -release system, and vice versa. There is no need to update all your installed packages after applying a few errata patches to your system.

所以,5.0 release可以使用stable版本的ports,stable版本的port如何得来,到底更新了什么软件?以下操作可以看到stable port更新情况?

首先下载release版本的port.tar.gz,解压缩到/usr,然后运行

# cd /usr/ports
# cvs -q up anoncvs@anoncvs.ca.openbsd.org:/cvs -rOPENBSD_5_0 -Pd

屏幕会输出有安全更新的软件信息,很多呢。

f5b
锆 Zr
帖子: 643
注册时间: 2011-10-22 20:43

回复: OpenBSD 如何比较packages 和ports里面软件的版本?

帖子 f5b » 2011-12-06 8:00

leo 写了:acheng兄说得好,这点我还真忽略了,抱歉,没注意楼主提到的使用的是RELEASE版。

使用不同分支的PORTS是不妥,尽管不见得肯定出现问题,但是最好别这样用。如果使用的是release版, 可以直接用FTP上的ports.tar.gz里的源代码即可,不过OpenBSD 5.0/4.9已经有补丁了,建议楼主尽快update/upgrade到stable/current。此外即便OpenBSD的版本尚未发布补丁,一般强况下ports也应该使用对应的版本。

有关PORTS升级——
每个OPENBSD版本发布后,对应的ports版本相对稳定,一般不会对ports版本升级,只会提供ports的安全性更新(修补),例如出现p1,p2,p3....等。
关于最近5.0/4.9的errata,其中只有bind有问题,没有任何其他更新(sync stable source也只是看到bind目录更新过2个文件而已),若不需要用bind做服务,应该就不需要update stable或者upgrade current了?

头像
leo
帖子: 2465
注册时间: 2010-01-21 3:27

回复: OpenBSD 如何比较packages 和ports里面软件的版本?

帖子 leo » 2011-12-06 11:28

f5b 写了:关于最近5.0/4.9的errata,其中只有bind有问题,没有任何其他更新(sync stable source也只是看到bind目录更新过2个文件而已),若不需要用bind做服务,应该就不需要update stable或者upgrade current了?
目前来说可能不会有问题,但是我也不敢担保,这个问题社区以前有帖子讨论过,大家意见不一致,我个人倾向于即便没有补丁也先编译成stable,再使用相应的ports更稳妥,而且我还出现过无法打补丁的情况,即便你打上了补丁,启动时仍旧显示的是release。我的习惯做法是内核和userland从源代码编译。

此外,关于这句:
Because no intrusive changes are made in -stable, it is possible to use a -stable ports tree on a -release system, and vice versa. There is no need to update all your installed packages after applying a few errata patches to your system.
说的很含糊(it is possible to use),和前面的描述多少还有些不一致,而且你更新ports时一个 pkg_add -u 命令就解决了所有需要更新的软件和依赖包,又有谁关心到底更新了哪个包呢?

头像
acheng
锌 Zn
帖子: 581
注册时间: 2011-07-07 21:52

回复: OpenBSD 如何比较packages 和ports里面软件的版本?

帖子 acheng » 2011-12-06 15:47

由于-stable相当于-release + patch,借用它的ports估计问题不大。

另外,注意faq5中的一段话:
Keeping Things in Sync

It is important to understand that OpenBSD is an Operating System, intended to be taken as a whole, not a kernel with a bunch of utilities stuck on. You must make sure your kernel, "userland" (the supporting utilities and files) and ports tree are all in sync, or unpleasant things will happen. Said another way (because people just keep making the error), you can not run brand new ports on a month old system, or rebuild a kernel from -current source and expect it to work properly with a -release userland. Yes, this does mean you need to upgrade your system if you want to run a new program which was added to the ports tree today. Sorry, but again, OpenBSD has limited resources available.

f5b
锆 Zr
帖子: 643
注册时间: 2011-10-22 20:43

回复: OpenBSD 如何比较packages 和ports里面软件的版本?

帖子 f5b » 2011-12-06 17:18

leo 写了: 说的很含糊(it is possible to use),和前面的描述多少还有些不一致,而且你更新ports时一个 pkg_add -u 命令就解决了所有需要更新的软件和依赖包,又有谁关心到底更新了哪个包呢?

pkg_add -u 一般用于将系统从4.9升级到5.0后通过packages更新软件

可能我之前表达不当

用一个例子来说明吧

全新安装 5.0 release,通过packages安装http://ftp.openbsd.org/pub/OpenBSD/5.0/ ... .4.3.2.tgz

但是,因为安全问题,phpMyAdmin到今天为止port那边已经更新到3.4.8了

http://www.openbsd.org/cgi-bin/cvsweb/p ... n/Makefile

Revision 1.61.2.5: download - view: text, markup, annotated - select for diffs
Mon Dec 5 10:27:47 2011 UTC (22 hours, 49 minutes ago) by sthen
Branches: OPENBSD_5_0
Diff to: previous 1.61.2.4: preferred, coloured; branchpoint 1.61: preferred, coloured; next MAIN 1.62: preferred, coloured
Changes since revision 1.61.2.4: +2 -2 lines
MFC the phpmyadmin update; various cross-site scripting fixes. Req by giovanni@ Revision 1.69: download - view: text, markup, annotated - select for diffs
Mon Dec 5 09:55:12 2011 UTC (23 hours, 22 minutes ago) by sthen
Branches: MAIN
Diff to: previous 1.68: preferred, coloured
Changes since revision 1.68: +2 -2 lines
update to phpMyAdmin 3.4.8, including fixes for 5 cross-site scripting bugs. ok kevlo@

此时一般用make install方式安装port的新版phpmyadmin,当然,5.0还有很多port有安全更新。

头像
leo
帖子: 2465
注册时间: 2010-01-21 3:27

回复: OpenBSD 如何比较packages 和ports里面软件的版本?

帖子 leo » 2011-12-07 1:11

汗!!!
这里绝对不是f5b兄表达地不清楚,估计这里确实是我搞错了,轻信了FAQ里的"update", 刚刚cvs了stable的ports源代码,然后先用pkg_add -u更新了所有的packages, 但是“没发现”有更新,but,

代码: 全选

# cd /usr/ports/www/phpmyadmin/                                         
# make show=PKGNAMES
phpMyAdmin-3.4.8
又回头查了一下4.8和4.9的packages目录,发现文件也居然没有变化(原来确实没有查看过),但是有些奇怪,因为原来稳定版用pkg_add -u时确实有packages被更新过,而且并不只一、两个.....:confused:

如果确实是f5b兄所说,那在ftp上存放这些packages就没有什么意义了,而且,版本查询也非常重要了,谁有时间天天cvs查源代码变化呀?对OpenBSD packages的安全性更觉得没谱了。:(

我正在读这里:
http://www.openbsd.org/faq/faq15.html#dpb

再引用一段:
15.3.10 - Security updates

When serious bugs or security flaws are discovered in third party software, they are fixed in the -stable branch of the ports tree. Remember that the lifecycle is 1 release: only the current and last release are updated, as explained in FAQ 5 - OpenBSD's Flavors.
This means all you need to do is make sure you check out the correct branch of the ports tree, and build the desired software from it. You can keep your tree up-to-date with CVS, and in addition subscribe to the ports-changes mailing list to receive security announcements related to software in the ports tree.

Of course, security updates reach the -current ports tree before being taken up in the -stable branch.
也就是说,只有当前版和最新发布版对应的稳定版得ports tree里才提供第三方补丁,要想获取/关注稳定版的补丁信息,还需要订阅ports-changes列表。:rolleyes:

看来要考虑是否用current了,期待OpenBSD早些实现FreeBSD的更新方式,也就是直接发放二进制包。

看来是确实需要一个ports版本变化查询工具,我再搜搜,多谢f5b兄指正。:)

回复

在线用户

正浏览此版面之用户: 没有注册用户 和 6 访客