Solved [Solved] Change in pkg_add command?

I just installed FreeBSD 8.2 rc1 and I've noticed my source updating/compilation script is not working anymore, it fails at pkg_add -r command:

Code:
# pkg_add -r cvsup-without-gui
Error: Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/
packages-8.2-release/Latest/cvsup-without-gui.tbz: Protocol error
pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/
packages-8.2-release/Latest/cvsup-without-gui.tbz' by URL

It is possible that pkg_add now uses http instead of ftp, but still such command should work. Is any switch to still use ftp for pkg_add fetching or can I use http but keep this
simple command pkg_add -r package-name (without full patch, because I want the script to remain portable from a version to another).
 
You don't need cvsup-without-gui. You can use csup(1) which is part of the base.

Your pkg_add command is actually using FTP.
 
I don't remember where I've read about pkg_add being changed to work with http. Still I don't know why pkg_add -r cvsup-without-gui give the previous error.
(Until 8.2 the script worked ok with pkg_add -r cvsup-without-gui).

Well, I follow your tip and I've used csup, problem solved, thank you!
 
pkg_add(1) (at least in 8.x) works fine with HTTP or FTP. You can test it by changing the ftp:// to http:// in your PACKAGESITE variable and re-running the command.

You can see it in action here:
Code:
# setenv PACKAGESITE http://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8-stable/Latest/

# pkg_add -rnv tmux
scheme:   [http]
user:     []
password: []
host:     [ftp.freebsd.org]
port:     [0]
document: [/pub/FreeBSD/ports/i386/packages-8-stable/Latest/tmux.tbz]
---> ftp.freebsd.org:80
looking up ftp.freebsd.org
connecting to ftp.freebsd.org:80
requesting http://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8-stable/Latest/tmux.tbz
>>> GET /pub/FreeBSD/ports/i386/packages-8-stable/Latest/tmux.tbz HTTP/1.1
>>> Host: ftp.freebsd.org
>>> User-Agent: pkg_add libfetch/2.0
>>> Connection: close
>>> 
<<< HTTP/1.1 200 OK
<<< Content-Type: application/x-bzip-compressed-tar
<<< Accept-Ranges: bytes
<<< ETag: "374657815"
<<< Last-Modified: Fri, 24 Dec 2010 04:58:32 GMT
<<< Content-Length: 167757
last modified: [2010-12-24 04:58:32]
<<< Connection: close
content length: [167757]
<<< Date: Tue, 11 Jan 2011 01:22:35 GMT
<<< Server: lighttpd/1.4.26
<<< 
offset 0, length -1, size -1, clength 167757
Fetching http://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8-stable/Latest/tmux.tbz...x +CONTENTS
x +COMMENT
x +DESC
x +MTREE_DIRS
x bin/tmux
x man/man1/tmux.1.gz
x share/doc/tmux/CHANGES
x share/doc/tmux/FAQ
x share/doc/tmux/NOTES
x share/examples/tmux/h-boetes.conf
x share/examples/tmux/n-marriott.conf
x share/examples/tmux/screen-keys.conf
x share/examples/tmux/t-williams.conf
x share/examples/tmux/tmux.vim
x share/examples/tmux/vim-keys.conf
tar command returns 0 status
 Done.
pkg_add: package 'tmux-1.3_1' or its older version already installed
pkg_add: 1 package addition(s) failed

The -v option shows all the gory details (verbose).
The -n enables "dry-run" mode, so nothing is actually installed, for this example.
The -r enables the remote fetch option.
 
Back
Top