# Updating python in freeBSD



## rhinestone89 (May 24, 2010)

how can I update python2.6.5 to a newer version given that I've already installed it?
does updating the already installed python affect the softwares that are dependent on it?


----------



## zeiz (May 24, 2010)

I believe that 2.6.5 is newest version of python but doing upgrade you may want to run
`# portupgrade -rR python` to upgrade *all* python's dependencies.
While upgrading from 2.6.4 I only used -R flag and everything is fine here but before (and after) doing that I did:
`# pkgdb -F`


----------



## fronclynne (May 27, 2010)

If you're talking about lang/python31, you'd likely have to do something similar to the 20090608 /usr/ports/UPDATING (qv) 
	
	



```
20090608:
  AFFECTS: users of lang/python* and py-*
  AUTHOR: miwi@FreeBSD.org

  The default version of Python has been changed from 2.5.x to 2.6.x.
  If you have 2.5.x installed, perform an upgrade of lang/python25 to
  lang/python26 with one of the following commands:

  If using portupgrade:
  # portupgrade -o lang/python26 lang/python25

  If using portmaster:
  # portmaster -o lang/python26 lang/python25

  If you want to retain 2.5.x as default Python version, set the
  PYTHON_DEFAULT_VERSION variable to 'python2.5' (without quotes) in
  /etc/make.conf, then go to lang/python and perform the following
  command:

  # portupgrade -R python

  Once the installed Python has been updated to 2.6, by using the
  method above, it is required to run the upgrade-site-packages target in
  lang/python to assure that site-packages are made available to the new
  Python version.

  If using portupgrade:
  # cd /usr/ports/lang/python && make upgrade-site-packages

  If using portmaster:
  # cd /usr/ports/lang/python && make upgrade-site-packages -DUSE_PORTMASTER

  The portmaster case can take quite some time to complete due to the lack of
  cached information that the portupgrade suite uses (specifically pkg_which).
  This is not the fault of portmaster.
```


----------

