# portupgrade questions



## Sh (Aug 25, 2013)

Hello, *I*'m new to *F*reeBSD an*d* right now *I*'m trying to understand ports. Right now *I* have som*e*thing *I* don't understand.

I was trying to update a *p*ort*:*


```
root@freeBSD91:/root # pkg_version -v
autoconf-2.69                       =   up-to-date with port
autoconf-wrapper-20130530           =   up-to-date with port
cmake-2.8.11.2                      =   up-to-date with port
cmake-modules-2.8.11.2              =   up-to-date with port
db41-4.1.25_4                       =   up-to-date with port
dialog4ports-0.1.5_1                =   up-to-date with port
en-freebsd-doc-39278,1              <   needs updating (port has 42489,1)
gettext-0.18.3                      =   up-to-date with port
gmake-3.82_1                        =   up-to-date with port
help2man-1.43.3                     =   up-to-date with port
jed-0.99.19_4                       =   up-to-date with port
libexecinfo-1.1_3                   =   up-to-date with port
libffi-3.0.13                       =   up-to-date with port
libiconv-1.14_1                     =   up-to-date with port
libslang2-2.2.4_4                   =   up-to-date with port
libyaml-0.1.4_2                     =   up-to-date with port
lsof-4.88.d,8                       =   up-to-date with port
m4-1.4.16_1,1                       =   up-to-date with port
p5-Locale-gettext-1.05_3            =   up-to-date with port
pcre-8.33                           =   up-to-date with port
perl-5.14.4                         =   up-to-date with port
pkgconf-0.9.3                       =   up-to-date with port
png-1.5.17                          =   up-to-date with port
portupgrade-2.4.11,2                =   up-to-date with port
ruby-1.9.3.448,1                    =   up-to-date with port
ruby19-bdb-0.6.6_1                  =   up-to-date with port
ruby19-date2-4.0.19                 =   up-to-date with port
```

Everything was up to date except en-freebsd-doc-39278,1*,* so *I* thought *I*'d just do a `portupgrade -ai` and then this package will be updated. But after *I* did the `portupgrade -ai` and answered the question:


```
Upgrading 'en-freebsd-doc-39278,1' to 'en-freebsd-doc-42489,1' (misc/freebsd-doc-en)
OK? [yes] yes
```

portupgrade was running a long time and did a lot of stuff. So *I* did a `pkg_version -v` and now *I* have a lot more ports installed than before:


```
root@freeBSD91:/root # pkg_version -v
OpenSP-1.5.2_2                      =   up-to-date with port
adobe-cmaps-20051217_1              =   up-to-date with port
apr-1.4.8.1.5.2                     =   up-to-date with port
autoconf-2.69                       =   up-to-date with port
autoconf-wrapper-20130530           =   up-to-date with port
bash-4.2.45                         =   up-to-date with port
bigreqsproto-1.1.2                  =   up-to-date with port
bison-2.7.1,1                       =   up-to-date with port
cmake-2.8.11.2                      =   up-to-date with port
cmake-modules-2.8.11.2              =   up-to-date with port
cups-client-1.5.4_1                 =   up-to-date with port
cups-image-1.5.4_1                  =   up-to-date with port
db41-4.1.25_4                       =   up-to-date with port
db42-4.2.52_5                       =   up-to-date with port
dialog4ports-0.1.5_1                =   up-to-date with port
docbook-1.4_1                       =   up-to-date with port
docbook-4.1_4                       =   up-to-date with port
docbook-4.2                         =   up-to-date with port
docbook-4.3                         =   up-to-date with port
docbook-4.4_2                       =   up-to-date with port
docbook-4.5_2                       =   up-to-date with port
docbook-5.0_1                       =   up-to-date with port
docbook-sk-4.1.2_4                  =   up-to-date with port
docbook-xml-4.2_1                   =   up-to-date with port
docbook-xml-4.3                     =   up-to-date with port
docbook-xml-4.4_1                   =   up-to-date with port
docbook-xml-4.5                     =   up-to-date with port
docbook-xsl-1.76.1_1                =   up-to-date with port
docproj-1.17_13                     =   up-to-date with port
dsssl-docbook-modular-1.79_1,1      =   up-to-date with port
dvipdfmx-20110311                   =   up-to-date with port
dvipsk-tetex-5.95a_7                =   up-to-date with port
en-freebsd-doc-42489,1              =   up-to-date with port
expat-2.1.0                         =   up-to-date with port
fixrtf-0.1.20060303_2               =   up-to-date with port
font-amsfonts-3.02_1                =   up-to-date with port
fontconfig-2.10.93,1                =   up-to-date with port
freetype-1.3.1_4                    =   up-to-date with port
freetype-tools-1.3.1_9              =   up-to-date with port
freetype2-2.4.12_1                  =   up-to-date with port
gdbm-1.10                           =   up-to-date with port
gettext-0.18.3                      =   up-to-date with port
ghostscript9-9.06_4                 =   up-to-date with port
gmake-3.82_1                        =   up-to-date with port
gsfonts-8.11_6                      =   up-to-date with port
help2man-1.43.3                     =   up-to-date with port
html2text-1.3.2a                    =   up-to-date with port
igor-1.376                          =   up-to-date with port
inputproto-2.3                      =   up-to-date with port
iso-schematron-xslt-20130313_1      =   up-to-date with port
iso8879-1986_3                      =   up-to-date with port
jadetex-3.13_8                      =   up-to-date with port
jasper-1.900.1_12                   =   up-to-date with port
jbig2dec-0.11_1                     =   up-to-date with port
jbigkit-1.6                         =   up-to-date with port
jed-0.99.19_4                       =   up-to-date with port
jpeg-8_4                            =   up-to-date with port
kbproto-1.0.6                       =   up-to-date with port
latex-cjk-4.8.2_6                   =   up-to-date with port
lcms2-2.5                           =   up-to-date with port
libICE-1.0.8,1                      =   up-to-date with port
libSM-1.2.1,1                       =   up-to-date with port
libX11-1.6.1,1                      =   up-to-date with port
libXau-1.0.8                        =   up-to-date with port
libXaw-1.0.11,2                     =   up-to-date with port
libXdmcp-1.1.1                      =   up-to-date with port
libXext-1.3.2,1                     =   up-to-date with port
libXmu-1.1.1,1                      =   up-to-date with port
libXp-1.0.2,1                       =   up-to-date with port
libXpm-3.5.10                       =   up-to-date with port
libXt-1.1.4,1                       =   up-to-date with port
libcheck-0.9.10                     =   up-to-date with port
libexecinfo-1.1_3                   =   up-to-date with port
libffi-3.0.13                       =   up-to-date with port
libfontenc-1.1.2                    =   up-to-date with port
libgcrypt-1.5.3                     =   up-to-date with port
libgd-2.1.0_1,1                     =   up-to-date with port
libgpg-error-1.12                   =   up-to-date with port
libiconv-1.14_1                     =   up-to-date with port
libidn-1.27                         =   up-to-date with port
libpaper-1.1.24_1                   =   up-to-date with port
libpthread-stubs-0.3_3              =   up-to-date with port
libslang2-2.2.4_4                   =   up-to-date with port
libtool-2.4.2                       =   up-to-date with port
libwww-5.4.0_4                      =   up-to-date with port
libxcb-1.9.1                        =   up-to-date with port
libxml2-2.8.0_2                     =   up-to-date with port
libxslt-1.1.28_1                    =   up-to-date with port
libyaml-0.1.4_2                     =   up-to-date with port
links-1.03,1                        =   up-to-date with port
lsof-4.88.d,8                       =   up-to-date with port
m4-1.4.16_1,1                       =   up-to-date with port
mkfontdir-1.0.7                     =   up-to-date with port
mkfontscale-1.1.1                   =   up-to-date with port
netpbm-10.35.89                     =   up-to-date with port
openjade-1.3.3p1_2                  =   up-to-date with port
p5-Locale-gettext-1.05_3            =   up-to-date with port
p5-XML-Parser-2.41_1                =   up-to-date with port
pcre-8.33                           =   up-to-date with port
peps-2.0_5                          =   up-to-date with port
perl-5.14.4                         =   up-to-date with port
pkgconf-0.9.3                       =   up-to-date with port
png-1.5.17                          =   up-to-date with port
portupgrade-2.4.11,2                =   up-to-date with port
printproto-1.0.5                    =   up-to-date with port
python-2.7,2                        =   up-to-date with port
python2-2                           =   up-to-date with port
python27-2.7.5_2                    =   up-to-date with port
ruby-1.9.3.448,1                    =   up-to-date with port
ruby19-bdb-0.6.6_1                  =   up-to-date with port
ruby19-date2-4.0.19                 =   up-to-date with port
scr2png-1.2_6                       =   up-to-date with port
scr2txt-1.2                         =   up-to-date with port
serf-1.2.1_1                        =   up-to-date with port
sqlite3-3.7.17_1                    =   up-to-date with port
subversion-1.8.1                    =   up-to-date with port
svgalib-1.4.3_6                     =   up-to-date with port
t1lib-5.1.2_2,1                     =   up-to-date with port
t1utils-1.32                        =   up-to-date with port
teTeX-base-3.0_25                   =   up-to-date with port
teTeX-texmf-3.0_9                   =   up-to-date with port
tex-texmflocal-1.9                  =   up-to-date with port
texi2html-5.0_1,1                   =   up-to-date with port
tiff-4.0.3                          =   up-to-date with port
ttf2pt1-3.4.4_4                     =   up-to-date with port
unzip-6.0_1                         =   up-to-date with port
xcb-proto-1.8                       =   up-to-date with port
xcmiscproto-1.2.2                   =   up-to-date with port
xextproto-7.2.1                     =   up-to-date with port
xf86bigfontproto-1.2.0              =   up-to-date with port
xhtml-1.0.20020801_4                =   up-to-date with port
xmlcatmgr-2.2                       =   up-to-date with port
xmlcharent-0.3_2                    =   up-to-date with port
xorg-macros-1.17                    =   up-to-date with port
xproto-7.0.24                       =   up-to-date with port
xtrans-1.2.7                        =   up-to-date with port
zh-arphicttf-2.11_3                 =   up-to-date with port
zh-docproj-0.1.20060303_6           =   up-to-date with port
zh-ttf2pt1-3.4.0                    =   up-to-date with port
zh-ttfm-0.9.5_4                     =   up-to-date with port
zip-3.0                             =   up-to-date with port
```

Well, the one port is now up to date*,* but now *I* have so many other ports installed. But why*?* What happen*e*d? What did *I* *do* wrong?

Many *t*hanks!
sh


----------



## kpa (Aug 26, 2013)

The additional ports that got installed are build time dependencies of the port you updated. They are not cleaned up automatically by ports-mgmt/portupgrade AFAIK. If you're using PKGNG you can do `pkg autoremove` that should do the trick. If not using PKGNG look in to ports-mgmt/pkg_cutleaves.


----------



## SirDice (Aug 26, 2013)

I haven't used it in a while but there's an option to remove build dependencies once portupgrade is done with them.


----------



## Sh (Aug 26, 2013)

Ah ok, now I understand. Is there another best practice for updating and working with ports? 

Sorry for the beginner questions, I still need to find my way in FreeBSD. I am from the Linux world and just work with packages and tools like apt-get.


----------



## SirDice (Aug 26, 2013)

Sh said:
			
		

> Is there another best practice for updating and working with Ports?


I would recommend using ports-mgmt/portmaster instead of ports-mgmt/portupgrade. Portmaster doesn't have any dependencies and doesn't rely on a database to keep track of things. Portupgrade has a tendency to corrupt its database.

But besides that, always, yes, always, read /usr/ports/UPDATING before updating anything. Did I mention you should always read that file? :e


----------



## ShelLuser (Aug 26, 2013)

Indeed, /usr/ports/UPDATING can't be mentioned enough since the impact of ignoring this file can go deep and nasty. And the "devious" part of it is that at first look everything may seem to have been upgraded perfectly. After which, say 4 weeks later, you'll suddenly notice odd things happening.

For what's it worth this is what I always do..  Although I have automated most of it using a shell script, it boils down to this: First I upgrade the ports collection itself using `# portsnap fetch update`. Then I let portmaster sort out the new stuff by using `# portmaster -L | tee portmaster.log`. Then it's simply an issue of going over the list to check which ports have a newer version, and compare them with the entries in /usr/ports/UPDATING (sometimes you get instructions on how to update instead of merely what to do after having performed the upgrade).

And then I simply either upgrade (usually done through `# portmaster -Rad`) or follow whatever instructions have been mentioned in /usr/ports/UPDATING.

Do that approximately once a week and you can't go wrong.


----------

