From owner-freebsd-questions@FreeBSD.ORG Thu Dec 15 05:53:17 2005 Return-Path: X-Original-To: questions@freebsd.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0A79516A41F for ; Thu, 15 Dec 2005 05:53:17 +0000 (GMT) (envelope-from dscheidt@panix.com) Received: from mail2.panix.com (mail2.panix.com [166.84.1.73]) by mx1.FreeBSD.org (Postfix) with ESMTP id 779E143D53 for ; Thu, 15 Dec 2005 05:53:16 +0000 (GMT) (envelope-from dscheidt@panix.com) Received: from panix1.panix.com (panix1.panix.com [166.84.1.1]) by mail2.panix.com (Postfix) with ESMTP id AF9BB9D857; Thu, 15 Dec 2005 00:53:15 -0500 (EST) Received: (from dscheidt@localhost) by panix1.panix.com (8.11.6p3/8.8.8/PanixN1.1) id jBF5rGU02623; Thu, 15 Dec 2005 00:53:16 -0500 (EST) Date: Thu, 15 Dec 2005 00:53:16 -0500 From: David Scheidt To: TuxGirl Message-ID: <20051215055315.GA21685@panix.com> References: <6e4453640512142139y1768b426m5ca21b9a87cbc7ca@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6e4453640512142139y1768b426m5ca21b9a87cbc7ca@mail.gmail.com> User-Agent: Mutt/1.5.10i Cc: questions@freebsd.org Subject: Re: pkg_add not installing lsof (and other programs)? (newbie problem) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Dec 2005 05:53:17 -0000 On Wed, Dec 14, 2005 at 10:39:10PM -0700, TuxGirl wrote: > Hello, > > I installed FreeBSD for the first time tonight (I've been running > Linux for a while), and I seem to be misunderstanding pkg_add. I'm > following the instructions in the FreeBSD manual, and I ran: > > # pkg_add -r lsof > > It claimed to succeed: > Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.0-release/Latest/lsof.tbz... > Done > > then: > # lsof > lsof: Command not found. > > # echo $PATH > /sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11/R6/bin:/root/bin > > # uname -a > FreeBSD .hsd1.ut.comcast.net. 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Thu > Nov 3 09:36:13 UTC 2005 > root@x64.samsco.home:/usr/obj/usr/src/sys/GENERIC i386 > You can confirm that the package was installed by running the pkg_info command, which returns a list of all installed packages and ports. You can also look in /var/db/pkg, which is where the package database is kept. Assuming you've got it installed (which you should, pkg_add returns error messages...) you've run into a difference between the root shells in FreeBSD and Linux. The FreeBSD root user shell is tcsh. tcsh, unlike bash, scans the $PATH enviornmental variable at login to find everything, and builds a table in memory so it can quickly find and execute commands. If you install a program, the shell won't know about it. You can force it to rebuild the table by issuing the 'rehash' command. bash, on the other hand, builds its command hash table incrementally, as you execute commanads. So if you add new ones, they're found automatically. David DAvid