# Portsclean does not work



## Vespiary (Nov 22, 2009)

Hello FreeBSD community!

I've a portupgrade installed on my FreeBSD but anyway when I try to run a command 'portsclean -D' it does work.

My usr/ports/ folder is now about 2 GB and I think I have many unnecessary ports installed. I would like to clean some of them. 

Here is also a list of installed packages. 


```
autoconf-2.62       Automatically configure source code on many Un*x platforms
autoconf-wrapper-20071109 Wrapper script for GNU autoconf
automake-1.10.1     GNU Standards-compliant Makefile generator (1.10)
automake-wrapper-20071109 Wrapper script for GNU automake
bigreqsproto-1.0.2  BigReqs extension headers
cups-1.3.9          Common UNIX Printing System: Metaport to install complete s
cups-base-1.3.9_3   Common UNIX Printing System
cups-pstoraster-8.15.4_2 Postscript interpreter for CUPS printing to non-PS printers
db41-4.1.25_4       The Berkeley DB package, revision 4.1
desktop-file-utils-0.15_1 A couple of command line utilities for working with desktop
diablo-jdk-1.6.0.07.02_4 Java Development Kit 1.6.0_07.02
expat-2.0.1         XML 1.0 parser written in C
fontconfig-2.6.0,1  An XML-based font configuration API for X Windows
freetype2-2.3.9_1   A free and portable TrueType font rendering engine
gamin-0.1.10_3      A file and directory monitoring system
gettext-0.17_1      GNU gettext package
ghostscript8-8.64_1 Ghostscript 8.x PostScript interpreter
gio-fam-backend-2.20.5 FAM backend for GLib's GIO library
glib-2.20.5         Some useful routines of C programming (current stable versi
gmake-3.81_3        GNU version of 'make' utility
gnutls-2.6.4        GNU Transport Layer Security library
gsfonts-8.11_4      Fonts used by GNU Ghostscript (or X)
gtar-1.22_1         GNU version of the traditional tape archiver
help2man-1.36.4_2   Automatically generating simple manual pages from program o
icu-3.8.1_2         International Components for Unicode (from IBM)
inputproto-1.5.0    Input extension headers
javavmwrapper-2.3.2 Wrapper script for various Java Virtual Machines
jbootstrap-1.2.1    Java bootstrap tools
jikes-1.22_1        A very fast Java source to byte-code compiler made availabl
jpeg-6b_7           IJG's jpeg compression utilities
kbproto-1.0.3       KB extension headers
libICE-1.0.4_1,1    Inter Client Exchange library for X11
libSM-1.1.0_1,1     Session Management library for X11
libX11-1.2.1,1      X11 library
libXau-1.0.4        Authentication Protocol library for X11
libXaw-1.0.5_1,1    X Athena Widgets library
libXdmcp-1.0.2_1    X Display Manager Control Protocol library
libXext-1.0.5,1     X11 Extension library
libXi-1.2.1,1       X Input extension library
libXmu-1.0.4,1      X Miscellaneous Utilities libraries
libXp-1.0.0,1       X print library
libXpm-3.5.7        X Pixmap library
libXt-1.0.5_1       X Toolkit library
libXtst-1.0.3_1     X Test extension
libcheck-0.9.6      A unit test framework for C
libgcrypt-1.4.4     General purpose crypto library based on code used in GnuPG
libgpg-error-1.7    Common error values for all GnuPG components
libiconv-1.11_1     A character set conversion library
libpthread-stubs-0.1 This library provides weak aliases for pthread functions
libtool-1.5.26      Generic shared library support script
libtool-2.2.6a_1    Generic shared library support script
libxcb-1.2_1        The X protocol C-language Binding (XCB) library
libxml2-2.7.3       XML parser library for GNOME
libxslt-1.1.24_2    The XSLT C library for GNOME
linux_base-fc-4_14  Base set of packages needed in Linux mode (for i386/amd64)
lzo2-2.03_2         Portable speedy, lossless data compression library
lzop-1.02.r1        Fast file compressor similar to gzip, using the LZO library
m4-1.4.12,1         GNU m4
nano-2.0.9_1        Nano's ANOther editor, an enhanced free Pico clone
open-motif-2.2.3_6  Motif X11 Toolkit (industry standard GUI (IEEE 1295))
p5-gettext-1.05_2   Message handling functions
pcre-8.00           Perl Compatible Regular Expressions library
perl-5.8.9_2        Practical Extraction and Report Language
pkg-config-0.23_1   A utility to retrieve information about installed libraries
png-1.2.35          Library for manipulating PNG images
portupgrade-2.4.6_2,2 FreeBSD ports/packages administration and management tool s
printproto-1.0.4    Print extension headers
python25-2.5.4_1    An interpreted object-oriented programming language
recordproto-1.13.2  RECORD extension headers
ruby-1.8.7.72_1,1   An object-oriented interpreted scripting language
ruby18-bdb-0.6.5    Ruby interface to Sleepycat's Berkeley DB revision 2 or lat
tiff-3.8.2_3        Tools and library routines for working with TIFF images
unzip-5.52_5        List, test and extract compressed files in a ZIP archive
xbitmaps-1.0.1      X.Org bitmaps data
xcb-proto-1.4       The X protocol C-language Binding (XCB) protocol
xcmiscproto-1.1.2   XCMisc extension headers
xextproto-7.0.5     XExt extension headers
xf86bigfontproto-1.1.2 XFree86-Bigfont extension headers
xorg-macros-1.2.1   X.Org development aclocal macros
xproto-7.0.15       X11 protocol headers
xtrans-1.2.3        Abstract network code for X
xz-4.999.9_1        LZMA compression and decompression tools
zip-3.0             Create/update ZIP files compatible with pkzip
```


----------



## Vespiary (Nov 22, 2009)

What I really need is only a combination of tomcat+java+mysql on my FreeBSD and that's it...


----------



## SirDice (Nov 22, 2009)

Try `# portsclean -CDP`

This will remove old distfiles, packages and clean out any work directories. 
You can also use `# portsclean -DD` this will remove all distfiles _not_ installed.


----------



## zeiz (Nov 22, 2009)

I often use [CMD=""]# portsclean -CDDLP[/CMD] to also delete duplicated, orphan etc shared libraries. (run [CMD=""]% man postsclean[/CMD])
Actually you could delete manually up to everything in /usr/ports/distfiles and /usr/ports/packages keeping in mind that next time you reinstall something back it would be downloaded again to distfiles.


----------



## Vespiary (Nov 23, 2009)

But portsclean does not work and I have portupgrade installed on my FreeBSD. Is there anything else I can do to make portsclean work?

Thanks a lot for previous comments.


----------



## Vespiary (Nov 23, 2009)

After running (run  % man postsclean) the porstclean command started to work! Thanks a lot!


----------



## graudeejs (Nov 23, 2009)

why not to use ports-mgmt/portmaster?

portmaster --clean-distfiles


----------

