X-Git-Url: https://gitweb.dragonflybsd.org/ikiwiki.git/blobdiff_plain/445266954639a41708d05c1ecdeb05e7f778b029..1d2aff2d36b8c0a51d8e13d2b25f8d5bea44869a:/docs/howtos/HowToDPorts/index.mdwn diff --git a/docs/howtos/HowToDPorts/index.mdwn b/docs/howtos/HowToDPorts/index.mdwn index 13b05664..39261447 100644 --- a/docs/howtos/HowToDPorts/index.mdwn +++ b/docs/howtos/HowToDPorts/index.mdwn @@ -2,55 +2,114 @@ Dports is DragonFly's own third-party software build system. It is based on FreeBSD's Ports Collection. Differences between ports and DPorts are intentionally kept to a minimum, both to maintain familiarity for mutual users of both operating systems and also to leverage the tremendous amount of work the FreeBSD contributors put into ports. DPorts can and does feature ports unique to DragonFly, so it's truly a native system. -The __pkgng__ tool called "pkg" is a modern and fast binary package manager. It was developed for FreeBSD, but PC-BSD used it in production first, followed soon after by DragonFly. In the future, it will be the only binary package manager on FreeBSD just as it is for DPorts. +The __pkgng__ tool called "pkg" is a modern and fast binary package manager. It was developed for FreeBSD, but PC-BSD used it in production first, followed soon after by DragonFly. In the future, it will be the only binary package manager on FreeBSD, just it is the only port manager in DPorts. -__pkgng__ is not a replacement for port management tools like `ports-mgmt/portmaster` or `ports-mgmt/portupgrade`. While `ports-mgmt/portmaster` and `ports-mgmt/portupgrade` can install third-party software from both binary packages and DPorts, __pkgng__ installs only binary packages. +__pkgng__ is not a replacement for port management tools like `ports-mgmt/portmaster` or `ports-mgmt/portupgrade`. While `ports-mgmt/portmaster` and `ports-mgmt/portupgrade` can install third-party software from both binary packages and DPorts, __pkgng__ installs only binary packages. On the other hand, many people use __pkgng__ by itself and never install the optional portupgrade or portmaster tools. ## Getting started with pkgng -DragonFly daily snapshots and Releases (starting with 3.4) come with __pkgng__ already installed. However upgrades from earlier releases won't have it. If the "pkg" program is missing on the system for any reason, it can be quickly bootstrapped without having to build it from source. - -To bootstrap __pkgng__ from source on a pkgsrc-using system, run: - - # cd /usr - # make dports-create - # rm -rf pkg ( as in /usr/pkg ) - # pkg install some-package - -To bootstrap __pkgng__ with a download on a pkgsrc-using system, run: +DragonFly daily snapshots and Releases (starting with 3.4) come with __pkgng__ already installed. Upgrades from earlier releases, however, will not have it. If the "pkg" program is missing on the system for any reason, it can be quickly bootstrapped without having to build it from source or even having dports installed: # make pkg-bootstrap # rehash # pkg-static install -y pkg # rehash -Note that this step is unnecessary for any newly installed release from DragonFly 3.4 onwards. +If pkgsrc has ever been installed on the system, make sure all binaries produced by it have been removed: -## Configuring the pkgng Environment + # rm -rf /usr/pkg -The __pkgng__ package management system uses a package repository for most operations. The default package repository location is defined in `/usr/local/etc/pkg.conf` or the `PACKAGESITE` environment variable, which overrides the configuration file. Additional __pkgng__ configuration options are described in pkg.conf(5). +Currently it's necessary to manually install the configuration file, but this requirement should disappear in the future. After installing the configuration file, you may want to open it up and edit it to select a different mirror. -The pkg.conf file comes preinstalled with the latest release repository pre-selected. +## Configuring pkgng - PACKAGESITE: http://avalon.dragonflybsd.org/dports/${ABI}/RELEASE +Older versions of pkgng saved their configuration at /usr/local/etc/pkg.conf; this file made reference to a PACKAGESITE. pkgng will still work based on this file, but will output errors: -The RELEASE repository is static, but the LATEST repository is periodically updated. If bleeding edge is wanted, change pkg.conf to reflect that: + # pkg update + pkg: PACKAGESITE in pkg.conf is deprecated. Please create a repository configuration file + Updating repository catalogue + pkg: Warning: use of http:// URL scheme with SRV records is deprecated: switch to pkg+http:// - PACKAGESITE: http://avalon.dragonflybsd.org/dports/${ABI}/LATEST +If you do __not__ see these errors, then skip to "Now, navigate to `/usr/local/etc/pkg/repos/`", otherwise: -DragonFly users on the development branch can also use pre-built binary packages from the last release, but they will need to override the ABI in pkg.conf, e.g.: +Listen to the errors: hash out the packagesite line, save the file, and move on. This can be done with vi: - ABI: dragonfly:3.4:x86:32 # for i386 platform - ABI: dragonfly:3.4:x86:64 # for x86-64 platform + # vi /usr/local/etc/pkg.conf -There are already a few mirrors available which can be set in pkg.conf +There will be two lines in the file like this: -* North America: http://avalon.dragonflybsd.org/dports/${ABI}/LATEST -* Europe: http://pkg.wolfpond.org/${ABI}/LATEST -* Europe: http://mirrors.ircam.fr/pub/DragonFlyBSD-dports/${ABI}/LATEST -* Europe: http://dfly.schlundtech.de/dports/${ABI}/LATEST + # Default Dports package server (California) + PACKAGESITE: http://mirror-master.dragonflybsd.org/dports/${ABI}/LATEST -All the above european mirrors are IPV6-enabled. +Hash out the offending line: + + # Default Dports package server (California) + # PACKAGESITE: http://mirror-master.dragonflybsd.org/dports/${ABI}/LATEST + +Note that, as of time of writing, there are two working package repositories: + + # Default Dports package server (California) + # PACKAGESITE: http://mirror-master.dragonflybsd.org/dports/${ABI}/LATEST + + # European mirrors + [...] + #PACKAGESITE: http://dfly.schlundtech.de/dports/${ABI}/LATEST + +Test their performance---we will be using the fastest one. This may, or may not, be the one closest to you (the California site for the New World, the German site for the Old World). + + # ping schlundtech.de + PING schlundtech.de (85.236.36.90): 56 data bytes + 64 bytes from 85.236.36.90: icmp_seq=0 ttl=49 time=101.433 ms + 64 bytes from 85.236.36.90: icmp_seq=1 ttl=49 time=59.177 ms + 64 bytes from 85.236.36.90: icmp_seq=2 ttl=49 time=79.550 ms + 64 bytes from 85.236.36.90: icmp_seq=3 ttl=49 time=88.268 ms + 64 bytes from 85.236.36.90: icmp_seq=4 ttl=49 time=120.060 ms + [...] + --- schlundtech.de ping statistics --- + 20 packets transmitted, 19 packets received, 5.0% packet loss + round-trip min/avg/max/stddev = 49.555/96.064/186.662/33.559 ms + # ping mirror-master.dragonflybsd.org + PING avalon.dragonflybsd.org (199.233.90.72): 56 data bytes + 64 bytes from 199.233.90.72: icmp_seq=0 ttl=47 time=208.013 ms + 64 bytes from 199.233.90.72: icmp_seq=1 ttl=47 time=256.441 ms + 64 bytes from 199.233.90.72: icmp_seq=2 ttl=47 time=281.436 ms + 64 bytes from 199.233.90.72: icmp_seq=3 ttl=47 time=281.103 ms + 64 bytes from 199.233.90.72: icmp_seq=4 ttl=47 time=285.440 ms + [...] + --- avalon.dragonflybsd.org ping statistics --- + 19 packets transmitted, 19 packets received, 0.0% packet loss + round-trip min/avg/max/stddev = 208.013/264.017/334.180/31.549 ms + +Now, navigate to `/usr/local/etc/pkg/repos/` and rename one of the configuration file samples you find there. Edit the one you renamed: + + # cd /usr/local/etc/pkg/repos/ + # ls + df-latest.conf.sample df-releases.conf.sample + # cp -v df-latest.conf.sample df-latest.conf + df-latest.conf.sample -> df-latest.conf + # chmod -v 644 df-latest.conf + df-latest.conf + # vim df-latest.conf + +Enable whichever server was faster (Avalon is American, SchlundTech is German), and pkg+ to the url and mirror_type to SRV: + + Avalon: { + url : http://mirror-master.dragonflybsd.org/dports/${ABI}/LATEST, + mirror_type : SRV + [...] + enabled : no + } + SchlundTech: { + url : http://dfly.schlundtech.de/dports/${ABI}/LATEST, + mirror_type : SRV + [...] + enabled : yes + } + +Before using, consult the man page (`man pkg`) and then try these examples: + + # pkg search editors + # pkg install vim ## Basic pkgng Operations