pavement

Ports, Installing

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
(Port troubleshooting. Entire books are needed on the subject. (-;)
m (Reverted edits by 212.142.143.116 (Talk); changed back to last version by Jimbo)
 
(8 intermediate revisions by 7 users not shown)
Line 11: Line 11:
 
  (listing of all the ports that have 'bash' in their '''name''')
 
  (listing of all the ports that have 'bash' in their '''name''')
 
  > '''make search key=bash'''
 
  > '''make search key=bash'''
  (listing of all the ports that have 'bash' anywhere in the description)
+
  (listing of all the ports that have 'bash' anywhere in the '''description''')
  
 
The top command will return a number of results that look something like:
 
The top command will return a number of results that look something like:
Line 29: Line 29:
 
  > '''make distclean'''
 
  > '''make distclean'''
 
  (same as clean but will remove the distfiles for the ports aswell)
 
  (same as clean but will remove the distfiles for the ports aswell)
 +
> '''make config'''
 +
(this will allow you to configure options for the port via a dialog)
 +
> '''make fetch'''
 +
(this will just download the source tarball to "/usr/ports/distfiles")
 
  > '''make extract'''
 
  > '''make extract'''
  (this will just extract the port to a ./work drectory)
+
  (this will just extract the port to a ./work directory)
 +
> '''make patch'''
 +
(this will just patch the source files)
 
  > '''make depends'''
 
  > '''make depends'''
 
  (this will install (or compile) all of the dependencies of the current port)
 
  (this will install (or compile) all of the dependencies of the current port)
Line 36: Line 42:
 
  (commands can be written in sequence like this one to install a port then distclean)
 
  (commands can be written in sequence like this one to install a port then distclean)
  
Ports can also be deinstalled easily
+
Ports can also be deinstalled easily. You can do this:
 
  > '''cd /usr/ports/shells/bash2'''
 
  > '''cd /usr/ports/shells/bash2'''
 
  > '''make deinstall'''
 
  > '''make deinstall'''
 +
But be careful, since deinstalling from the ports tree can break things if the port you are issuing ''make deinstall'' for is a dependency of any other ports. It is safer to use [[pkg_deinstall]] instead.
  
If a port can't be deinstalled or installed, verify that it is a port and not a package. If it's a port, see [[Port Install Troubleshooting]]
+
If a port can't be deinstalled or installed, verify that it is a port and not a [[Package]]. If it's a port or you're having other problems, see [[Port Install Troubleshooting]].
  
 
== External Links ==
 
== External Links ==
[http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html FreeBSD Handbook]
+
*[http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html FreeBSD Handbook]
 +
*[http://www.freshports.org/ FreeBSD software online]
  
 
[[Category:Common Tasks]]
 
[[Category:Common Tasks]]
 
[[Category:FreeBSD for Workstations]]
 
[[Category:FreeBSD for Workstations]]

Latest revision as of 15:17, 30 January 2008

See also: Ports

Installing software in FreeBSD is very easy if you use the ports tree. To use the ports tree you will first need to install it. If you have the ports tree installed on your system you should try and keep it updated with the most recent software.

Remember you can always get help with ports by typing:

> man ports

To install a specific program you can search the ports tree to see if there is a port.

> cd /usr/ports/
> make search name=bash
(listing of all the ports that have 'bash' in their name)
> make search key=bash
(listing of all the ports that have 'bash' anywhere in the description)

The top command will return a number of results that look something like:

Port:   bash-2.05b.007_2
Path:   /usr/ports/shells/bash2
Info:   The GNU Bourne Again Shell
Maint:  obrien@FreeBSD.org
B-deps: 
R-deps:

This listing tells you where the port you want to install is, in this case it is in shells/bash2. Now there are a number of things you can do to install a port such as

> cd /usr/ports/shells/bash2
> make install
(this will download, compile, and install the port and all of its dependencies)
> make clean
(this will clean up the port directory as well as dependencies after an install)
> make distclean
(same as clean but will remove the distfiles for the ports aswell)
> make config
(this will allow you to configure options for the port via a dialog)
> make fetch
(this will just download the source tarball to "/usr/ports/distfiles")
> make extract
(this will just extract the port to a ./work directory)
> make patch
(this will just patch the source files)
> make depends
(this will install (or compile) all of the dependencies of the current port)
> make install distclean
(commands can be written in sequence like this one to install a port then distclean)

Ports can also be deinstalled easily. You can do this:

> cd /usr/ports/shells/bash2
> make deinstall

But be careful, since deinstalling from the ports tree can break things if the port you are issuing make deinstall for is a dependency of any other ports. It is safer to use pkg_deinstall instead.

If a port can't be deinstalled or installed, verify that it is a port and not a Package. If it's a port or you're having other problems, see Port Install Troubleshooting.

[edit] External Links

Personal tools