# Updating port for security



## mikedm (Feb 26, 2012)

I'm having problems with updating a port (Python in this case) for a security patch. I'm running FreeBSD 8.2 Release and currently the latest version of Python available is 2.6.2. The fixed version is 2.6.3. I can see it in FreshPorts but running 
`# portsnap fetch`
`# portsnap update`
`# portupgrade -a`
doesn't update it.
I guess it's because I'm on the Release branch? I think I need to change the port source tree but a) I'm not sure how to do this and b) I'm worried that when the correct version of Python is available on the release branch it won't get upgraded correctly.

Any advice?


----------



## wblock@ (Feb 26, 2012)

It's nothing to do with -RELEASE, the ports tree is not tied to the version of the operating system.

The latest version of Python 2.6 is 2.6.7,3.  Why you're not seeing that with portsnap, don't know.  Maybe an outdated mirror.

A year ago, the default version of Python was changed to 2.7, so maybe now would be a good time to do that.  It's shown in /usr/ports/UPDATING, entry 20110304.


----------



## razrx (Feb 26, 2012)

Being on release has nothing to do with it.
The ports tree does not use branches.
I haven't used portupgrade(1)() in a long time but maybe your pkgdb(1)() needs updating to reflect the updated ports.

try running: `# pkgdb -fu` as described in portupgrade(1)()


----------



## mikedm (Feb 27, 2012)

Thanks to both of you, that's one less thing to worry about. I will upgrade to 2.7 but I'd like to get to the bottom of why I'm not getting the 2.6.7,3 update. I did try `# pkgdb -fu` but nothing changed. I think portsnap is using the correct mirror since it runs from portsnapX.FreeBSD.org. As a check, I did try running the fetch multiple times and it did try different servers but said that it was already up to date. Is there anything else I can check?

Thanks for your help.


----------



## mikedm (Feb 27, 2012)

Ok, running
`# pkg_version -v | grep python`
gave me

```
python-2.6,2                        =   up-to-date with port
python26-2.6.7_3                    =   up-to-date with port
```

So I guess the naming changed at some stage. Oddly I don't see two python folders in /usr/ports/lang only a python26 folder.
Maybe this is related to not upgrading to 2.7.


----------



## pkubaj (Feb 28, 2012)

What does `$ python2.6 --version` say? If you still can't upgrade, I'd advise to remove /usr/ports and run `# portsnap fetch extract`


----------



## wblock@ (Feb 28, 2012)

mikedm said:
			
		

> Ok, running
> `# pkg_version -v | grep python`
> gave me
> 
> ...



The new version was installed without uninstalling the old one first.  Some of the files will overlap, so they won't uninstall cleanly.  Use pkg_delete(1) to get rid of the old one, then portmaster(8) to upgrade the leftover one:

```
# pkg_delete -f python-2.6,2
# portmaster -o lang/python27 python26-2.6.7_3
```

Edit: there's another step to do afterwards, mentioned in UPDATING entry 20110304.


----------



## mikedm (Feb 28, 2012)

Thanks, that worked. I followed the further instructions in UPDATING as well. I'll need to be more carefull to read UPDATING in future.


----------



## SirDice (Feb 29, 2012)

mikedm said:
			
		

> I'll need to be more carefull to read UPDATING in future.


You can also use the pkg_updating(1) command.


----------



## mikedm (Mar 1, 2012)

Thanks, that's a new one to me.


----------

