# fetch older version of a certain port



## _martin (May 11, 2013)

Hi, 

Is there a way to fetch an older version of a certain port? I need to downgrade rtorrent/libtorrent to 0.8.9/0.12.9. Currently I'm running amd64 9.1-RELEASE.  I'd like to apply patches that came with that version and avoid building it from sources myself. 

One option is to fetch this from older binary port collection (e.g. 8.3-RELEASE), but after that there's a problem with a library:

`# ldd `which rtorrent`|grep not`

```
libz.so.5 => not found (0)
```

Which was upgraded to libz.so.6 in FreeBSD 9. When I create symlink from version 6 to version 5 I got this working. But obviously this is not the correct way (and application still may crash).
That's why I'm looking for a way to install older version of a port.


----------



## kpa (May 11, 2013)

Downgrading the port is not going to fix the issue. Instead, remove the symlink you made and recompile the rtorrent ports.


----------



## cpm@ (May 11, 2013)

If you need downgrade a port, try ports-mgmt/portdowngrade which supports SVN.


----------



## wblock@ (May 11, 2013)

Remove fake symlinks.  Install sysutils/bsdadminscripts.  Run `pkg_libchk -q`.  Rebuild everything it reports as missing libraries, preferably all at the same time with ports-mgmt/portmaster so they are built in the right order.

After fixing everything, remind yourself to read and follow new entries in /usr/ports/UPDATING before installing or updating ports.


----------



## kpa (May 11, 2013)

Well, downgrading the port would be solving the wrong problem and still wouldn't do any good. Install the misc/compat8x port if you don't want to recompile the rtorrent ports.


----------



## _martin (May 11, 2013)

kpa said:
			
		

> Downgrading the port is not going to fix the issue.


On the contrary, that's what is going to fix my issue. Tracker doesn't support higher version and  I don't have any means to change his mind.

@@wblock That might be a way to go, but it seems to get more complicated on the way (as more dependencies may arise and I need to follow UPDATING file).



			
				cpu82 said:
			
		

> If you need downgrade a port, try ports-mgmt/portdowngrade which supports SVN.



@@cpu82: Thanks! That's exactly what I was looking for. Perfect to check commits and rollback to any state I desire.


----------



## kpa (May 11, 2013)

What I mean is that if you downgrade the port to an older version you would still have recompile the port. Recompiling the older version of the port would solve the wrong dependency problem for you because the compilation would use the proper version of libz.so for FreeBSD 9.


----------



## _martin (May 11, 2013)

@@kpa Then correct. But that is actually what I stated in my question - how to fetch and compile an older version. Installing an older binary package(s) was just a workaround for connecting to a tracker (successful one, but with a broken pkg database).


----------



## wblock@ (May 11, 2013)

matoatlantis said:
			
		

> @@wblock That might be a way to go, but it seems to get more complicated on the way (as more dependencies may arise and I need to follow UPDATING file).



Following /usr/ports/UPDATING is less complicated than trying to repair a broken system.  PKGNG's upgrade option might make that unnecessary, but only if you stick to precompiled packages.


----------



## cpm@ (May 25, 2013)

Other way to downgrade a port:

Check the revision for downgrading
`# svn log [url=svn://svn0.us-east.freebsd.org/ports/head/net-p2p/libtorrent]svn://svn0.us-east.freebsd.org/ports/he ... libtorrent[/url] | less`

Downgrade net-p2p/libtorrent

```
[CMD]# rm -rf /usr/ports/net-p2p/libtorrent[/CMD]
[CMD]# svn export -r r277897 svn://svn0.us-east.freebsd.org/ports/head/net-p2p/libtorrent /usr/ports/net-p2p/libtorrent[/CMD]
[CMD]# make deinstall install clean -C /usr/ports/net-p2p/libtorrent[/CMD]
```


----------

