View Single Post
  #1   (View Single Post)  
Old 6th September 2011
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default OpenBSD: Installing package collections in bulk for KDE, Gnome, or XFCE

Many users, particularly those who use one of the popular integrated GUI environments, want to be able to install the entire suite of tools, rather than selecting individual packages.

For my live media images, I installing complete package sets a dozen times a year. I have adapted my process for use by the typical OpenBSD user.

Step 1. Install the ports tree in /usr/ports

Follow the guidance for your flavor of OpenBSD given in FAQ 15.3.2. This may be as simple as unpacking a tarball from a purchased CD or a nearby FTP server.

Step 2: Create (or edit) /etc/mk.conf

add:

TRUST_PACKAGES=Yes
FETCH_PACKAGES=Yes

The TRUST_PACKAGES variable will tell the ports subsystem to use pre-made packages if they have been built. The FETCH_PACKAGES variable will instruct the ports system to use your PKG_PATH to look for available packages.

Step 3: Change your working directory to the branch of the tree containing the package suite you want to install.

For example:

# cd /usr/ports/x11/gnome

Step 4: Examine and edit the Makefile in that directory.

It will list all of the packages to be installed, one per line.

  • You may want to edit the list to remove packages you expressly do not want installed.
  • You may need to remove one or more packages from the list because not all of them can be simultaneously installed. For example, multiple flavors of the same application cannot be installed at the same time. Or, if you use XFCE, you will discover you can have either notification-daemon-xfce or xfce4-notifyd installed, but not both.
When editing, it is best practice to copy "Makefile" to "makefile", and make your edits to "makefile" -- the make program looks for "makefile" first before looking for "Makefile" -- this way, you will retain the original Makefile as a backup.

# cp Makefile makefile
# vi makefile (or choose your favorite editor)

Step 5: Install the package suite

# env NO_DEPENDS=Yes make install

I put the environment variable NO_DEPENDS in the command line here, rather than in /etc/mk.conf, because sometimes you actually want to use the ports tree to build ports. (Or, you may forget you have that in /etc/mk.conf and wonder why your ports tree is broken.)

In this case, you aren't building ports.

NO_DEPENDS is used primarily for research, and is never used when actually building ports. You are just taking advantage of it to direct package installs. The ports system will do a pkg_add, using your $PKG_PATH for each package listed in the makefile or Makefile.
Reply With Quote