The Internet is full of
To get a
These are a lot of steps, and you'll often find they're laid through a minefield: one false move and everything
In this chapter, we'll consider the following points as they relate to the FreeBSD ports collection:
In FreeBSD parlance, a package is simply a special archive that contains those files (usually executable
To help maintain an overview, both ports and packages are divided into categories. They are stored in directories named after the category. See the file /usr/ports/INDEX, for a list. For example, emacs, under editors, is currently in the file packages/editors/emacs-21.2.tgz, though this name will change with updated versions of emacs. For, the latest version of the packages only, you'll find another copy without the extension in packages/Latest/emacs.tgz. To install it, you enter:
pkg_add /cdrom/packages/Latest/emacs.tgz
Alternatively, you can install packages from the sysinstall, final configuration menu shown in Figure 6-1.
The more general way to install
Before you get started with the ports, you need to install the port information on your system. Normally this will be in /usr/ports. This
The simplest way to install the Ports Collection is when you install the system. When you choose the components to install, sysinstall, offers to install the Ports Collection for you as well.
The file ports/ports.tgz, on the first CD-ROM is a tar, archive containing all the ports. If you didn't install it during system installation, use the following method to install the complete collection (about 200 MB). Make sure your CD-ROM is mounted (in this example on /cdrom), and enter:
# cd /usr # tar xzvf /cdrom/ports/ports.tgz
If you only want to extract a single package, say inn, which is in the categorynews, enter :
# cd /usr # tar xzvf /cdrom/ports/ports.tgz ports/news/inn
It takes a surprisingly long time to install the ports; although there isn't much data in the archive, there are about 250,000 files in it, and creating that many files takes a lot of disk I/O.
Alternatively, the files are also on the live file system CD-ROM. This is not much of an advantage for installation, but you may find it
# cd /cdram/ports/graphics # mkdir -p /usr/ports/graphics # tar cf - . | (cd /usr/ports/graphics; tar xvf -)
What happens when a new version of a port comes out? For example, you've been using Emacs Version 20 forever, and now Version 21.2 becomes available? It's brand new, so it's obviously not on your CD-ROM.
One way to get the port is via ftp. This used to be quite cvsup, which can keep your sources up to date automatically. See Chapter 31, page 585, for more details.
All ports are kept in
drwxr-xr-x 6 1006 1006 512 Jun 8 13:18 alpha drwxr-xr-x 209 1006 1006 401408 May 28 14:08 dist files drwxr-xr-x 6 1006 1006 1536 May 28 17:53 i386 drwxr-xr-x 3 1006 1006 512 Apr 6 13:45 ia64 drwxr-xr-x 83 1006 1006 3072 May 20 15:35 local-dist files lrwxrwxrwx 1 root wheel 13 Jun 1 2001 packages -> i386/packages lrwxrwxrwx 1 root wheel 24 Jun 1 2001 ports -../FreeBSD-current/ports lrwxrwxrwx 1 root wheel 5 Jun 1 2001 ports-current -> ports lrwxrwxrwx 1 root wheel 5 Jun 1 2001 ports-stable -> ports drwxr-xr-x 4 1006 1006 512 Apr 9 10:37 sparc64
The directories alpha, i386, ia64, and sparc64, contain packages (not ports) for the corresponding architecture. dist files contains a large number of the original sources for the
The directory local-dist files, is used by people working on the Ports Collection; you don't normally need anything from these directories. The important directories for you are ports, ports-current, and ports-stable. Currently these are really all the same directory, but things may not remain like that.
Getting back to your emacs, port: you would find it in the directory /pub/Free-BSD/ports/ports/editors/ . Note the final / in that directory name: if you leave it out, ftp prints an error message and exits. Here's what might happen:
$ ftp ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/ports/editors/ Connected to ftp.beastie.tdk.net. 220 ftp.beastie.tdk.net FTP server (Version 6.00LS) ready. 331 Guest login ok, send your email address as password. 230- The FreeBSD mirror at Tele Danmark Internet. ...much blurb omitted 250 CWD command successful. 250 CWD command successful. ftp> ls 229 Entering Extended Passive Mode (|||55649|) 150 Opening ASCII mode data connection for '/bin/ls'. total 704 drwxr-xr-x 3 1006 1006 512 May 20 10:07 emacs drwxr-xr-x 4 1006 1006 512 May 20 10:08 emacs20 drwxr-xr-x 4 1006 1006 512 May 20 10:08 emacs20-dl drwxr-xr-x 4 1006 1006 512 May 20 10:08 emacs20-mule-devel drwxr-xr-x 3 1006 1006 512 May 20 10:08 emacs21 drwxr-xr-x 2 1006 1006 512 May 20 10:08 eshell-emacs20
This shows that your files will be in the directory emacs21. You can get them with the ftp mget, command:
ftp> mget emacs21 mget emacs21/files [anpqy?]? a answer a for all files Prompting off for duration of mget. ftp: local: emacs21/files: No such file or directory ftp: local: emacs21/Makefile: No such file or directory (etc)
This happens because you need to create the
ftp> !mkdir emacs21 create the local directory ftp> mget emacs21 mget emacs21/files [anpqy?]? a Prompting off for duration of mget. 229 Entering Extended Passive Mode (|||57074|) 550 emacs21/files: not a plain file. 229 Entering Extended Passive Mode (|||57085|) 150 Opening BINARY mode data connection for 'emacs21/Makefile' (2185 bytes). 100% |*************************************| 2185 2.34 MB/s 00:00 ETA 226 Transfer complete. (etc)
You get one of these for each file transferred. But note the error message: not a plain file. emacs21/files, is a directory, so we need to get it separately:
ftp> !mkdir emacs21/files ftp> mget emacs21/files mget emacs21/files/patch-lib-src:Makefile.in [anpqy?]? a Prompting off for duration of mget. 229 Entering Extended Passive Mode (|||57258|) 150 Opening BINARY mode data connection for 'emacs21/files/patch-lib-src: Make file. in '(908 bytes). 100% |*************************************| 908 1.64 MB/s 00:00 ETA 226 Transfer complete. (etc)
Note that the ftp command specifies the URL of the directory. It must have a trailing /, otherwise ftp will complain. This form is supported by FreeBSD ftp but many other ftp clients will require you to do it in two steps:
# ftp ftp.EreeBSD.org Connected to ftp.beastie.tdk.net. (etc) ftp> cd /pub/FreeBSD/ports/ports/editors 250 CWD command successful.
One problem with the Ports Collection is the sheer number. It can be difficult just to find out what they're supposed to do. If you build all the ports, you'll be busy for weeks, and there's no way you could read all the documentation in one lifetime. Where can you get an overview? Here are some suggestions. In each case, you should have the directory /usr/ports, as your current
# cd /usr/ports # make index
index, is the name of a target, the part of a rule that identifies it. It's usually either a file name or an
The index is intended for use by other programs, so it's written as a single long line per package, with fields delimited by the |). Here are two lines as an example, wrapped over three lines to fit on the page:
mp3asm-0.1.3|/usr/ports/audio/mp3asm|/usr/local|MP3 frame level editor|/usr/port s/audio/mp3asm/pkg-descr|ports@FreeBSD.org|audio| autoconf213-2.13.000227_1|| htt p://mp3asm.sourceforge.net/ mp3blaster-3.0p8|/usr/ports/audio/mp3blaster|/usr/local|MP3 console ncurses-base dplayer|/usr/ports/audio/mp3blaster/pkg-descr|greid@FreeBSD.org|audio||| http:// www.stack.nl/~brama/mp3blaster.html
You'll probably want to process it with other tools.
# cd /usr/ports # make print-index | lpr
Note that there are about 1,000 pages of output, which look like this:
Port: zip-2.3_1 Path: /usr/ports/archivers/zip Info: Create/update ZIP files compatible with pkzip Maint: ache@FreeBSD.org Index: archivers B-deps: unzip-5.50 R-deps:
search target. For example, to find ports related to Emacs, you might enter:
# cd /usr/ports # make search key=Emacs | less
Pipe the output through less, it can be quite a lot.
# cd /usr/ports # make readmes
You can then browse them at the URL file:///usr/ports/README.html.
You'll see from the above example that there are not many files in the port. Most of the files required to build the software are in the original source code archive (the "tar ball"), but that's not part of the port.
There are a number of places from which you can get the sources. If you have a CD-ROM set, many of them are
If you don't have the source tar ball, that's not a problem. Part of the function of the Ports Collection is to go out on the Net and get them for you. This is completely automatic: you just type make, and the build process gets the source archive for you and builds it. Of course, you must be connected to the Internet for this to work.
If you mount your CD-ROM elsewhere (maybe because you have more than one
# cd /cd4/ports/distfiles # mkdir -p /usr/ports/distfiles make sure you have a distfiles directory # for i in *; do > ln -s /cd4/ports/distfiles/$i /usr/ports/distfiles/$i > done
If you're using csh, or tcsh, enter:
# cd /cd4/ports/distfiles # mkdir -p /usr/ports/distfiles make sure you have a distfiles directory # foreach i (*) ? ln -s /cd4/ports/distfiles/$i /usr/ports/distfiles/$i ? end
This creates a
Once you have the
# cd /usr/ports/editors/emacs21 # make # make install ====> To enable menubar fontset support, define WITH_MENUBAR_FONTSET >> emacs-21.2.tar.gz doesn't seem to exist in /usr/ports/distfiles/. >> Attempting to fetch from ftp://ftp.gnu.org/gnu/emacs/. ===> Extracting for emacs-21.2_1 >> Checksum OK for emacs-21.2.tar.gz. ===> emacs-21.2_1 depends on executable: gmake - found ===> emacs-21.2_1 depends on executable: autoconf213 - not found ===> Verifying install for autoconf213 in /usr/ports/devel/autoconf213 ===> Extracting for autoconf213-2.13.000227_2 >> Checksum OK for autoconf-000227.tar.bz2. ===> autoconf213-2.13.000227_2 depends on executable: gm4 - not found ===> Verifying install for gm4 in /usr/ports/devel/m4 ===> Extracting for m4-1.4_1 >> Checksum OK for m4-1.4.tar.gz. ===> Patching for m4-1.4_1 ===> Applying FreeBSD patches for m4-1.4_1 ===> Configuring for m4-1.4_1 creating cache ./config.cache checking for mawk... no (etc)
It's a good idea to perform the make, step first: make install, does not always build the package.
Sometimes, it's not enough to build a single port. Many ports depend on other ports. If you have the complete, up-to-date ports tree installed on your systcode, the Ports Collection will take care of this for you: it will check if the other port is installed, and if it isn't, it will install it for you. For example, tkdesk, depends on tk, tk depends on tcl. If you don't have any of them installed, and you try to build tkdesk, it will recursively install tk and tcl for you.
Once you have installed your port, you'll want to use it. In almost every case, that requires documentation. Most packages have documentation, but unfortunately it's not always obvious where it is. In some cases, the port doesn't install all the documentation.
More generally, there are the following possibilities:
$ cd /var/db/pkg $ pkg_info -L emacs-21.2_l|grep /man/ /usr/local/man/man1/ctags.1.gz /usr/local/man/man1/emacs.1.gz /usr/local/man/man1/etags.1.gz /usr/local/man/man1/gfdl.1.gz
You don't need to change the directory to /var/db/pkg, but if you do, you can use file name completion to finish the name of the package. We use /man/ as the search string, and not simply man, because otherwise other files might match as well.
$ pkg_info -L emacs-21.2_l|grep /info/ /usr/local/info/ada-mode /usr/local/info/autotype /usr/local/info/ccmode /usr/local/info/cl (many more)
This isn't normally necessary, though: if you're using GNU info, the index page will be updated to include the package.
A lot of software doesn't need to be ported. For example, if you want . But how, do you install it? Netscape's installation procedures are getting better, but they still leave something to be
The answer's simple: take the port! Although Netscape comes only in
This method can be used to install some other software as well, for example Star Office. The moral is simple: always check the Ports Collection before getting a
Once you install a port, you might consider that to be the end of the story. That's seldom the case. For example:
From time to time, new versions of software will appear. There are a number of approaches to upgrading:
$ pkg_info | grep emacs emacs-21.1_5 GNU editing macros emacs-21.2_1 GNU editing macros
Clearly you don't need emacs-21.15 anymore. In fact, it's not complete anymore, because the program /usr/local/bin/emacs
has been overwritten by the new version. But you can't remove it either: that would remove components of emacs-21.2_1, which you want to keep.
On the other hand, if you don't remove it, you are left with nearly 50 MB of
Portupgrade is—what else?—a port. Install it in the usual manner:
# cd /usr/ports/sysutils/portupgrade # make install
Before you can perform the upgrade, you should first back up /var/db/pkg, then build a ports database with pkgdb. A typical build might look like this:
# cd /var/db # tar czvf db.pkg.tar.gz pkg/ # pkgdb -F [Updating the pkgdb <format:bdb1_btree> in /var/db/pkg ... - 181 packages found (-5 +92) (...)...............done] Checking the origin of AbiWord-1.0.3 Checking the origin of ImageMagick-5.5.1.1 Checking the origin of ORBit-0.5.17 ... Checking the origin of xv-3.10a_3 Checking the origin of zip-2.3_1 Checking for origin duplicates Checking AbiWord-1.0.3 Checking ImageMagick-5.5.1.1 Stale dependency: ImageMagick-5.5.1.1 -> ghostscript-gnu-7.05_3: ghostscript-gnu-6.52_4 (score:64%) ? ([y]es/[n]o/[a]ll) [no] y Fixed. (-> ghostscript-gnu-6.52_4) Checking ORBit-0.5.17 Checking XFree86-4.2.0_1,1 Checking bonobo-1.0.21_1 Stale dependency: bonobo-1.0.21_1 -> ghostscript-gnu-7.05_3: ghostscript-gnu-6.52_4 ? ([y]es/[n]o/[a]ll) [yes] Enter pressed Fixed. (-> ghostscript-gnu-6.52_4) Checking cdrtools-1.11.a28 ... Checking xv-3.10a_3 Checking zip-2.3_1 Regenerating +REQUIRED_BY files Checking for cyclic dependencies
In this example, the port ghostscript-gnu-7.05 3 had been replaced by the earlier version ghostscript-gnu-6.52_4, since ghostscript Release 7 has some annoying bugs. The dialogue shows how pkgdb,
Now you can start the upgrade. To upgrade a specific port, simply specify its base name, without the -v, option to show additional information:
# portupgrade -v bison ---> Upgrade of devel/bison started at: Mon, 04 Nov 2002 13:20:52 +1030 ---> Upgrading 'bison-1.35_1' to 'bison-1.75' (devel/bison) ---> Build of devel/bison started at: Mon, 04 Nov 2002 13:20:52 +1030 ... normal port build output ===> Registering installation for bison-1.75 make clean issued by portupgrade ===> Cleaning for libiconv-1.8_2 ===> Cleaning for gettext-0.11.5_1 ... ---> Removing the temporary backup files ---> Installation of devel/bison ended at: Mon, 04 Nov 2002 13:23:00 +1030 (consume d00:00:06) ---> Removing the obsoleted dependencies ---> Cleaning out obsolete shared libraries ---> Upgrade of devel/bison ended at: Mon, 04 Nov 2002 13:23:01 +1030 (consumed 00: 02:08) ---> Reporting the results ( + :succeeded / -:ignored / *:skipped / !:failed) +devel/bison (bison-1.35_1)
If the port is already up to date, you'll see something like this:
# portupgrade -v perl-5.8.0_3 ** No need to upgrade 'perl-5.8.0_3' (>= perl-5.8.0_3). (specify -f to force) ---> Reporting the results ( + :succeeded / -:ignored / *:skipped / !:failed) -lang/perl5.8 (perl-5.8.0_3)
To upgrade all ports, use the command:
# portupgrade -a
We've already seen the program pkg_add, when installing pre-compiled packages. There are a number of other pkg_ programs that can help you maintain installed ports, whether they have been installed by pkg_add, or by make install from the Ports Collection:
pkg_info, tells you which ports are installed. For example:
$ pkg_info | less AbiWord-1.0.3 An open-source, cross-platform WYSIWYG word proces ImageMagick-5.5.1.1 Image processing tools (interactive optional--misc ORBit-0.5.17 High-performance CORBA ORB with support for the C XFree86-4.2.0_1,1 X11/XFree86 core distribution (complete, using min ... etc bash-2.05b.004 The GNU Bourne Again Shell bison-1.75 A parser generator from FSF, (mostly) compatible w bonobo-1.0.21_1 The component and compound document system for GNO cdrtools-1.11.a28 Cdrecord, mkisofs and several other programs to re ... etc elm-2.4ME+22 ELM Mail User Agent elm-2.4ME+32 ELM Mail User Agent
Note that the last two entries in this example show that two versions of elm, are installed. This can't be right; it happens when you install a new version without removing the old version and without running portupgrade. We'll discuss this matter further below.
pkg_version, to check whether your ports are up to date. pkg_version, is a little cryptic in its output:
| AbiWord-gnome | = |
| ImageMagick | < |
| ORBit | < |
| Wingz | = |
| < | |
| x2x-1.28 | ? |
| = | The installed version of the package is current. |
| < | The installed version of the package is older than the current version. |
| > | The installed version of the package is newer than the current version. This situation can arise with an out-of-date index file, or when testing new ports. |
| ? | The installed package does not appear in the index. This could be due to an out of date index o repackage that has not yet been committed. |
| * | There are multiple versions of a particular |
| ! | The installed package exists in the index but for some reason, pkgversion, was unable to compare the |
# make deinstall
Alternatively, you can remove any installed package with pkg_delete. For example, the list above shows two versions of the elm,
# pkg_delete elm-2.4ME+22 File Vusr/local/man/manl/answer.l' doesn't really exist. Unable to completely remove file '/usr/local/man/manl/answer.1' File Vusr/local/man/manl/checkalias.l' doesn't really exist. Unable to completely remove file '/usr/local/man/manl/checkalias.l' ... etc Couldn't entirely delete package (perhaps the packing list is incorrectly specified?)
In this case, it looks as if somebody has tried to remove the files before, so pkg_delete, couldn't do so.
Another problem with pkg_delete, is that it might delete files of the same name that have been replaced by newer packages. After performing this operation, we try:
$ elm bash: elm: command not found
Oops! We tried to delete the old version, but we deleted at least part of the new version. Now we need to install it again.
The moral of this story is that things aren't as simple as they might be. When you install a new version of a package, you may want to test it before you commit to using it all the time. You can't just go and delete the old version. One possibility would be to install the new package, and try it out. When you've finished testing, delete both, packages and re-install the one you want to keep.
The best way to find out about updates is to subscribe to the FreeBSD-ports mailing list. That way, you will get notification every time something changes. If you're tracking the ports tree with CVSup, you also get the updates to the ports tree automatically. Otherwise you will have to download the port. In either case, to update your installed port, just repeat the build.
The Ports Collection is constantly growing. Hardly a day goes by without a new port being added to the list. Maybe you want to submit the next one? If you have something interesting that isn't already in the Ports Collection, you can find instructions on how to prepare the port in the FreeBSD Porter's Handbook. The latest version is available on the FreeBSD web site, but you'll also find it on your system as /usr/share/doc/en/porters-handbook/index.html.
The Internet is full of
To get a
These are a lot of steps, and you'll often find they're laid through a minefield: one false move and everything
In this chapter, we'll consider the following points as they relate to the FreeBSD ports collection:
In FreeBSD parlance, a package is simply a special archive that contains those files (usually executable
To help maintain an overview, both ports and packages are divided into categories. They are stored in directories named after the category. See the file /usr/ports/INDEX, for a list. For example, emacs, under editors, is currently in the file packages/editors/emacs-21.2.tgz, though this name will change with updated versions of emacs. For, the latest version of the packages only, you'll find another copy without the extension in packages/Latest/emacs.tgz. To install it, you enter:
pkg_add /cdrom/packages/Latest/emacs.tgz
Alternatively, you can install packages from the sysinstall, final configuration menu shown in Figure 6-1.
The more general way to install
Before you get started with the ports, you need to install the port information on your system. Normally this will be in /usr/ports. This
The simplest way to install the Ports Collection is when you install the system. When you choose the components to install, sysinstall, offers to install the Ports Collection for you as well.
The file ports/ports.tgz, on the first CD-ROM is a tar, archive containing all the ports. If you didn't install it during system installation, use the following method to install the complete collection (about 200 MB). Make sure your CD-ROM is mounted (in this example on /cdrom), and enter:
# cd /usr # tar xzvf /cdrom/ports/ports.tgz
If you only want to extract a single package, say inn, which is in the categorynews, enter :
# cd /usr # tar xzvf /cdrom/ports/ports.tgz ports/news/inn
It takes a surprisingly long time to install the ports; although there isn't much data in the archive, there are about 250,000 files in it, and creating that many files takes a lot of disk I/O.
Alternatively, the files are also on the live file system CD-ROM. This is not much of an advantage for installation, but you may find it
# cd /cdram/ports/graphics # mkdir -p /usr/ports/graphics # tar cf - . | (cd /usr/ports/graphics; tar xvf -)
What happens when a new version of a port comes out? For example, you've been using Emacs Version 20 forever, and now Version 21.2 becomes available? It's brand new, so it's obviously not on your CD-ROM.
One way to get the port is via ftp. This used to be quite cvsup, which can keep your sources up to date automatically. See Chapter 31, page 585, for more details.
All ports are kept in
drwxr-xr-x 6 1006 1006 512 Jun 8 13:18 alpha drwxr-xr-x 209 1006 1006 401408 May 28 14:08 dist files drwxr-xr-x 6 1006 1006 1536 May 28 17:53 i386 drwxr-xr-x 3 1006 1006 512 Apr 6 13:45 ia64 drwxr-xr-x 83 1006 1006 3072 May 20 15:35 local-dist files lrwxrwxrwx 1 root wheel 13 Jun 1 2001 packages -> i386/packages lrwxrwxrwx 1 root wheel 24 Jun 1 2001 ports -../FreeBSD-current/ports lrwxrwxrwx 1 root wheel 5 Jun 1 2001 ports-current -> ports lrwxrwxrwx 1 root wheel 5 Jun 1 2001 ports-stable -> ports drwxr-xr-x 4 1006 1006 512 Apr 9 10:37 sparc64
The directories alpha, i386, ia64, and sparc64, contain packages (not ports) for the corresponding architecture. dist files contains a large number of the original sources for the
The directory local-dist files, is used by people working on the Ports Collection; you don't normally need anything from these directories. The important directories for you are ports, ports-current, and ports-stable. Currently these are really all the same directory, but things may not remain like that.
Getting back to your emacs, port: you would find it in the directory /pub/Free-BSD/ports/ports/editors/ . Note the final / in that directory name: if you leave it out, ftp prints an error message and exits. Here's what might happen:
$ ftp ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/ports/editors/ Connected to ftp.beastie.tdk.net. 220 ftp.beastie.tdk.net FTP server (Version 6.00LS) ready. 331 Guest login ok, send your email address as password. 230- The FreeBSD mirror at Tele Danmark Internet. ...much blurb omitted 250 CWD command successful. 250 CWD command successful. ftp> ls 229 Entering Extended Passive Mode (|||55649|) 150 Opening ASCII mode data connection for '/bin/ls'. total 704 drwxr-xr-x 3 1006 1006 512 May 20 10:07 emacs drwxr-xr-x 4 1006 1006 512 May 20 10:08 emacs20 drwxr-xr-x 4 1006 1006 512 May 20 10:08 emacs20-dl drwxr-xr-x 4 1006 1006 512 May 20 10:08 emacs20-mule-devel drwxr-xr-x 3 1006 1006 512 May 20 10:08 emacs21 drwxr-xr-x 2 1006 1006 512 May 20 10:08 eshell-emacs20
This shows that your files will be in the directory emacs21. You can get them with the ftp mget, command:
ftp> mget emacs21 mget emacs21/files [anpqy?]? a answer a for all files Prompting off for duration of mget. ftp: local: emacs21/files: No such file or directory ftp: local: emacs21/Makefile: No such file or directory (etc)
This happens because you need to create the
ftp> !mkdir emacs21 create the local directory ftp> mget emacs21 mget emacs21/files [anpqy?]? a Prompting off for duration of mget. 229 Entering Extended Passive Mode (|||57074|) 550 emacs21/files: not a plain file. 229 Entering Extended Passive Mode (|||57085|) 150 Opening BINARY mode data connection for 'emacs21/Makefile' (2185 bytes). 100% |*************************************| 2185 2.34 MB/s 00:00 ETA 226 Transfer complete. (etc)
You get one of these for each file transferred. But note the error message: not a plain file. emacs21/files, is a directory, so we need to get it separately:
ftp> !mkdir emacs21/files ftp> mget emacs21/files mget emacs21/files/patch-lib-src:Makefile.in [anpqy?]? a Prompting off for duration of mget. 229 Entering Extended Passive Mode (|||57258|) 150 Opening BINARY mode data connection for 'emacs21/files/patch-lib-src: Make file. in '(908 bytes). 100% |*************************************| 908 1.64 MB/s 00:00 ETA 226 Transfer complete. (etc)
Note that the ftp command specifies the URL of the directory. It must have a trailing /, otherwise ftp will complain. This form is supported by FreeBSD ftp but many other ftp clients will require you to do it in two steps:
# ftp ftp.EreeBSD.org Connected to ftp.beastie.tdk.net. (etc) ftp> cd /pub/FreeBSD/ports/ports/editors 250 CWD command successful.
One problem with the Ports Collection is the sheer number. It can be difficult just to find out what they're supposed to do. If you build all the ports, you'll be busy for weeks, and there's no way you could read all the documentation in one lifetime. Where can you get an overview? Here are some suggestions. In each case, you should have the directory /usr/ports, as your current
# cd /usr/ports # make index
index, is the name of a target, the part of a rule that identifies it. It's usually either a file name or an
The index is intended for use by other programs, so it's written as a single long line per package, with fields delimited by the |). Here are two lines as an example, wrapped over three lines to fit on the page:
mp3asm-0.1.3|/usr/ports/audio/mp3asm|/usr/local|MP3 frame level editor|/usr/port s/audio/mp3asm/pkg-descr|ports@FreeBSD.org|audio| autoconf213-2.13.000227_1|| htt p://mp3asm.sourceforge.net/ mp3blaster-3.0p8|/usr/ports/audio/mp3blaster|/usr/local|MP3 console ncurses-base dplayer|/usr/ports/audio/mp3blaster/pkg-descr|greid@FreeBSD.org|audio||| http:// www.stack.nl/~brama/mp3blaster.html
You'll probably want to process it with other tools.
# cd /usr/ports # make print-index | lpr
Note that there are about 1,000 pages of output, which look like this:
Port: zip-2.3_1 Path: /usr/ports/archivers/zip Info: Create/update ZIP files compatible with pkzip Maint: ache@FreeBSD.org Index: archivers B-deps: unzip-5.50 R-deps:
search target. For example, to find ports related to Emacs, you might enter:
# cd /usr/ports # make search key=Emacs | less
Pipe the output through less, it can be quite a lot.
# cd /usr/ports # make readmes
You can then browse them at the URL file:///usr/ports/README.html.
You'll see from the above example that there are not many files in the port. Most of the files required to build the software are in the original source code archive (the "tar ball"), but that's not part of the port.
There are a number of places from which you can get the sources. If you have a CD-ROM set, many of them are
If you don't have the source tar ball, that's not a problem. Part of the function of the Ports Collection is to go out on the Net and get them for you. This is completely automatic: you just type make, and the build process gets the source archive for you and builds it. Of course, you must be connected to the Internet for this to work.
If you mount your CD-ROM elsewhere (maybe because you have more than one
# cd /cd4/ports/distfiles # mkdir -p /usr/ports/distfiles make sure you have a distfiles directory # for i in *; do > ln -s /cd4/ports/distfiles/$i /usr/ports/distfiles/$i > done
If you're using csh, or tcsh, enter:
# cd /cd4/ports/distfiles # mkdir -p /usr/ports/distfiles make sure you have a distfiles directory # foreach i (*) ? ln -s /cd4/ports/distfiles/$i /usr/ports/distfiles/$i ? end
This creates a
Once you have the
# cd /usr/ports/editors/emacs21 # make # make install ====> To enable menubar fontset support, define WITH_MENUBAR_FONTSET >> emacs-21.2.tar.gz doesn't seem to exist in /usr/ports/distfiles/. >> Attempting to fetch from ftp://ftp.gnu.org/gnu/emacs/. ===> Extracting for emacs-21.2_1 >> Checksum OK for emacs-21.2.tar.gz. ===> emacs-21.2_1 depends on executable: gmake - found ===> emacs-21.2_1 depends on executable: autoconf213 - not found ===> Verifying install for autoconf213 in /usr/ports/devel/autoconf213 ===> Extracting for autoconf213-2.13.000227_2 >> Checksum OK for autoconf-000227.tar.bz2. ===> autoconf213-2.13.000227_2 depends on executable: gm4 - not found ===> Verifying install for gm4 in /usr/ports/devel/m4 ===> Extracting for m4-1.4_1 >> Checksum OK for m4-1.4.tar.gz. ===> Patching for m4-1.4_1 ===> Applying FreeBSD patches for m4-1.4_1 ===> Configuring for m4-1.4_1 creating cache ./config.cache checking for mawk... no (etc)
It's a good idea to perform the make, step first: make install, does not always build the package.
Sometimes, it's not enough to build a single port. Many ports depend on other ports. If you have the complete, up-to-date ports tree installed on your systcode, the Ports Collection will take care of this for you: it will check if the other port is installed, and if it isn't, it will install it for you. For example, tkdesk, depends on tk, tk depends on tcl. If you don't have any of them installed, and you try to build tkdesk, it will recursively install tk and tcl for you.
Once you have installed your port, you'll want to use it. In almost every case, that requires documentation. Most packages have documentation, but unfortunately it's not always obvious where it is. In some cases, the port doesn't install all the documentation.
More generally, there are the following possibilities:
$ cd /var/db/pkg $ pkg_info -L emacs-21.2_l|grep /man/ /usr/local/man/man1/ctags.1.gz /usr/local/man/man1/emacs.1.gz /usr/local/man/man1/etags.1.gz /usr/local/man/man1/gfdl.1.gz
You don't need to change the directory to /var/db/pkg, but if you do, you can use file name completion to finish the name of the package. We use /man/ as the search string, and not simply man, because otherwise other files might match as well.
$ pkg_info -L emacs-21.2_l|grep /info/ /usr/local/info/ada-mode /usr/local/info/autotype /usr/local/info/ccmode /usr/local/info/cl (many more)
This isn't normally necessary, though: if you're using GNU info, the index page will be updated to include the package.
A lot of software doesn't need to be ported. For example, if you want . But how, do you install it? Netscape's installation procedures are getting better, but they still leave something to be
The answer's simple: take the port! Although Netscape comes only in
This method can be used to install some other software as well, for example Star Office. The moral is simple: always check the Ports Collection before getting a
Once you install a port, you might consider that to be the end of the story. That's seldom the case. For example:
From time to time, new versions of software will appear. There are a number of approaches to upgrading:
$ pkg_info | grep emacs emacs-21.1_5 GNU editing macros emacs-21.2_1 GNU editing macros
Clearly you don't need emacs-21.15 anymore. In fact, it's not complete anymore, because the program /usr/local/bin/emacs
has been overwritten by the new version. But you can't remove it either: that would remove components of emacs-21.2_1, which you want to keep.
On the other hand, if you don't remove it, you are left with nearly 50 MB of
Portupgrade is—what else?—a port. Install it in the usual manner:
# cd /usr/ports/sysutils/portupgrade # make install
Before you can perform the upgrade, you should first back up /var/db/pkg, then build a ports database with pkgdb. A typical build might look like this:
# cd /var/db # tar czvf db.pkg.tar.gz pkg/ # pkgdb -F [Updating the pkgdb <format:bdb1_btree> in /var/db/pkg ... - 181 packages found (-5 +92) (...)...............done] Checking the origin of AbiWord-1.0.3 Checking the origin of ImageMagick-5.5.1.1 Checking the origin of ORBit-0.5.17 ... Checking the origin of xv-3.10a_3 Checking the origin of zip-2.3_1 Checking for origin duplicates Checking AbiWord-1.0.3 Checking ImageMagick-5.5.1.1 Stale dependency: ImageMagick-5.5.1.1 -> ghostscript-gnu-7.05_3: ghostscript-gnu-6.52_4 (score:64%) ? ([y]es/[n]o/[a]ll) [no] y Fixed. (-> ghostscript-gnu-6.52_4) Checking ORBit-0.5.17 Checking XFree86-4.2.0_1,1 Checking bonobo-1.0.21_1 Stale dependency: bonobo-1.0.21_1 -> ghostscript-gnu-7.05_3: ghostscript-gnu-6.52_4 ? ([y]es/[n]o/[a]ll) [yes] Enter pressed Fixed. (-> ghostscript-gnu-6.52_4) Checking cdrtools-1.11.a28 ... Checking xv-3.10a_3 Checking zip-2.3_1 Regenerating +REQUIRED_BY files Checking for cyclic dependencies
In this example, the port ghostscript-gnu-7.05 3 had been replaced by the earlier version ghostscript-gnu-6.52_4, since ghostscript Release 7 has some annoying bugs. The dialogue shows how pkgdb,
Now you can start the upgrade. To upgrade a specific port, simply specify its base name, without the -v, option to show additional information:
# portupgrade -v bison ---> Upgrade of devel/bison started at: Mon, 04 Nov 2002 13:20:52 +1030 ---> Upgrading 'bison-1.35_1' to 'bison-1.75' (devel/bison) ---> Build of devel/bison started at: Mon, 04 Nov 2002 13:20:52 +1030 ... normal port build output ===> Registering installation for bison-1.75 make clean issued by portupgrade ===> Cleaning for libiconv-1.8_2 ===> Cleaning for gettext-0.11.5_1 ... ---> Removing the temporary backup files ---> Installation of devel/bison ended at: Mon, 04 Nov 2002 13:23:00 +1030 (consume d00:00:06) ---> Removing the obsoleted dependencies ---> Cleaning out obsolete shared libraries ---> Upgrade of devel/bison ended at: Mon, 04 Nov 2002 13:23:01 +1030 (consumed 00: 02:08) ---> Reporting the results ( + :succeeded / -:ignored / *:skipped / !:failed) +devel/bison (bison-1.35_1)
If the port is already up to date, you'll see something like this:
# portupgrade -v perl-5.8.0_3 ** No need to upgrade 'perl-5.8.0_3' (>= perl-5.8.0_3). (specify -f to force) ---> Reporting the results ( + :succeeded / -:ignored / *:skipped / !:failed) -lang/perl5.8 (perl-5.8.0_3)
To upgrade all ports, use the command:
# portupgrade -a
We've already seen the program pkg_add, when installing pre-compiled packages. There are a number of other pkg_ programs that can help you maintain installed ports, whether they have been installed by pkg_add, or by make install from the Ports Collection:
pkg_info, tells you which ports are installed. For example:
$ pkg_info | less AbiWord-1.0.3 An open-source, cross-platform WYSIWYG word proces ImageMagick-5.5.1.1 Image processing tools (interactive optional--misc ORBit-0.5.17 High-performance CORBA ORB with support for the C XFree86-4.2.0_1,1 X11/XFree86 core distribution (complete, using min ... etc bash-2.05b.004 The GNU Bourne Again Shell bison-1.75 A parser generator from FSF, (mostly) compatible w bonobo-1.0.21_1 The component and compound document system for GNO cdrtools-1.11.a28 Cdrecord, mkisofs and several other programs to re ... etc elm-2.4ME+22 ELM Mail User Agent elm-2.4ME+32 ELM Mail User Agent
Note that the last two entries in this example show that two versions of elm, are installed. This can't be right; it happens when you install a new version without removing the old version and without running portupgrade. We'll discuss this matter further below.
pkg_version, to check whether your ports are up to date. pkg_version, is a little cryptic in its output:
| AbiWord-gnome | = |
| ImageMagick | < |
| ORBit | < |
| Wingz | = |
| < | |
| x2x-1.28 | ? |
| = | The installed version of the package is current. |
| < | The installed version of the package is older than the current version. |
| > | The installed version of the package is newer than the current version. This situation can arise with an out-of-date index file, or when testing new ports. |
| ? | The installed package does not appear in the index. This could be due to an out of date index o repackage that has not yet been committed. |
| * | There are multiple versions of a particular |
| ! | The installed package exists in the index but for some reason, pkgversion, was unable to compare the |
# make deinstall
Alternatively, you can remove any installed package with pkg_delete. For example, the list above shows two versions of the elm,
# pkg_delete elm-2.4ME+22 File Vusr/local/man/manl/answer.l' doesn't really exist. Unable to completely remove file '/usr/local/man/manl/answer.1' File Vusr/local/man/manl/checkalias.l' doesn't really exist. Unable to completely remove file '/usr/local/man/manl/checkalias.l' ... etc Couldn't entirely delete package (perhaps the packing list is incorrectly specified?)
In this case, it looks as if somebody has tried to remove the files before, so pkg_delete, couldn't do so.
Another problem with pkg_delete, is that it might delete files of the same name that have been replaced by newer packages. After performing this operation, we try:
$ elm bash: elm: command not found
Oops! We tried to delete the old version, but we deleted at least part of the new version. Now we need to install it again.
The moral of this story is that things aren't as simple as they might be. When you install a new version of a package, you may want to test it before you commit to using it all the time. You can't just go and delete the old version. One possibility would be to install the new package, and try it out. When you've finished testing, delete both, packages and re-install the one you want to keep.
The best way to find out about updates is to subscribe to the FreeBSD-ports mailing list. That way, you will get notification every time something changes. If you're tracking the ports tree with CVSup, you also get the updates to the ports tree automatically. Otherwise you will have to download the port. In either case, to update your installed port, just repeat the build.
The Ports Collection is constantly growing. Hardly a day goes by without a new port being added to the list. Maybe you want to submit the next one? If you have something interesting that isn't already in the Ports Collection, you can find instructions on how to prepare the port in the FreeBSD Porter's Handbook. The latest version is available on the FreeBSD web site, but you'll also find it on your system as /usr/share/doc/en/porters-handbook/index.html.
Для получения официальных документов о завершении программы дополнительного профессионального образования (удостоверения о повышении квалификации, дипломов о профессиональной переподготовке и MBA) необходимо предоставить:
Внимание! Вы можете не заказывать доставку бумажной версии официального документы, а скачать его в электронном виде и распечатать самостоятельно. Информация о выданном документе в течение 1 месяца загружается в Федеральную информационную систему «Федеральный реестр сведений о документах об образовании и (или) о квалификации, документах об обучении» - ФИС ФРДО.
Доступ на новый сайт осуществляется с использованием адреса электронной почты, который был указан вами при регистрации на "старом". Мы постарались перенести все ваши данные с прежнего ресурса, однако не исключена вероятность потери части информации.
При возникновении проблемы со входом, воспользуйтесь функцией сброса пароля
Если вы обнаружите несоответствия, пожалуйста, сообщите нам.