How to install software with maximum efficiency under FREEBSD

Source: Internet
Author: User

The default download tool for FreeBSD is fetch, which is slow and not easy to use. There are some very efficient ways to install software under FreeBSD, let me introduce you to the following.

Ports mechanism

First, the most distinctive software installation and upgrade mechanism under FreeBSD is ports, which is both convenient and efficient. Let's start with the installation of the ports kit, which gives you a detailed understanding of every detail of the ports

One, the installation of the ports kit

① my FreeBSD 8.0-release is minimal installation, so there is neither ports nor/usr/ports directory. If you choose to enable ports, you need to enter "Sysinstall" under Root to install it:

Enter Sysinstall--Select Configure--distributions--and ports, then install.

The default path for ②ports is/usr/ports. The root directory of this ports has a lot of folders and subfolders, which form a tree-like directory that contains a lot of software under ports. For example, mail Service software, games is the game, www represents the Web services software, databases is the database software.

[[Email protected]/usr/ports]# CD Www[[email protected]/usr/ports/www]# ls-d apache*apache-contrib apache13 apache13-m Odssl+ipv6apache-forrest Apache13+ipv6 Apache13-sslapache-jserv Apache13-modperl apache20apache-mode.el Apache13-modssl Apache22

If you need to install any software, just go to the current directory and then "make install clean".

[[email protected] ~]# Cd/usr/ports/www/apache22[[email protected]/usr/ports/www/apache22] make install clean

/usr/ports/distfiles is the folder where the package is stored. Ports will first check the/usr/ports/distfiles directory for this package, if not it will automatically download the installation from the Internet.

Second, accelerate the upgrade speed of ports

Ports download the package automatically from the Internet, then download it from there? First, we need to install Axel to replace the default download tool fetch, which can improve the installation speed of ports:

Cd/usr/ports/ftp/axelmake Install

Then, we need a source address management. Like the/etc/source.list file on Ubuntu, FreeBSD files are/etc/make.conf, and we can modify their files to speed up the download.

#修改/et/make.confvi/etc/make.conf# Add the following fetch_cmd=axelfetch_before_args=-n 10-afetch_after_args=disable_size= yesmaster_site_override?=http://ports.hshh.org/${dist_subdir}/http://ports.cn.freebsd.org/${dist_subdir}/ftp:/ /ftp.freebsdchina.org/pub/freebsd/ports/distfiles/${dist_subdir}/master_site_override?=${master_site_backup}       

After this processing, in the company's network environment, the download speed of FreeBSD significantly improved, sometimes incredibly can achieve 1m/s, so upgrade and install software convenient extremely; hehe, finally can get rid of the turtle speed of fetch.

Third, update the Ports directory tree

Since ports's tree directory is all downloaded locally, the local directory tree will not be updated even if FreeBSD has a new package or new software. So, we need to update the local directory tree every once in a while. Let me introduce a quick and easy way to update ports in FreeBSD: Use PORTSNAP to update the ports directory tree.

① Configuration Portsnap:

We use PORTSNAP, first to set up its configuration file, located in/etc/portsnap.conf:

[Email protected]/usr/ports]# vi/etc/portsnap.conf

Put

servername=portsnap.freebsd.org

Modified to:

servername=portsnap.hshh.org

This is his update server. In addition, there are several domestic PORTSNAP servers:

portsnap.hshh.org

portsnap2.hshh.org

Portsnap3.hshh.org (Netcom)

portsnap4.hshh.org

② first use of Portsnap:

The first use of PORTSNAP in your FreeBSD must perform the following 2 steps:

[Email protected] ~]# portsnap fetch[[email protected] ~]# Portsnap extract

Portsnap Fecth is the latest compressed package to get Portsnap snapshot from the Internet, it is heard that the official compressed package is not updated once.

Portsnap extract is the creation of this compact package to/usr/ports. Even if you have already installed the ports manually, he will be re-established.

(Note: These 2 steps can be synthesized using the instructions for [[email protected] ~]# Portsnap fetch extract)

③ Use the Portsnap update later, you only need to perform the following 2 steps:

[[email protected] ~]# portsnap fetch[[email protected] ~]# portsnap update

Again, these 2 steps can be synthesized using: [[email protected] ~]# PORTSNAP Fetch update

Portsnap The first time you run the extract command, it may take a while for the update to be updated with a lot faster.

How to install software with maximum efficiency under FREEBSD

Related Article

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.