FreeBSD software package management

Source: Internet
Author: User

FreeBSD software package management

Two sets of package management workers are provided under FreeBSD. The Ports Collection and Packages Collection are respectively used to manage the source and Binary Packages. The Ports Collection can be used to download, configure, compile, and fully automatic installation, ports does not store binary code and source code packages locally. Instead, it provides a local download address or method to find the software.

Portsuses a source code package ending with tar.gz. Packages uses a Binary Package ending with. tgz. Most of the Packages provided in the FreeBSD installation disk use the. tgz file format. You can easily use pkg_add for installation.

If you use MINI to install the Ports tree by default, you need to use the Administrator to install Ports:

Sysinstall --> Configure --> Distributions --> X ports --> OK --> CD/DVD will be installed soon.

The default installation directory of Ports is/usr/ports. In this directory, the software is classified into different directories. /Usr/ports is called the Ports tree.

If you only want to install the ports of a software, do not perform the above operations, you can directly find the desired file in/cdrom/packages/on the CD and decompress it to the corresponding directory of/usr/ports.

The installation disk I use is FreeBSD 7.0-RELEASE. The packages on the CD are basically the latest, because the description file is stored locally, after a long time, it will be different from the port source code of ftp.freebsd.org. For example, a version is updated. To update the local layout, just download the updated ports package and decompress it. Of course, you can also use cvsup to synchronize all source code trees and update the entire Ports Collection.

7.0-RELEASE contains 17742 software packages, which is difficult to find. We can use make print-index in the/usr/ports directory to generate a package index and redirect the output content to a file for convenient query.

Make readme generate a simple index (readme.html) for all directories in the current directory ).

Make readmes will generate the default index (readme.html) for all sub-directories under the current directory ). You can create a directory under apache to easily browse files.

Make search key = apache2 can list all packages related to apache2. This is also a method for finding software packages.

Whereis ssh

Ssh:/usr/bin/ssh/usr/share/man/man1/ssh.1.gz/usr/ports/security/ssh

You can also see the location of the ports tree where ssh is located from the returned information.

After finding the software package location, you can install it easily, such as installing ssh.

# Cd/usr/ports/security/ssh

# Make install

The following thing is waiting. ports will go to the/usr/ports/distfiles directory to find out if there is any ssh code package. If there is no ssh code package, go to the Internet to find it, if other supporting files are required during compilation, they are automatically downloaded online for compilation and installation. In the same example, the tar.gz file package is stored in/usr/ports/distfiles. It is a good idea to back up this directory. In this way, you can use ports for package installation when your machine does not have a network environment, you only need to restore the backed up file to/usr/ports/distfiles. After the installation is complete, a package installation record is written in the/var/db/pkg directory to synchronize the two package management software.

Make also has other parameters. For example, the make fetch command only takes the installation package from the Internet without compiling and installing it.

Make only compiles the software package without any parameters. This command will generate a work directory under the Directory, which includes compilation parameters, patch information, compilation steps, and an decompressed source code file.

After the installation is complete, make package generates a binary installation package installed according to the make install parameter.

Mail install without any parameters usually installs the software under/usr/local and stores the execution program in/usr/local/bin, the configuration file is stored in/usr/local/etc, and the Startup File is stored in/var/local/etc/rc. d.

You can use make deinstall to delete installed software. There are only a few tips.

Ports also supports writing another item for the whole system upgrade.

Pkg package management is mainly used to install the Binary Package on the CD

Pkg_add pkname can be installed in this format.

Usage: pkg_add [-vInfFrRMSK] [-t template] [-p prefix] [-P prefix] [-C chrootdir] pkg-name [pkg-name...]

Pkg_info can be used to view installed software packages, including those installed using ports. The command reads the information in the/var/db/pkg directory.

Usage: pkg_info [-bcdDEfgGiIjkKLmopPqQrRsvVxX] [-e package] [-l prefix]

[-T template]-a | pkg-name...

Pkg_info [-qQ]-W filename

Pkg_info [-qQ]-O origin

Pkg_info

Pkg_delete delete a package

Pkg_version: Compare the locally installed packages with the remote server to see if any updates have been made.

A simple tutorial on Rsync synchronization on FreeBSD 8

FreeBSD8.2 system installation Salt

Create FreeBSD system custom installation ISO

FreeBSD builds NAT and configures multiple VLANs on a single Nic

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.