1. 如果還沒安裝 portupgrade 套件,請先安裝該套件

# cd /usr/ports/ports-mgmt/portupgrade
# make install clean

2. 列出 portsclean 功能

#  portsclean -h
portsclean 2.4.15 (2019/10/04)

usage: portsclean [-hCDDiLnPPQQq]

    -h, --help         Show this message
    -C, --workclean    Clean up working directories
    -D, --distclean    Clean up distfiles which are not referenced from any
                       port in the ports tree;
                       Specified twice, clean up distfiles which are not
                       referenced from any port that is currently installed
    -i, --interactive  Turn on interactive mode
    -L, --libclean     Clean up old shared libraries
    -n, --noexecute    Do not actually delete files
    -P, --pkgclean     Clean up outdated package tarballs;
                       Specified twice, delete all the package tarballs
    -Q, --quiet        Do not write anything to stdout;
                       Specified twice, stderr neither
    -q, --noconfig     Do not read pkgtools.conf

Environment Variables [default]:
    PACKAGES         packages directory [$PORTSDIR/packages]
    PKGTOOLS_CONF    configuration file [$PREFIX/etc/pkgtools.conf]
    PKG_DBDIR        packages DB directory [/var/db/pkg]
    PORTSDIR         ports directory [/usr/ports]
    PORTS_DBDIR      ports db directory [$PORTSDIR]
    PORTS_INDEX      ports index file [$PORTSDIR/INDEX]


3. 刪除 work 資料匣

# portsclean -C
Cleaning out /usr/ports/*/*/work...
Delete /usr/ports/databases/pecl-mongodb/work
Delete /usr/ports/shells/bash/work
Delete /usr/ports/textproc/xmlto/work
Delete /usr/ports/textproc/asciidoc/work
Delete /usr/ports/devel/libatomic_ops/work
Delete /usr/ports/devel/boehm-gc/work
Delete /usr/ports/devel/git/work
Delete /usr/ports/devel/cvsps/work
Delete /usr/ports/www/w3m/work
Delete /usr/ports/security/p5-Authen-SASL/work
Delete /usr/ports/security/p5-Digest-HMAC/work
Delete /usr/ports/misc/getopt/work
Delete /usr/ports/lang/p5-Error/work
done.

undefined
精通 Shell 程式設計(第四版)
Shell Programming in Unix, Linux and OS X, 4th Edition

作者: Stephen G. Kochan, Patrick Wood  
譯者: 蔡明志
出版社:碁峰

arrow
arrow
    創作者介紹
    創作者 helloworld 的頭像
    helloworld

    Hello World

    helloworld 發表在 痞客邦 留言(0) 人氣()