portmasterとpkgngを使う

最近はportmasterが流行らしいので、portupgradeから乗り換えてみる。

インストール

アホみたいにインストールが早くてワロタ。システム標準の機能とシェルスクリプトだけで作られているそうなので、スクリプトを取得して展開してるだけなのかも。

cd /usr/ports/ports-mgmt/portmaster/
make install

<pre> If you want to switch to the new pkg(8) format, and have not already done so, there are some extra 1-time steps to take:

  Enable PKGNG as your package format:
      # echo 'WITH_PKGNG=yes' >> /etc/make.conf
  Then convert your /var/db/pkg database to the new pkg format:
      # pkg2ng

</pre> とのことなので、いい機会だしpkgngで運用してみる。

まずはpkgngをインストール。

# pkg
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg please wait
_http._tcp.pkg.FreeBSD.org
Installing pkg-1.1.4_8... done
If you are upgrading from the old package format, first run:

  # pkg2ng
usage: pkg [-v] [-d] [-l] [-N] [-j <jail name or id>|-c <chroot path>] [-C <configuration file>] <command> [<args>]

Global options supported:
	-d             Increment debug level
	-j             Execute pkg(1) inside a jail(8)
	-c             Execute pkg(1) inside a chroot(8)
	-C             Use the specified configuration file
	-l             List available command and exit
	-v             Display pkg(1) version
	-N             Test if pkg(1) is activated and avoid auto-activation

Commands supported:
	add            Registers a package and installs it on the system
	annotate       Add, modify or delete tag-value style annotations on packages
	audit          Reports vulnerable packages
	autoremove     Removes orphan packages
	backup         Backs-up and restores the local package database
	check          Checks for missing dependencies and database consistency
	clean          Cleans old packages from the cache
	convert        Convert database from/to pkgng
	create         Creates software package distributions
	delete         Deletes packages from the database and the system
	fetch          Fetches packages from a remote repository
	help           Displays help information
	info           Displays information about installed packages
	install        Installs packages from remote package repositories
	lock           Locks package against modifications or deletion
	plugins        Manages plugins and displays information about plugins
	query          Queries information about installed packages
	register       Registers a package into the local database
	remove         Deletes packages from the database and the system
	repo           Creates a package repository catalogue
	rquery         Queries information in repository catalogues
	search         Performs a search of package repository catalogues
	set            Modifies information about packages in the local database
	ssh            ssh packages to be used via ssh
	shell          Opens a debug shell
	shlib          Displays which packages link against a specific shared library
	stats          Displays package database statistics
	unlock         Unlocks a package, allowing modification or deletion
	update         Updates package repository catalogues
	updating       Displays UPDATING information for a package
	upgrade        Performs upgrades of packaged software distributions
	version        Displays the versions of installed packages
	which          Displays which package installed a specific file

Commands provided by plugins:

For more information on the different commands see 'pkg help <command>'.

pkgngの使用を明示

# echo 'WITH_PKGNG=yes' >> /etc/make.conf

既存のpkgデータベースをpkgng方式に変換

# pkg2ng

早速pkgngでportupgradeを消してみる

sudo pkg delete portupgrade
パスワード:
Deinstallation has been requested for the following 1 packages:

	portupgrade-2.4.9.3,2

The deinstallation will free 411 kB

Proceed with deinstalling packages [y/N]: y
[1/1] Deleting portupgrade-2.4.9.3,2... done