190 likes | 340 Views
Maintain Installed Applications. In Ports Tree. <category>/<portname> Makefile COMMENT pkg-descr WWW pkg-message Shown after installed files/*. Some Tools in FreeBSD System. pkg_add, pkg_delete, pkg_info pkg_version summarize installed versions of packages pkg_create
E N D
In Ports Tree • <category>/<portname> • Makefile • COMMENT • pkg-descr • WWW • pkg-message • Shown after installed • files/*
Some Tools in FreeBSD System • pkg_add, pkg_delete, pkg_info • pkg_version • summarize installed versions of packages • pkg_create • create software package distributions • pkg_updating • displaying UPDATING entries of software packages
pkg_version (1) • pkg_version • pkg_version –v • pkg_version –v –L = apr-gdbm-db42 < autoconf = automake = automake = automake = apr-gdbm-db42-1.3.3.1.3.4_1 < needs updating (port has 1.3.8.1.3.9) autoconf-2.62 = up-to-date with port automake-1.10.1 = up-to-date with port automake-1.6.3_1 = up-to-date with port automake-1.9.6_3 = up-to-date with port apr-gdbm-db42-1.3.3.1.3.4_1 < needs updating (port has 1.3.8.1.3.9)
pkg_version (2) • Ports collection index file • /usr/ports/INDEX-7 • To get new INDEX file • cd /usr/ports ; make index (very slow) • cd /usr/ports ; make fetchindex (faster, pre-build in server side) • /etc/portsnap.conf # List of INDEX files to build and the DESCRIBE file to use for each INDEX INDEX-5 DESCRIBE.5 INDEX INDEX-6 DESCRIBE.6 INDEX INDEX-7 DESCRIBE.7
pkg_updating (1) • See /usr/ports/UPDATING before upgrading ports • pkg_updating postfix • pkg_updating –d 20090915 postfix 20090919: AFFECTS: users of mail/postfix-postfwd AUTHOR: Sahil Tandon <sahil@tandon.net> ………………………………………………. 20090605: ………………………… 20050902: AFFECTS: users of mail/postfix-current AUTHOR: marcus@corp.grupos.com.br
pkg_updating (2) • pkg_updating libtool 20090802: The devel/libtool15 and devel/libltdl15 ports have been moved to libtool22 and libltdl22, respectively, then updated to 2.2.6a. You will need to run portmaster or portupgrade to properly perform the upgrade: Portmaster: ----------- portmaster -o devel/libtool22 devel/libtool15 portmaster -o devel/libltdl22 devel/libltdl15 Portupgrade: ------------ portupgrade -o devel/libtool22 libtool-1.5\* portupgrade -o devel/libltdl22 libltdl-1.5\* After that, you will need to rebuild all ports that depend on libltdl. Since all dependent ports' PORTREVISIONs have been bumped, you can run portupgrade or portmaster with '-a' to complete the upgrade.
Useful Tools in ports-mgmt/ • portupgrade • portmaster • portconf • pkg_replace • portaudit • pkg_cutleaves • pkg_rmleaves
portupgrade (1) • FreeBSD ports/packages administration and management tool suite • Useful options: -a, -R, -r, -N, -f, -n • Other useful commands • portinstall = portupgrade -N • portversion • Similar to pkg_version • It check version info stores in /usr/ports/INDEX-7.db (built from INDEX-7) • pkg_deinstall • pkgdb • portsdb
portupgrade (2) • Written by ruby • Create its own database for dependency checking • Preserve old shared libraries • Config: /usr/local/etc/pkgtools.conf • Only available when using portupgrade • Use portconf, instead. • It is such a useful tool… • But slow.
portmaster (1) • Manage your ports without external databases or languages • Update the port whether there is a new version for it or not. • Recurse through the port and all of its dependencies (if any) to handle any port. • Useful options: • -B: prevents creation of the backup package for the installed port • -D: no cleaning of distfiles • -t: recurse dependencies thoroughly, using all-depends-list • -w: save old shared libraries before deinstall • -u: unattended mode -- accept defaults for all but ‘make config’ • -a: check all ports, update as necessary • -x: avoid building or updating ports that match this pattern
portmaster (2) • Useful options: • [-R] -f : always rebuild ports • [-R] -r: rebuild the specified port, and all ports that depend on it • -R: restart an update, skipping ports already up to date. • -L list all installed ports by category, and search for updates • -n: run through configure, but do not make or install any ports • Config: /usr/local/etc/portmaster.rc
portconf • A universal tool to set specific port knobs • Write something in /etc/make.conf • Config: /usr/local/etc/ports.conf • files/pkg-message.in # this is a comment *: NOPORTDOCS editors/openoffice.org-2: WITH_CCACHE | LOCALIZED_LANG=it print/ghostscript-* print/lpr-wrapper: A4 sysutils/fusefs-kmod*: !KERNCONF | !NOPORTDOCS www/firefox-i18n: WITHOUT_SWITCHER | FIREFOX_I18N=fr it x11/fakeport: CONFIGURE_ARGS=--with-modules="aaa bbb ccc"
pkg_replace • A utility for upgrading installed packages • compatible with portupgrade and can be used as an alternative to portupgrade and portmaster. • In ports: 0.8.0 • In sourceforge page: 0.9.0(RC2) • Support binary package installation
portaudit (1) • portaudit • Checks installed ports against a list of security vulnerabilities • portaudit –Fda • -F: Fetch the current database from the FreeBSD servers. • -d: Print the creation date of the database. • -a: Print a vulnerability report for all installed packages. • Security Output
portaudit (2) • portaudit -Fda auditfile.tbz 100% of 58 kB 38 kBps New database installed. Database created: Tue Nov 17 16:50:00 CST 2009 Affected package: libpurple-2.5.8 Type of problem: pidgin -- MSN overflow parsing SLP messages. Reference: <http://portaudit.FreeBSD.org/59e7af2d-8db7-11de-883b-001e3300a30d.html> Affected package: finch-2.5.8 Type of problem: pidgin -- MSN overflow parsing SLP messages. Reference: <http://portaudit.FreeBSD.org/59e7af2d-8db7-11de-883b-001e3300a30d.html> 2 problem(s) in your installed packages found. You are advised to update or deinstall the affected package(s) immediately.
pkg_cutleaves • pkg_cutleaves • Interactive script for deinstalling “leaf” packages • Use a lot of commands supported by portupgrade • pkg_rmleaves • Interactive script for deinstalling “leaf” packages • Once the packages marked for removal have been flushed/deinstalled, you'll be asked if you want to do another run. • -l: List leaf packages only, one per line, and don't ask for anything to be deinstalled.
Trouble Shooting (1) • See the error message. *** Error code 1 Stop in /usr/src/gnu/usr.bin/cc/cc_int. *** Error code 1 Stop in /usr/src/gnu/usr.bin/cc. *** Error code 1 Stop in /usr/src. *** Error code 1 Stop in /usr/src. *** Error code 1 Stop in /usr/src.
Trouble Shooting (2) • Try to recognize why the error occurs. • The depending libraries are too old? • Patch error? • Configure error? • Compile error? • What can I do? • Update your ports tree • Upgrade the libraries • Try again • Google it