Using Portsnap to Update FreeBSD Ports Tree Collection Paggamit ng Portsnap sa I-update ang Tree FreeBSD port Collection
Portsnap is a alternative system for securely distributing and updating the FreeBSD ports tree, which is easier to use than CVSup. Portsnap ay isang alternatibong sistema para sa ligtas at pamamahagi ng mga pag-update ng mga puno ng mga "ports" FreeBSD, na kung saan ay mas madaling gamitin kaysa sa CVSup. Portsnap was first included in FreeBSD 6.0. Portsnap ay unang kasama sa 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. Tulad ng CVSup, Portsnap ay gumagamit ng isang pull modelo ng mga pag-update ng: Ang mga nakabalot at pinirmahan mga "ports" na puno ay ilagay sa isang web server na kung saan hihintayin ng passively para sa mga kliyente sa kahilingan ng mga file sa pamamagitan ng alinman sa portsnap magpatakbo ng mano-mano sa pamamagitan ng mga user o set up ng isang cron job mag-download ng mga update awtomatikong sa isang regular na batayan.
On older FreeBSD systems, Portsnap is not automatically included, but it can be installed from sysutils/portsnap port by using command: Sa mga mas lumang mga sistema ng FreeBSD, Portsnap ay hindi awtomatikong kasama, ngunit maaari itong ma-install mula sa sysutils / portsnap port pamamagitan ng paggamit ng utos:
# 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 unang sunduin at i-update snapshots compresses ng mga "ports" na puno ng FreeBSD na naka-imbak sa / var / db / portsnap / (sa / usr / local / portsnap / kung Portsnap ay nai-install mula sa FreeBSD port Collection) sa pamamagitan ng default, at pagkatapos lamang kunin at i-update ang uncompressed mabuhay "ports" na puno sa / usr / port.
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). Ang pag-aasal at operasyon ng Portsnap ay kinokontrol ng configuration file portsnap.conf matatagpuan sa / etc (sa / usr / local / etc / kung Portsnap ay nai-install mula sa mga "ports" na FreeBSD Collection, at ang configuration file ay hindi awtomatikong nakabuo kapag sariwa na naka-install, sa halip na makikita mo natagpuan portsnap.conf.sample, kopyahin lamang ito bilang portsnap.conf). Generally, default configuration file will does its jobs. Kadalasan, ang mga file na default configuration ay ang kanyang trabaho.
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: Sa utos ng linya, ang mga sumusunod na opsyon ay suportado, bagaman karamihan ng mga oras na ito hindi na kailangan na gagamitin, ang ilan ay maaaring isinaayos sa configuration file mismo:
-d workdir : Store working files (eg downloaded updates) in workdir. -d workdir: Store gumawa ng mga file (gaya ng nai-download ng mga update) sa workdir. (default: /var/db/portsnap, or as given in the configuration file) (default: / var / db / portsnap, o bilang na ibinigay sa configuration file)
-f conffile : Read the configuration from from conffile. -f conffile: Basahin ang pagsasaayos mula sa mula sa conffile. (default: /etc/portsnap.conf) (default: / etc / portsnap.conf)
-I : For the update command, update INDEX files, but not the rest of the ports tree. -Ako: Para sa mga utos-update, i-update ang file na INDEX, ngunit hindi ang magpahinga ng ang mga puno ng mga "ports".
-k KEY : Expect a public key with given SHA256 hash. k-susi: Asahan isang pampublikong susi na may ibinigay na SHA256 sumira. (default: read value from configuration file) (default: basahin ang halaga mula sa configuration file)
-p portsdir : When extracting or updating an uncompressed snapshot, operate on the directory portsdir. -p portsdir: Kapag extracting o pag-update ng isang uncompressed na kuha, gumana sa portsdir direktoryo. (default: /usr/ports/, or as given in the configuration file.) (default: / usr / port /, o bilang na ibinigay sa configuration file.)
-s server : Fetch files from the specified server or server pool. -s server: Fetch mga file mula sa ibinigay na server o server pool. (default: portsnap.FreeBSD.org , or as given in the configuration file.) (default: portsnap.FreeBSD.org, o bilang na ibinigay sa configuration file.)
path : For extract command only, operate only on parts of the ports tree starting with path. landas: Para sa mga katas na utos lamang, gumana lamang sa mga bahagi ng mga "ports" na puno na nagsisimula sa landas. (eg portsnap sysutils/port would extract sysutils/portsman, sysutils/portsnap, sysutils/portupgrade, etc.) (eg portsnap sysutils / port ay kunin sysutils / portsman, sysutils / portsnap, sysutils / portupgrade, atbp)
The Synopsis for the Portsnap command line is: Ang Buod para sa linya Portsnap command ay:
portsnap [-I] [-d workdir] [-f conffile] [-k KEY] [-p portsdir] [-s server] command … [path] portsnap [ako-] [-d workdir] [-f conffile] [-key k] [-p portsdir] [-s server] command ... [path]
Usage of Portsnap Paggamit ng Portsnap
- Create an empty directory /usr/ports if it does not exists. Gumawa ng isang walang laman na direktoryo ng / usr / "ports" na kung ito ay hindi umiiral.
# mkdir /usr/ports # Mkdir / usr / port
- Fetch and download a compressed snapshot of the Ports Collection into /var/db/portsnap (or any other location specified in configuration file). Fetch at i-download ng isang compressed snapshot ng mga "ports" Collection sa / var / db / portsnap (o anumang iba pang mga lokasyon na tinukoy sa configuration file). Internet connection needed at this stage) and update the existing snapshot. Koneksyon sa Internet na kailangan sa stage na ito) at i-update ang umiiral na snapshot.
# portsnap fetch # Portsnap sunduin
- 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: Kung nagpapatakbo ka ng Portsnap para sa unang panahon (kahit na kung ang isang "ports" na puno ang nai-ginawa o sa tao, upang ipaalam sa Portsnap nagtatatag ng baseline na kung saan portsnap maaaring matukoy kung aling mga bahagi ng puno ng mga "ports" na kailangan upang ma-update) o sa / usr / "ports" na hasn 't ay napupunan, kunin ang snapshot at pumapalit sa mga umiiral na mga file at direktoryo, at nagtatatag ng Portsnap-pinananatili "ports" na puno sa / usr / port:
# portsnap extract # Portsnap gata
This step can be skipped if you're only updating the ports tree. Ang hakbang na ito ay maaaring Nilaktawan kung lamang ka pag-update ng mga "ports" na punong kahoy.
- If you already have a populated /usr/ports and you are just updating, run the following command instead: Kung ikaw ay mayroon ng isang tao / usr / "ports" na lamang at ikaw ay pag-update, patakbuhin ang mga sumusunod na utos sa halip na:
# portsnap update # Portsnap i-update
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). Paalala: Para sa mga pag-update ng mga "ports" na FreeBSD Tree, hakbang 1 at 3 ay pinagsama sa isang utos: portsnap sunduin i-update ang (hindi sumusuporta sa mas lumang bersyon ng Portsnap).
Running Portsnap as Cron Job Tumatakbo Portsnap bilang cron Job
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 sunduin ay hindi maaaring ma-execute mula sa isang trabaho cron upang maiwasan ang mga pasanin ng biglang silakbo ng pag-download ng kahilingan sa Portsnap server. 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. Sa halip, ang isang espesyal na command portsnap cron umiiral, na kung saan hihintayin at sleeps para sa isang random na panahon hanggang sa 3600 segundo bago ang pagkuha ng mga update, gaya ng kung ang sunduin utos ay tinukoy.
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): Upang patakbuhin ang portsnap awtomatikong may cron job, idagdag lamang ang mga linya sa / etc / crontab (linya sa set ang oras sa 3 araw-araw, maaari mong piliin ang iyong sariling tiyempo):
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. Ito ay matiyak na ang mga FreeBSD na kuha ng mga "ports" na koleksyon ay laging up-to-date at maaaring mabilis na nakuha sa / usr / port.
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. Tandaan: Tumatakbo portsnap i-update mula sa cron ay hindi inirerekomenda bilang ito ay maaaring maging sanhi ng problema kung ang pag-install o pag-update ng isang port ang mangyayari sa oras ang cron job tumatakbo. Portsnap will updates or removes files which are being used by the port build. Portsnap ay mga update o alisin ang mga file na kung saan ginagamit ng port build. 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. Gayunman, tumatakbo portsnap-update ko na i-update ang mga "ports" na Index mga file ay posible, at maaaring gamitin kasama ng portversion upang makilala ang naka-install na software na ito ay luma na.
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: Upang i-update "ports" na compressed na kuha at ang INDEX file sa / usr / port /, at magpadala ng isang email kung anumang naka-install na port ay luma na, gamitin ang sumusunod na linya sa / etc / crontab:
0 3 * * * root portsnap -I cron update && pkg_version -vIL= 0 3 * * * * * * * ugat portsnap-ko cron i-update & & pkg_version-Vil =
Note: Older version of portsnap does not support listing multiple commands (eg, cron update) in the same invocation of portsnap. Tandaan: Ang lumang bersyon ng portsnap ay hindi sumusuporta sa listahan ng maramihang mga utos (halimbawa, i-update ang cron) sa parehong pananalangin ng portsnap. If the line above fails, try replacing portsnap -I cron update with portsnap cron && portsnap -I update. Kung ang linya sa ibabaw nabigo, subukan pagpapalit portsnap-ko-update ang cron sa portsnap cron & & portsnap-update ko.
IMPORTANT : The page is machine translated and provided "as is" without warranty. MAHALAGA: Ang pahina ng makina ay isinalin at ibinigay "bilang ganito" walang warranty. Machine translation may be difficult to understand. Machine pagsasalin ay maaaring mahirap maintindihan. Please refer to Mangyaring sumangguni sa original English article orihinal na Ingles na artikulo whenever possible. hangga't maaari.
Related Articles Mga Kaugnay na Akda
- Update FreeBSD Ports Collection to Latest Version with Security Update with Portmanager and Portaudit I-update ang FreeBSD port Collection sa Latest Version sa Security Update sa Portmanager at Portaudit
- Update FreeBSD Ports Collection Up to Date and Latest I-update ang FreeBSD port Collection Hanggang sa Petsa at Latest
- Searching for Application in FreeBSD's Ports Collection Naghahanap ng mga Aplikasyon sa FreeBSD's port Collection
- Easy Way to Upgrade FreeBSD's Ports Easy Way I-upgrade sa FreeBSD's "ports" na
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 – Part 3 Pag-install ng Web Server sa FreeBSD 6.0 sa Apache 2.2, MySQL 5.0 at PHP 5 - Part 3
- Portdowngrade – Downgrade to Previous Version of FreeBSD's Ports Portdowngrade - pagsama sa Nakaraang Bersyon ng FreeBSD's "ports" na
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 – Part 5 Pag-install ng Web Server sa FreeBSD 6.0 sa Apache 2.2, MySQL 5.0 at PHP 5 - Part 5
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 – Part 1 Pag-install ng Web Server sa FreeBSD 6.0 sa Apache 2.2, MySQL 5.0 at PHP 5 - Part 1
- Installing and Configuring DHCP Server (DHCPd) on FreeBSD Pag-install at configure DHCP Server (DHCPd) sa FreeBSD
- FreeBSD 6.0 on VMware Server Time and Clock Slow Down FreeBSD 6.0 sa VMware Server Oras at Clock Mabagal Down










































February 9th, 2008 18:04 Pebrero 9, 2008 18:04
[...] at My Digital Life, there is an excellent tutorial on using portsnap. [...] Sa My Digital Life, may isang mahusay na tutorial sa paggamit ng portsnap. It covers not only the basics, but all the rest as [...] Ito ay sumasaklaw hindi lamang ang mga pangunahing kaalaman, ngunit ang lahat ng mga natitirang bilang [...]