# system clean



## sk8harddiefast (Apr 3, 2010)

how can i clean my system from useless packages,dependencies,old distfiles etc???


----------



## Lowell (Apr 3, 2010)

For old distfiles, I use portsclean(1)() from the ports-mgmt/portupgrade port, but if you use portmaster et. al., you should use the equivalent from your tool of choice.

For removing unneeded dependencies, I like the ports-mgmt/pkg_cutleaves port.


----------



## fronclynne (Apr 3, 2010)

For compleatness sake:

ports-mgmt/portmaster has --clean-distfiles.

If you regularly use portmaster without -B, you might find a goodly number of packages tucked away in /usr/ports/packages/.  These are usually safe to delete (& if you change your mind -b is also available).


----------



## sk8harddiefast (Apr 3, 2010)

ok.I clean distfiles with porsclean -D, i make porstclean -C also,I install pkg_cutleaves but pkg_cutleaves -l give me this:

```
acroread8-8.1.7_1
agg-2.5_5
ansifilter-1.3
apache-ant-1.7.1
argtable-2.12
artwiz-aleczapka-en-1.3_2
artwiz-fonts-1.0_3
audacious-2.2_2
audacious-plugins-2.2_4
audacious-skins-0.1_6
audacity-1.2.4b_7
automoc4-0.9.88_1
azureus-3.1.1.0_3
bdftopcf-1.0.1
bigreqsproto-1.0.2
bisoncpp-2.4.8
bisongen-0.8.0b1
boost-jam-1.41.0
boost-libs-1.41.0_1
bzip2-1.0.5
cabextract-1.2
cmake-2.8.0_3
commoncpp-1.7.3,2
compat7x-amd64-7.2.702000.200906.1
conky-1.7.2_6
coreutils-7.5
cos-2002.11.05_2,1
cursor-bluecurve-theme-7.0.0_3
cvsup-without-gui-16.1h_4
dejavu-2.30_1
docproj-jadetex-1.17_4
docproj-nojadetex-1.17_4
doxygen-1.6.3_1
e2fsprogs-1.41.11
e2fsprogs-libuuid-1.41.11
eject-1.5_4
el-freebsd-doc-20100213
elf-0.5.4p1_1
elfio-1.0.3_2
en-freebsd-doc-20100213
evieext-1.0.2
exempi-2.1.1
expect-5.44.1.15
ezm3-1.1_2
fc++-1.5
filezilla-3.3.2.1_1
findutils-4.4.2
flex-2.5.35_3
fribidi-0.19.2_1
frostwire-4.17.0
gawk-3.1.6_1
gcalctool-5.28.2_2,2
glproto-1.4.10
gnucflow-1.3
google-earth-5.1.3533.1731
gperf-3.0.3
gqview-2.0.4_11
graphviz-2.26.3_2
gsed-4.2.1
gtar-1.23
gtk-bluecurve-theme-7.0.0_3
gtk-doc-1.13
gtk-engines-0.12_11
gtk-murrine-engine-0.90.3_3
gzip-1.4
help2man-1.37.1_2
html2tex-2.7
htop-0.8.3
icmake-7.12.3
icon-naming-utils-0.8.90
icon-slicer-0.3_6
icons-human-azul-0.1_1
imake-1.0.2_4,1
iw-hspell-1.0
ja-a2ps-1.45
jakarta-commons-cli-1.0_2,1
jakarta-commons-lang-2.3_2
junit-4.8.1
kdelibs-3.5.10_5
kdenlive-0.7.7.1_1
ladspa-1.13
latex-cjk-4.8.2_4
libbobcat-2.05.00
libcanberra-0.22_3
libelf-0.8.13
liberation-fonts-ttf-1.05.2.20091227,1
libglut-7.4.4
libgnomesu-1.0.0_8
libgtop-2.28.0_2
libical-0.43_1
libmetalink-0.0.3
libmikmod-esound-3.1.11_2
libpcbsd-8.0
libpci-3.1.7_1
libsigc++-1.2.7_1
libsigc++-2.2.4.2
linux-f10-flashplugin-10.0r45
log4j-1.2.15_1
lzop-1.02.r1
mawk-1.3.3
mc-4.7.0.2_2
mixxx-1.7.0_1
mplayer-0.99.11_17
nano-2.2.3
nas-1.9.1_3
nasm-2.07,1
nawk-20091126
nmap-5.21_1
nspluginwrapper-1.2.2_7
nss-3.12.4_2
nvidia-driver-195.22
nvidia-xconfig-195.36.03
opera-linuxplugins-10.10.20091120_2
p5-Exporter-Easy-0.16
p5-File-FnMatch-0.02
p5-Locale-libintl-1.20_1
p5-Module-Build-0.3601
p5-Term-ANSIScreen-1.42
p5-type1inst-0.6.1_5
p7zip-9.04
patch-2.6.1
pccts-1.33.33
pciutils-3.1.7
pkg_cutleaves-20090810
poppler-qt-0.12.3_2
portmaster-2.20
portupgrade-2.4.6_4,2
pth-2.0.7
pulseaudio-0.9.21_3
py26-gtk-2.16.0_2
py26-posix1e-0.4.0
py26-xml-0.8.4_2
pylibacl-0.4.0
qmake-3.3.8_1
qt4-linguist-4.6.1_1
qt4-qmake-4.6.1
qt4-rcc-4.6.1
qt4-uic-4.6.1
rar-3.91,2
resourceproto-1.0.2
ristretto-0.0.22_3
rpm-3.0.6_14
rpm2cpio-1.2_2
ruby18-deplate-0.8.5
scons-1.2.0_20091224
skype-2.0.0.72,1
stow-1.3.3_2
sudo-1.7.2.5
symlinks-1.4
sysinfo-1.0.1
tclthread-2.6.5_1
thunar-volman-0.2.0_8
tmake-1.7_5
unmakeself-1.1
unrar-3.93,5
untar-1.4_1
unzip-6.0
urwfonts-1.0_3
v4l_compat-1.0.20100321
webfonts-0.30_6
wget-1.12
wireshark-1.2.6_1
wxgtk2-unicode-contrib-2.8.10_4
xarchiver-0.5.2_3
xcmiscproto-1.1.2
xf86bigfontproto-1.1.2
xf86driproto-2.0.4
xfburn-0.4.1_6
xfce-4.6.1_2
xfce4-cpugraph-plugin-0.3.0_12
xfce4-dev-tools-4.6.0
xfce4-fsguard-plugin-0.4.2_6
xfce4-mailwatch-plugin-1.1.0_8
xfce4-places-plugin-1.2.0_3
xfce4-power-manager-0.8.2_3
xfce4-quicklauncher-plugin-1.9.4_9
xfce4-systemload-plugin-0.4.2_11
xfce4-taskmanager-0.4.0.r2_14
xfce4-weather-plugin-0.7.3_3
xfce4-xkb-plugin-0.4.3_10
xlispstat-3.52.20_2
xorg-7.4_4
xorg-macros-1.2.1
yasm-0.8.0
yodl-2.15.1_2
youtube_dl-2010.03.13
zh-docproj-0.1.20060303_4
zh-ttf2pt1-3.4.0
zip-3.0
```
here is my 3/4 of my tools that i installed and i need them!


----------



## Beastie (Apr 3, 2010)

That's normal. Applications are "top level", so no other port requires them as a dependency and they are therefore detected by utilities such as *pkg_cutleaves* as being leaves (junk).

Simply exclude those applications you use, and remove all the rest in that list.

IIRC, there's an option in *pkg_cutleaves* that lets you pass an exclude list or something like that.


----------



## fronclynne (Apr 3, 2010)

Beastie said:
			
		

> IIRC, there's an option in *pkg_cutleaves* that lets you pass an exclude list or something like that.


Or try:

```
-V  Visual mode. Will compile a list of leaf packages and invoke the
         user's EDITOR.  Lines or package names that are deleted in the editor
         will then be removed.
```


----------



## sk8harddiefast (Apr 3, 2010)

on pkg_cutleaves -V i remove the lines that i want to keep or this i want to deinstall?


----------



## fronclynne (Apr 3, 2010)

In *-V* you delete the lines you want removed.  Don't be afraid, it prompts you for the actual removal*.



* this being a unix or a unix-work-alike, I would consider this a bug or (more pejoratively) useless hand-holding, but I didn't write the tool, so my opinion carries no weight.


----------

