Working With Packages
I normally try to install packages whenever possible. Sometimes there's a special need that can only be addressed
by installing a port with some special make options on it, but in most cases, packages do just fine. I quote an excerpt
from 15.1 - Introduction:
Another advantage is that users rarely need to compile software from source,I have to confess I've been lazy and am still running OpenBSD 4.1, but with all applicable security patches applied. So, in ~/.profile, my package path looks like this:
as packages have already been compiled and are available and ready to be used
on an OpenBSD system. In minutes, a large number of packages can be fetched
and installed, with everything in the right place.
PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/4.1/packages/i386/And, below that, in my export line, I've tacked PKG_PATH onto the end of the line:
export PATH HOME TERM PS1 CVSROOT EDITOR FCEDIT JAVA_HOME PKG_PATHIf you don't have a PKG_PATH value set in the environment, then you should be a good typist, since you'll have to type the entire path to the package you want to install. Here's an example of what it'd look like:
sudo pkg_add -v ftp://ftp.openbsd.org/pub/OpenBSD/4.1/packages/i386/screen-4.0.3p0.tgzI don't know about you, but that's more typing than I want to do if I don't have to. I do an awful lot of work already in terminal windows as it is, since that's the way I learned early on, rather than a GUI interface, and it's become an ingrained habit.
sudo pkg_delete screenAfter you've installed and uninstalled lots of packages over a period of time, it can get confusing, trying to figure out exactly when something was installed. This happens because everytime a package is installed, the files and directories in /var/db/pkg are "touched" , effectively changing their dates to the same as when the last package that used them as dependencies was installed. To find the date on an installed package, you can do this:
ls -l /var/db/pkg/<your package name here>As stated above, the date you see using the ls method can be misleading. The date of the package's directory will probably correspond with a file inside the directory named +REQUIRED. That right there can tell you when it was "touched" last while installing another package that needed it as a dependency. Another way to tell when it was last "touched" is:
stat -f"%Sc" /var/db/pkg/<your package name here>That should give you the last change time of the inode.
pkg_info -L <your package name here>That command will tell you. Everything I've written here is just to help you get started quickly. As is preached incessantly on the mailing lists and in the forums, and, rightfully so, READ, READ, READ! Read the faqs, read the man pages, read any other accompanying documentaion you can find on a subject before running for help. I've found when I do this, I tend to remember things a lot better and am more capable of maintaining my operating on my own, than if someone just sent the answer to me and "fixed" everything for me.
No affiliation between this site and the OpenBSD project exists or is implied.