Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Mar 2000 21:32:24 -0600
From:      David Kelly <dkelly@hiwaay.net>
To:        "John Daniels" <jmd526@hotmail.com>
Cc:        bduk@earthlink.net, freebsd-questions@FreeBSD.ORG, freebsd-ports@FreeBSD.ORG
Subject:   Re: Ports questions 
Message-ID:  <200003240332.VAA19729@nospam.hiwaay.net>
In-Reply-To: Message from "John Daniels" <jmd526@hotmail.com>  of "Thu, 23 Mar 2000 11:49:58 EST." <20000323164958.68173.qmail@hotmail.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
"John Daniels" writes:
> Hi:
> Thanks for the reply.
> 
> I am trying to get a better handle on how ports functions.  I still don't 
> quite 'get it.'  If I use pkg_delete, then only that specific package is 
> deleted?

Correct.

> None of the additional packages that were added as dependencies 
> will be deleted?  So I have to delete each of these dependent applications 
> individually?  Does ports keep a list of the dependent applications 
> somewhere so I know what was installed (and thus, what I would need to 
> delete)?

Yes, but the ports system stores this information outside of the port. 
Just for kicks try, "more /var/db/pkg/XFree86-3.3.6/+REQUIRED_BY" 
(assuming you have installed X, and that particular version) and you'll 
see a listing of all the ports who have declared that they depend on 
XFree86 to function. Pkg_delete won't delete until this list is empty 
unless you force it with -f.

So, if you are determined to completely clean up after a pkg_delete, 
then, "cd /var/db/pkg; ls -lt | more" look for the ports who recently 
changed their directory's "modified" date. Those ports are candidates 
for removal because their "+REQUIRED_BY" file was removed by your 
removal of a port.

Lets say on a new FreeBSD system w/o XFree86 you decide to install
Netscape which depends on XFree86. The install of Netscape casues
XFRee86 to be installed too. Later you decide exmh2 is a better email
client so it installs tcl and tk (and lots of other things), and tk
indicates it depends on XFree86. Then if you decide to pkg_delete
Netscape you wouldn't want to pkg_delete XFree86 too because other
packages have come to depend on it. Not to mention *you* might happen 
to be using XFree86 directly.

When the last package to depend on another package is deleted, the 
+REQUIRED_BY file is deleted from that other package. This alters the 
directory modify time in /var/db/pkg/<whatever_package_it_was>

> If I wanted to delete an application which another application 
> depends on, would I get a warning/option to discontinue?, or would ports 
> just rebuild the app the next time I started the xyz port which depends on 
> the deleted app?

Yes, you are warned, no, missing ports are not automatically 
re-installed.

# pkg_delete XFree86-3.3.6
pkg_delete: package `XFree86-3.3.6' is required by these other packages
and may not be deinstalled:
xpm-3.4k
fvwm-2.2.2
netscape-communicator-4.7.us
tk-8.2.3
xloadimage-4.1
metamail-2.7
[...its a big list]

> Wouldn't it seem that if ports were really 'smart' that it would have an 
> associated database that kept track of dependencies so that when a 
> port/package is deleted it would prompt the user for permission to delete 
> each of the dependent apps that are not needed by other apps on the system?  
> This might be only a minor issue for experienced users but it would give 
> newbies more confidence in using ports.

Just how is it supposed to know you only use XFree86 with Netscape? If 
you are determined to delete "unneeded" ports simply visit /var/db/pkg 
and pkg_delete everything you don't know what it does. If somebody 
needs it then it will tell you exactly who (see above) and you can 
decide to pkg_delete them too or not.

Speaking of smart, I want a button on my keyboard labeled, DWIM NWIT, 
Do What I Meant Not What I Typed.

> Where can I find good/comprehensive documentation on ports?

man ports

Also Greg Lehey's FreeBSD book.

FreeBSD Handbook, file:///usr/share/doc/handbook/handbook.html

Also might install /usr/ports/sysutils/pib (Port Index Browser) which is
a GUI to the ports system. Pib is the best way I know of to play 
/usr/ports/* against /usr/ports/distfiles/* to find out what ports have
been updated since I last downloaded (and presumably installed) them.


--
David Kelly N4HHE, dkelly@hiwaay.net
=====================================================================
The human mind ordinarily operates at only ten percent of its
capacity -- the rest is overhead for the operating system.




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200003240332.VAA19729>