FreeBSD ports system

FreeBSD Installation tips

FreeBSD ports system

Postby stephen » Sun Apr 11, 2010 6:40 pm

The Man page for FreeBSD ports System
http://www.freebsd.org/cgi/man.cgi?query=ports&apropos=0&sektion=0&manpath=FreeBSD+5.4-RELEASE+and+Ports&format=html
Handbook for Ports system
http://www.freebsd.org/doc/en/books/handbook/ports-using.html


Update your ports system with cvsup
cd /usr/ports/net/cvsup
make install

List of installed ports
pkg_info -Ix php

or pkg_version -v


Change the host in ports-supfile to a mirror near you
eg Australia
cvsup.au.FreeBSD.org

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/cvsup.html#HANDBOOK-MIRRORS-CHAPTER-SGML-MIRRORS-AU-CVSUP
Note: One may want to use his own ports-supfile, for example to avoid the need of passing the CVSup server on the command line.

1. In this case, as root, copy /usr/share/examples/cvsup/ports-supfile to a new location, such as /root or your home directory.
2. Edit ports-supfile.
3. Change CHANGE_THIS.FreeBSD.org to a CVSup server near you. See CVSup Mirrors (Section A.6.7) for a complete listing of mirror sites.
4.

And now to run csup, use the following:

# csup -L 2 /root/ports-supfile


http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-overview.html
A downloaded package file can be manipulated with FreeBSD package management commands, such as pkg_add(1), pkg_delete(1), pkg_info(1), and so on. Installing a new application can be carried out with a single command.

http://www.freebsd.org/cgi/man.cgi?query=pkg_add&sektion=1
http://www.freebsd.org/cgi/man.cgi?query=pkg_delete&sektion=1
http://www.freebsd.org/cgi/man.cgi?query=pkg_info&sektion=1

List of ports
http://www.freebsd.org/ports/index.html

to find lsof use
# whereis lsof
lsof: /usr/ports/sysutils/lsof
or
# echo /usr/ports/*/*lsof*
/usr/ports/sysutils/lsof
or
# cd /usr/ports
# make search name="lsof"
Port: lsof-4.56.4
Path: /usr/ports/sysutils/lsof
Info: Lists information about open files (similar to fstat(1))
Maint: obrien@FreeBSD.org
Index: sysutils
B-deps:
R-deps:

4.5.2.3 Reconfiguring Ports

When building certain ports, you may be presented with a ncurses-based menu from which you can select certain build options. It is not uncommon for users to wish to revisit this menu to add, remove, or change these options after a port has been built. There are many ways to do this. One option is to go into the directory containing the port and type

make config

, which will simply present the menu again with the same options selected. Another option is to use

make showconfig

, which will show you all the configuration options for the port. Yet another option is to execute

make rmconfig

which will remove all selected options and allow you to start over. All of these options, and others, are explained in great detail in the manual page for ports(7).


Upgrading Ports
First, list outdated ports
pkg_version -v
Display outdated ports list

You can list outdated ports list with pkg_version command:
# pkg_version -vIL=
OR
# pkg_version -vIL'<'
Output:

bash-3.1.17 < needs updating (index has 3.2.17_2)
gettext-0.14.5_2 < needs updating (index has 0.16.1_3)
libtool-1.5.22_2 < needs updating (index has 1.5.22_4)
linux_base-fc-4_9 < needs updating (index has 4_10)
....
......
.

Where,

* v : Enable verbose output.
* I : Use only the index file for determining if a package is out of date (faster result)
* L= : Limit the output to those packages whose status flag does not match = (the installed version of the package is current.)
* L'<' : Limit the output to those packages whose status flag does not match < (the installed version of the package is older than the current version.)


The portupgrade utility is designed to easily upgrade installed ports. It is available from the ports-mgmt/portupgrade port. Install it like any other port, using the make install clean command:

# cd /usr/ports/ports-mgmt/portupgrade
# make install clean

Scan the list of installed ports with the
pkgdb -F
command and fix all the inconsistencies it reports

When you run
portupgrade -a

http://www.cyberciti.biz/tips/howto-keep-freebsd-system-upto-date.html
cd /usr/ports/ports-mgmt/portmanager
# make install clean

Update FreeBSD packages / software
Now run portmanager to upgrade installed ports:
# portmanager -u

To update a single package eg R
portmanager /usr/ports/math/R -u -l -f
stephen
 
Posts: 507
Joined: Thu Feb 09, 2006 9:37 am
Location: Brisbane

Return to FreeBSD

Who is online

Users browsing this forum: No registered users and 1 guest

cron