Using Portsnap to Update FreeBSD Ports Tree Collection Sử dụng Portsnap để cập nhật cây FreeBSD Ports Bộ sưu tập

Portsnap is a alternative system for securely distributing and updating the FreeBSD ports tree, which is easier to use than CVSup. Portsnap là một hệ thống thay thế cho cách an toàn, phân phối và cập nhật các FreeBSD cổng cây, được dễ dàng hơn để sử dụng hơn CVSup. Portsnap was first included in FreeBSD 6.0. Portsnap lần đầu tiên được bao gồm trong FreeBSD 6.0. Like CVSup, Portsnap uses a pull model of updating: The packaged and signed ports trees are placed on a web server which waits passively for clients to request files by either run portsnap manually by users or set up a cron job to download updates automatically on a regular basis. Giống như CVSup, Portsnap sử dụng một mô hình pull cập nhật: Những đóng gói và ký kết các cổng cây được đặt trên một máy chủ web mà thụ động chờ đợi cho khách hàng để yêu cầu các tập tin bằng cách portsnap chạy bằng tay bởi người dùng hoặc thiết lập một công việc cron để tải về bản cập nhật tự động trên một thường xuyên cơ sở.

On older FreeBSD systems, Portsnap is not automatically included, but it can be installed from sysutils/portsnap port by using command: Trên hệ thống cũ hơn FreeBSD, Portsnap không phải là tự động bao gồm, nhưng nó có thể được cài đặt từ sysutils / cổng portsnap bằng cách sử dụng lệnh:

# pkg_add -r portsnap # Pkg_add-r portsnap

Portsnap first fetch and update compresses snapshots of the FreeBSD ports tree stored in /var/db/portsnap/ (in /usr/local/portsnap/ if Portsnap is installed from FreeBSD Ports Collection) by default, and then only extract and update the uncompressed live ports tree at /usr/ports. Portsnap đầu tiên lấy và cập nhật nén ảnh chụp nhanh của cây cổng FreeBSD được lưu trong / var / db / portsnap / (trong / usr / local / portsnap / Portsnap nếu được cài đặt từ FreeBSD Ports Bộ sưu tập) theo mặc định, và sau đó chỉ trích xuất và cập nhật không nén sống tại các cảng cây thư mục / usr / cổng.

The behaviour and operation of Portsnap is controlled by configuration file portsnap.conf located in /etc (in /usr/local/etc/ if Portsnap is installed from the FreeBSD Ports Collection, and the configuration file is not automatically generated when freshly installed, instead you'll found portsnap.conf.sample, just copy it as portsnap.conf). Các hành vi và hoạt động của Portsnap được điều khiển bởi portsnap.conf tập tin cấu hình nằm trong / etc (trong / usr / local / etc / Portsnap nếu được cài đặt từ Ports FreeBSD Bộ sưu tập, và tập tin cấu hình không được tự động tạo ra khi cài đặt tươi, thay vì bạn sẽ tìm thấy portsnap.conf.sample, chỉ cần chép nó như portsnap.conf). Generally, default configuration file will does its jobs. Nói chung, tập tin cấu hình mặc định sẽ làm công việc của mình.

At command line, the following options are supported, although most of the time it no need to be used, some can be configured in configuration file itself: Tại dòng lệnh, các tùy chọn sau đây được hỗ trợ, mặc dù phần lớn thời gian không cần phải được sử dụng, một số có thể được cấu hình trong tập tin cấu hình chính nó:

-d workdir : Store working files (eg downloaded updates) in workdir. -d workdir: Store tập làm việc (ví dụ như cập nhật tải về) trong workdir. (default: /var/db/portsnap, or as given in the configuration file) (mặc định: / var / db / portsnap, hoặc là được đưa ra trong tập tin cấu hình)

-f conffile : Read the configuration from from conffile. -f conffile: Đọc cấu hình từ từ conffile. (default: /etc/portsnap.conf) (mặc định: / etc / portsnap.conf)

-I : For the update command, update INDEX files, but not the rest of the ports tree. -I: Đối với các lệnh cập nhật, cập nhật các tập tin INDEX, nhưng không phải là phần còn lại của cây cổng.

-k KEY : Expect a public key with given SHA256 hash. -k Key: Yêu cầu một khóa công khai với hash SHA256 nhất định. (default: read value from configuration file) (mặc định: đọc giá trị từ tập tin cấu hình)

-p portsdir : When extracting or updating an uncompressed snapshot, operate on the directory portsdir. -p portsdir: Khi giải nén hoặc cập nhật một ảnh chụp không nén, hoạt động trên portsdir thư mục. (default: /usr/ports/, or as given in the configuration file.) (mặc định: / usr / cổng /, hoặc như được đưa ra trong tập tin cấu hình.)

-s server : Fetch files from the specified server or server pool. -s máy chủ: Fetch tập tin từ máy chủ xác định hoặc hồ bơi máy chủ. (default: portsnap.FreeBSD.org , or as given in the configuration file.) (mặc định: portsnap.FreeBSD.org, hoặc là được đưa ra trong tập tin cấu hình.)

path : For extract command only, operate only on parts of the ports tree starting with path. đường dẫn: Đối với lệnh chỉ trích, hoạt động chỉ trên các bộ phận của cây cổng bắt đầu từ con đường. (eg portsnap sysutils/port would extract sysutils/portsman, sysutils/portsnap, sysutils/portupgrade, etc.) (ví dụ như sysutils portsnap / cảng sẽ trích sysutils / portsman, sysutils / portsnap, sysutils / portupgrade, vv)

The Synopsis for the Portsnap command line is: Nội dung cho các dòng lệnh Portsnap là:

portsnap [-I] [-d workdir] [-f conffile] [-k KEY] [-p portsdir] [-s server] command … [path] portsnap [-I] [-d workdir] [-f conffile] [-k KEY] [-p portsdir] [-s máy chủ] lệnh ... [đường dẫn]

Usage of Portsnap Cách sử dụng của Portsnap

  1. Create an empty directory /usr/ports if it does not exists. Tạo một thư mục trống / usr / cổng nếu nó không tồn tại.

    # mkdir /usr/ports # Mkdir / usr / cổng

  2. Fetch and download a compressed snapshot of the Ports Collection into /var/db/portsnap (or any other location specified in configuration file). Fetch và tải về một bản chụp nén của Bộ sưu tập Ports vào / var / db / portsnap (hoặc bất cứ địa điểm khác quy định trong tập tin cấu hình). Internet connection needed at this stage) and update the existing snapshot. Kết nối Internet cần thiết trong giai đoạn này) và cập nhật các bản chụp hiện có.

    # portsnap fetch # Portsnap tìm nạp

  3. If you are running Portsnap for the first time (even if a ports tree has already been created or populated, to let Portsnap establishes a baseline from which portsnap can determine which parts of the ports tree need to be updated) or /usr/ports hasn't been populated, extract the snapshot and replaces the existing files and directories, and establishes Portsnap-maintained ports tree into /usr/ports: Nếu bạn đang chạy Portsnap cho lần đầu tiên (ngay cả khi một cây cổng đã được tạo hoặc dân cư, để cho Portsnap thiết lập một đường cơ sở mà từ đó portsnap có thể xác định ra các phần của cây cổng cần phải được cập nhật) hoặc / usr / cổng hasn 't được dân cư, trích xuất các ảnh chụp nhanh và thay thế các tập tin và thư mục hiện hành, và thiết lập Portsnap-duy trì cây cổng vào / usr / ports:

    # portsnap extract # Portsnap giải nén

    This step can be skipped if you're only updating the ports tree. Bước này có thể được bỏ qua nếu bạn chỉ cập nhật các cây cổng.

  4. If you already have a populated /usr/ports and you are just updating, run the following command instead: Nếu bạn đã có một dân cư / usr / cổng và bạn chỉ cần cập nhật, chạy lệnh sau đây thay vì:

    # portsnap update # Cập nhật portsnap

Note: For updating of FreeBSD Ports Tree, step 1 and 3 can be combined into single command: portsnap fetch update (not support in older version of Portsnap). Lưu ý: Để cập nhật của cây FreeBSD Ports, bước 1 và 3 có thể được kết hợp trong những lệnh đơn: portsnap lấy cập nhật mới nhất (không hỗ trợ trong phiên bản cũ của Portsnap).

Running Portsnap as Cron Job Chạy Portsnap như công việc định kỳ

portsnap fetch will not be able to execute from a cron job to avoid burden of sudden surge of downloading request to Portsnap servers. portsnap tìm nạp sẽ không thể thực hiện từ một công việc cron để tránh gánh nặng tăng đột ngột của tải yêu cầu Portsnap máy chủ. Instead, a special portsnap cron command exists, which waits and sleeps for a random duration up to 3600 seconds before fetching updates, as if the fetch command is specified. Thay vào đó, một portsnap lệnh cron đặc biệt tồn tại, mà chờ đợi và ngủ trong một thời gian ngẫu nhiên lên đến 3.600 giây trước khi lấy thông tin cập nhật, vì nếu lấy lệnh được chỉ định.

To run portsnap automatically with cron job, just add the line into /etc/crontab (the line set the time to 3 AM everyday, you can choose your own timing): Để chạy portsnap tự động với công việc cron, chỉ cần thêm dòng vào / etc / crontab (dòng đặt thời gian tới 03:00 hàng ngày, bạn có thể chọn thời gian riêng của bạn):

0 3 * * * root /usr/sbin/portsnap cron 0 3 * * * root / usr / sbin / portsnap cron

This will ensure that the FreeBSD snapshot of ports collection is always up-to-date and can be quickly extracted into /usr/ports. Điều này sẽ đảm bảo rằng các ảnh chụp FreeBSD cảng bộ sưu tập là luôn luôn up-to-date và có thể nhanh chóng nhổ vào / usr / cổng.

Note: Running portsnap update from cron is not recommended as it may cause problem if installing or updating of a port happens at the time the cron job runs. Lưu ý: Chạy cập nhật portsnap từ cron không nên vì nó có thể gây ra vấn đề nếu cài đặt hoặc cập nhật của một cổng xảy ra tại thời điểm công việc cron chạy. Portsnap will updates or removes files which are being used by the port build. Portsnap sẽ cập nhật hoặc loại bỏ các tập tin mà đang được sử dụng bởi các cảng xây dựng. However, running portsnap -I update to update the ports Index files is possible, and can be used together with portversion to identify installed software which is out of date. Tuy nhiên, chạy portsnap-tôi cập nhật để cập nhật các cổng Index tập tin là có thể, và có thể được sử dụng cùng với portversion để xác định cài đặt phần mềm có lực.

To update ports compressed snapshot and the INDEX files in /usr/ports/, and send an email if any installed ports are out of date, use the following line in /etc/crontab: Để cập nhật các cảng và các tập tin nén ảnh chụp của INDEX trong / usr / cổng /, và gửi một email nếu có cổng được cài đặt trên ngày, sử dụng các dòng sau trong / etc / crontab:

0 3 * * * root portsnap -I cron update && pkg_version -vIL= 0 3 * * * root portsnap-cập nhật cron tôi & & pkg_version-Vil =

Note: Older version of portsnap does not support listing multiple commands (eg, cron update) in the same invocation of portsnap. Lưu ý: Cu hơn phiên bản của portsnap không hỗ trợ nhiều danh sách các lệnh (ví dụ, cron cập nhật) trong invocation cùng portsnap. If the line above fails, try replacing portsnap -I cron update with portsnap cron && portsnap -I update. Nếu dòng ở trên không, hãy thử thay thế portsnap-cập nhật cron tôi với cron portsnap & & portsnap-tôi cập nhật.

IMPORTANT : The page is machine translated and provided "as is" without warranty. Quan trọng: Sửa là máy dịch và cung cấp "như là" không có bảo hành. Machine translation may be difficult to understand. Máy dịch thuật có thể khó hiểu. Please refer to Vui lòng tham khảo original English article bản gốc tiếng Anh bài viết whenever possible. bất cứ khi nào có thể.


One Response to “Using Portsnap to Update FreeBSD Ports Tree Collection” Một phản ứng để "Sử dụng Portsnap để cập nhật FreeBSD Ports Cây Bộ sưu tập"

  1. Managing FreeBSD Ports « UNIX Administratosphere Quản lý FreeBSD Ports «UNIX Administratosphere
    February 9th, 2008 18:04 9 tháng 2 2008 18:04
    1 1

    [...] at My Digital Life, there is an excellent tutorial on using portsnap. [...] Lúc Digital Life của tôi, có một hướng dẫn tuyệt vời về cách sử dụng portsnap. It covers not only the basics, but all the rest as [...] Nó bao gồm không chỉ là vấn đề cơ bản, nhưng tất cả phần còn lại là [...]

Leave a Reply Để lại một trả lời

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> Bạn có thể sử dụng các thẻ: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q <strike> <strong>

Subscribe to comments feature has been disabled. Thuê bao với ý kiến đều đã bị vô hiệu hoá. To receive notification of latest comments posted, subscribe to Để nhận được thông báo mới nhất đăng ý kiến, đăng ký với My Digital Life Comments RSS feed My Digital Life kiến RSS feed or hoặc register to receive đăng ký để nhận được new comments in daily email digest. Các ý kiến mới trong email tiêu hàng ngày.
Custom Search

New Articles Bài viết mới

Incoming Search Terms for the Article Tìm đến các Điều khoản Điều

freebsd portsnap freebsd portsnap - -- FreeBSD update ports tree FreeBSD cập nhật cổng cây - -- Please update your ports tree and try again. Vui lòng cập nhật các cảng của cây và thử lại. - -- Please update your ports tree and try again Vui lòng cập nhật các cảng của cây và thử lại - -- update ports tree cập nhật các cổng cây - -- portsnap update portsnap cập nhật - -- freebsd update port tree freebsd cập cảng cây - -- how to update ports tree làm thế nào để cập nhật các cổng cây - -- portsnap freebsd 7 portsnap freebsd 7 - -- portsnap cron portsnap cron - -- portsnap tutorial portsnap hướng dẫn - -- portsnap freebsd portsnap freebsd - -- update ports tree freebsd cây cập nhật cổng freebsd - -- portsnap portsnap - -- updating freebsd ports cập nhật các cảng freebsd - -- portsnap fetch update portsnap lấy cập nhật - -- => Please update your ports tree and try again. => Xin vui lòng cập nhật các cảng của cây và thử lại. - -- freebsd 7 portsnap freebsd 7 portsnap - -- update port tree freeBSD cập nhật cây cổng FreeBSD - -- update freebsd ports tree Cập nhật freebsd cổng cây - -- freebsd portsnap cron freebsd portsnap cron - -- "Please update your ports tree and try again." "Hãy cập nhật các cảng của cây và thử lại." - -- portsnap fetch failed portsnap bị tắt - -- update port tree cập nhật cây cảng - -- freebsd updating ports tree freebsd cập nhật cổng cây - -- portsnap usage portsnap sử dụng - -- portsnap howto portsnap howto - -- freebsd ports tree update freebsd cổng cây cập nhật - -- freebsd upgrade port tree freebsd nâng cấp cảng cây - -- freebsd port tree update freebsd cổng cây cập nhật - -- fetching public key from portsnap failed lấy khóa công khai từ portsnap thất bại - -- Fetching public key from portsnap.FreeBSD.org... Lấy khóa công khai từ portsnap.FreeBSD.org ... failed. thất bại. - -- Please update your ports tree Vui lòng cập nhật các cảng của cây - -- freebsd portsnap server freebsd portsnap máy chủ - -- Please update your ports tree and try again. Vui lòng cập nhật các cảng của cây và thử lại. - -- freebsd ports update tree cổng freebsd cập nhật cây - -- portsnap fetch extract portsnap lấy giải nén - -- portsnap: Command not found portsnap: Lệnh không được tìm thấy - -- portsnap failed portsnap thất bại - -- portsnap portupgrade portsnap portupgrade - -- ports tree update cổng cây cập nhật - -- how to update port tree làm thế nào để cập nhật cây cảng - -- freebsd please update your ports tree and try again freebsd vui lòng cập nhật các cảng của cây và thử lại - -- freebsd how to update ports tree freebsd làm thế nào để cập nhật các cổng cây - -- freebsd upgrade ports tree freebsd nâng cấp cảng cây - -- freebsd update ports freebsd cập nhật các cảng - -- freebsd portsnap update freebsd portsnap cập nhật - -- "Please update your ports tree and try again" "Hãy cập nhật các cảng của cây và thử lại" - -- updating ports tree cập nhật các cổng cây - -- Please update your ports tree and try again. Vui lòng cập nhật các cảng của cây và thử lại. freebsd freebsd - --