Showing posts with label FreeBSD. Show all posts
Showing posts with label FreeBSD. Show all posts

Searching for Application in FreeBSD’s Ports Collection

April 08, 2006 Add Comment

Searching for Application in FreeBSD’s Ports Collection




The FreeBSD Ports and Packages Collection offers a simple way for users and administrators to install applications. The number of applications in FreeBSD Ports and Packages Collection is growing with the time, which now exceeding ten thousands ports.

All Ports Collection is stored at /usr/ports directory, according to their respective category-based directory. If you know the name of the port that you need, but don’t know which category it’s located, whereis command will be helpful:

whereis file_name

For example,

# whereis phpMyAdmin
phpMyAdmin: /usr/ports/databases/phpMyAdmin

The whereis command returns the exact location of the port specified.

FreeBSD Ports Collection also has built-in search function. In /usr/ports directory (you need to be in /usr/ports directory to use the search mechanism), run make search name=program-name or make search key=keyword to search for a particular port.

For example,

# make search name=”phpMyAdmin”
# make search key=”phpMyAdmin”

Note: Without the ” and ” will work too.

Both will return details of the ports matched, if any. One of the result if “Path”, which will tell you where is the port located.

The keyword search is a more in-depth searching that searches port names, comments, descriptions and dependencies. It can be used to find ports which relate to a particular subject if you do not know the name of the program you are looking for.

Alternatively, FreeBSD also maintains an up-to-date searchable list of all the available applications, arranged by category. You can search for your application by name and browse all applications that are within the category.

FreshPorts also allowed users to search for FreeBSD’s ports by keywords. FreshPorts tracks and lists the change made to the ports tree, and allows users to watch one or more ports, and can email you when your selected port has been updated.

Easy Way to Upgrade FreeBSD’s Ports

October 09, 2005 Add Comment

Easy Way to Upgrade FreeBSD’s Ports


Before you can update and upgrade the FreeBSD’s ports, the Ports Collection needs to be updated. Follow step here to update the Ports Collection.

Once you updated your Ports Collection, before attempting a port upgrade, you should check the /usr/ports/UPDATING file. This file describes various issues and additional steps users may encounter and need to perform when updating a port.

Keeping the ports up to date can be a tedious job. Just for example, to upgrade a port you need to go to the ports directory, build the port, deinstall the old port, install the new port, and then clean up after the build. If there are numerous ports that need to be upgrade, it will be very troublesome. This was a large problem for system administrators to deal with, and FreeBSD have utilities which do this automatically, and that’s sysutils/portupgrade utility.

To install sysutils/portupgrade utility, use the command just as to install any other port: make install clean.

Create a database with the following command: pkgdb -F

The command will read the list of installed ports and create a database file in the /var/db/pkg directory.

Run portupgrade -a to start to update the ports.

The portupgrade will read the database file created by pkgdb -F and the ports INDEX file. Finally, portupgrade will begin to download, build, backup, install, and clean the ports which have been updated.

Portupgrade utility has a lot of options for different uses, the most important ones listed below.

If you want to upgrade only a certain application, not the complete database, use portupgrade pkgname, include the flags -r if portupgrade should act on all those packages depending on the given package as well, and -R to act on all packages required by the given packages.

To use packages instead of ports for installation, provide -P. With this option portupgrade searches the local directories listed in PKG_PATH, or fetches packages from remote site if it is not found locally. If packages can not be found locally or fetched remotely, portupgrade will use ports. To avoid using ports, specify -PP.

To just fetch distfiles (or packages, if -P is specified) without building or installing anything, use -F.

Note: It is important to regularly update the package database using pkgdb -F to fix inconsistencies, especially when portupgrade asks you to. Do not abort portupgrade while it is updating the package database, this will leave you an inconsistent database.