# Downgrade tmux to 1.8 in jail



## NasKar (Apr 19, 2016)

I need to downgrade sysutils/tmux to version 1.8 in my jail which currently has 2.1.  Directions I found on the net show to go to

```
# cd /usr/ports/sysutils/portdowngrade
# make DEFAULT_CVS_SERVER=\freebsdanoncvs@anoncvs.FreeBSD.org:/home/ncvs install clean
# portdowngrade tmux
```

But there is no portdowngrade directory in sysutils.
I ran `make DEFAULT_CVS_SERVER=\freebsdanoncvs@anoncvs.FreeBSD.org:/home/ncvs install clean` from the sysutils directory and got a bunch of errors.

I'm running FreeNAS 9.3. Any help would be appreciated.


----------



## SirDice (Apr 20, 2016)

NasKar said:


> I'm running FreeNAS 9.3.


PC-BSD, FreeNAS, NAS4Free, and all other FreeBSD Derivatives


----------



## NasKar (Apr 21, 2016)

SirDice: My apologies for posting here I mistakenly thought it was ok because FreeNAS is based on FreeBSD.
Would it be possible for someone to tell me how to fix this error message.  I'm pretty sure it has to do with the location of the FreeBSD repo.

Here is the post I made on the FreeNAS forums:
https://forums.freenas.org/index.php?threads/downgrade-tmux-to-1-8-in-jail.42879/


```
portdowngrade sysutils/tmux
Choose a revision from this list and run /usr/local/sbin/portdowngrade sysutils/tmux revision
svn: E170013: Unable to connect to a repository at URL 'http://svn.freebsd.org/ports/head/sysutils/tmux'
svn: E000065: Error running context: No route to host
Choose a revision from the above list and run /usr/local/sbin/portdowngrade sysutils/tmux revision
```


----------



## SirDice (Apr 21, 2016)

Why do you need to downgrade tmux in the first place?


----------



## NasKar (Apr 21, 2016)

The software I'm using is not compatable with 2.1 they recommend 1.8.  When I run tmux I get 3 dead panes.


----------



## SirDice (Apr 21, 2016)

What software? Tmux 2.0 was released a year ago. I'd say that's ample time to update the software and make it compatible.


----------



## wblock@ (Apr 21, 2016)

Last I knew, ports-mgmt/portdowngrade didn't work any more because it had not been updated to work with Subversion.  The old CVS repositories no longer exist.


----------



## protocelt (Apr 21, 2016)

wblock@ said:


> Last I knew, ports-mgmt/portdowngrade didn't work any more because it had not been updated to work with Subversion.  The old CVS repositories no longer exist.


I have never used ports-mgmt/portdowngrade myself, though a quick peek on FreshPorts lists devel/subversion as a hard dependency. I would expect then it was updated to work with Subversion.


----------



## NasKar (Apr 22, 2016)

So is there a way to downgrade TMUX to 1.8 or even 2.0? Apparently 2.1 tmux doesn't work and tmux is used to automate running of php and .sh files to update a database.


----------



## SirDice (Apr 22, 2016)

Tmux 2.1 works just fine. Only a few configuration options have changed. There is no reason why this cannot be fixed in your software.


----------



## NasKar (Apr 22, 2016)

The software is nZEDb and the moderators in there IRC chat room tell me that tmux 2.1 is not compatible with it and recommended I downgrade to 1.8 or 2.0.  Can't say why as I'm a novice.  When I run tmux I get dead panes.  Screen works.


----------



## SirDice (Apr 22, 2016)

If tmux 2.0 works, 2.1 should work too. There have been some configuration changes between 1.x and 2.x, but 2.1 is the same as 2.0.

Try and find out what exactly is the issue, we may be able to help with that. Downgrading isn't the correct solution, fixing the issue is.


----------



## NasKar (Apr 30, 2016)

Here is were it states not to use tmux 2.1
https://github.com/nZEDb/nZEDb/wiki/Operational-Modii
Look under tmux General/Notes:
Can use 2.0 and lower.

I'm trying to install tmux1.9 from the tarball but can't get to work
extracted the tarball to tmux 1.9 directory
installed libevent-2.0.22-stable
`./configure && make`
and got errors

```
./configure && make
rm: conf80983.dir/conf80983.file: Not a directory
./configure: cat: not found
./configure: cat: not found
./configure: cat: not found
./configure: cat: not found
./configure: cat: not found
./configure: cat: not found
./configure: cat: not found
./configure: cat: not found
./configure: cat: not found
checking for a BSD-compatible install... ./configure: mkdir: not found
install: target directory `/usr/local/custom/tmux-1.9/libevent-2.0.22-stable/conftest.dir' does not exist
usage: install [-bCcpSsUv] [-f flags] [-g group] [-m mode] [-o owner]
               [-M log] [-D dest] [-h hash] [-T tags]
               [-B suffix] [-l linkflags] [-N dbdir]
               file1 file2
       install [-bCcpSsUv] [-f flags] [-g group] [-m mode] [-o owner]
               [-M log] [-D dest] [-h hash] [-T tags]
               [-B suffix] [-l linkflags] [-N dbdir]
               file1 ... fileN directory
       install -dU [-vU] [-g group] [-m mode] [-N dbdir] [-o owner]
               [-M log] [-D dest] [-h hash] [-T tags]
               directory ...
./install-sh -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... ./configure: cat: not found
no
./configure: cat: not found
./configure: cat: not found
checking build system type... x86_64-unknown-freebsd9.3
checking host system type... x86_64-unknown-freebsd9.3
checking for gcc... gcc
./configure: cat: not found
./configure: cat: not found
./configure: cat: not found
./configure: cat: not found
checking whether the C compiler works... no
configure: error: in `/usr/local/custom/tmux-1.9/libevent-2.0.22-stable':
configure: error: C compiler cannot create executables
See `config.log' for more details
exit: cat: not found
```

Not sure how to proceed.


----------



## acheron (May 1, 2016)

Have you seen this? https://github.com/nZEDb/nZEDb/issues/1966


----------



## wblock@ (May 1, 2016)

Use the Subversion history of the port to find the last version of 1.8, then check that out and hope the distfiles are still around and it still builds.

```
cd /usr/ports/sysutils/tmux
svn up -r 341527
```


----------



## NasKar (May 1, 2016)

wblock@ said:


> Use the Subversion history of the port to find the last version of 1.8, then check that out and hope the distfiles are still around and it still builds.




```
usr/ports/sysutils/tmux]# svn up -r 341527
Skipped '.'
svn: E155007: None of the targets are working copies
```



acheron said:


> Have you seen this? https://github.com/nZEDb/nZEDb/issues/1966


Yes I have but I'm told by the people who maintain the software that there are other problems with 2.1 and it should be avoided.

Can anyone describe how to install tmux 1.8 from a tarball?


----------



## tobik@ (May 1, 2016)

NasKar said:


> svn: E155007: None of the targets are working copies


`svn co -r 341527 https://svn.freebsd.org/ports/head/sysutils/tmux  /usr/ports/sysutils/tmux`

But since you can use tmux 2.0 I would checkout revision 399264 instead. It'll still build. tmux 1.8 doesn't anymore.


----------



## wblock@ (May 2, 2016)

NasKar, Subversion will only work on a repo checkout, not with a ports tree extracted from a tarball or portsnap(8).

And the port really is the way to go.  All the details of building it have already been worked out.  And when your software finally works with a modern version, it will be easy to deinstall the old one.


----------



## NasKar (May 3, 2016)

someone in another forum suggested this:

"I'd personally edit the port to change the version number, 'make makesum' and 'make install' it."
cd /usr/ports/sysutils/tmux
Then edit the version in the file "Makefile"
Run "make makesum" to create a new 'distinfo' file for you

Got this after editing the version to 1.9:

```
/usr/ports/sysutils/tmux # make makesum
===> License ISCL accepted by the user
===> tmux-1.9_1 depends on file: /usr/local/sbin/pkg - found
/bin/mkdir: No such file or directory
*** [do-fetch] Error code 1

Stop in /usr/ports/sysutils/tmux.
*** [makesum] Error code 1

Stop in /usr/ports/sysutils/tmux.
```


----------



## wblock@ (May 3, 2016)

That procedure makes some assumptions which are probably not valid.  Why don't you try what we posted here?


----------



## NasKar (May 4, 2016)

I've tried everything that was suggested. If you wouldn't mind explaining the steps you recommend again.  My head is swimming with this stuff. Thanks for trying to help me.


----------



## wblock@ (May 4, 2016)

```
rm -rf /usr/ports
svn checkout https://svn.freebsd.org/ports /usr/ports
cd /usr/ports/sysutils/tmux
svn up -r 399264
make deinstall install
```


----------



## NasKar (May 4, 2016)

I get this error after the 2nd step

```
svn checkout https://svn.freebsd.org/ports /usr/ports
svn: E170013: Unable to connect to a repository at URL 'https://svn.freebsd.org/ports'
svn: E000065: Error running context: No route to host
```


----------



## wblock@ (May 4, 2016)

Networking must be set up, or it will not be able to download anything.


----------



## NasKar (May 4, 2016)

I've installed wget and it works


----------



## NasKar (May 4, 2016)

```
wget [URL]https://svn.freebsd.org/ports[/URL]
--2016-05-03 22:18:27--  [URL]https://svn.freebsd.org/ports[/URL]
Resolving svn.freebsd.org (svn.freebsd.org)... 2610:1c1:1:606c::e6a:0, 96.47.72.69
Connecting to svn.freebsd.org (svn.freebsd.org)|2610:1c1:1:606c::e6a:0|:443... failed: No route to host.
Connecting to svn.freebsd.org (svn.freebsd.org)|96.47.72.69|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: [URL]https://svn.freebsd.org/ports/[/URL] [following]
--2016-05-03 22:18:27--  [URL]https://svn.freebsd.org/ports/[/URL]
Reusing existing connection to svn.freebsd.org:443.
HTTP request sent, awaiting response... 200 OK
Length: 341 [text/html]
Saving to: 'ports'

ports                                                               100%[===================================================================================================================================================================>]     341  --.-KB/s   in 0s    

2016-05-03 22:18:27 (30.4 MB/s) - 'ports' saved [341/341]
```


----------



## tobik@ (May 4, 2016)

Looks like your IPv6 isn't setup properly and SVN will try it first and bail while wget falls back to IPv4. 

The checkout command should be `svn checkout https://svn.freebsd.org/ports/head /usr/ports`.  Using https://svn.freebsd.org/ports will checkout all branches which is not what you want, but using https://svn.freebsd.org/ports/head will limit the checkout to only the HEAD branch.

If all else fails try using the IP address 96.47.72.69 instead of svn.freebsd.org. I don't see a way to force SVN to not use IPv6.


----------



## NasKar (May 5, 2016)

I edited the settings of the jail and turned on auto IPv6


```
[root@nzedb /]# rm -rf /usr/ports
[root@nzedb /]# svn checkout https://svn.freebsd.org/ports /usr/ports
svn: E170013: Unable to connect to a repository at URL 'https://svn.freebsd.org/ports'
svn: E000065: Error running context: No route to host
[root@nzedb /]# svn checkout 96.47.72.69 /usr/ports
svn: E125002: '96.47.72.69' does not appear to be a URL
[root@nzedb /]# svn checkout https://96.47.72.69 /usr/ports
Error validating server certificate for 'https://96.47.72.69:443':
- The certificate hostname does not match.
Certificate information:
- Hostname: svn.freebsd.org
- Valid: from Jun 22 00:00:00 2015 GMT until Jun 22 23:59:59 2016 GMT
- Issuer: Gandi Standard SSL CA 2, Gandi, Paris, Paris, FR
- Fingerprint: E9:37:73:80:B5:32:1B:93:92:94:98:17:59:F0:FA:A2:5F:1E:DE:B9
(R)eject, accept (t)emporarily or accept (p)ermanently? p   
svn: E170013: Unable to connect to a repository at URL 'https://96.47.72.69'
svn: E175009: The XML response contains invalid XML
svn: E130003: Malformed XML: no element found
[root@nzedb /]# svn checkout http://96.47.72.69 /usr/ports
svn: E170013: Unable to connect to a repository at URL 'http://96.47.72.69'
svn: E175009: The XML response contains invalid XML
svn: E130003: Malformed XML: no element found
```


----------



## tobik@ (May 5, 2016)

`svn checkout https://96.47.72.69/ports/head /usr/ports`


----------



## NasKar (May 5, 2016)

wblock@ said:


> rm -rf /usr/ports svn checkout https://svn.freebsd.org/ports /usr/ports cd /usr/ports/sysutils/tmux svn up -r 399264 make deinstall install





tobik said:


> svn checkout https://96.47.72.69/ports/head /usr/ports


tobik this worked I had to hit p to permanently accept the certificate.  I then followed @wblock post and an avalanche of stuff happened.  I kept hitting ok as the default when a window with options popped up.
When it was all finished I did

```
/usr/ports/sysutils/tmux # tmux -V
tmux 2.0
```
Thanks you so much to everyone that helped and especially to tobik and wblock@.


----------



## NasKar (May 10, 2016)

I tried this same code in another jail running the same software and got this:

```
/usr/ports/sysutils/tmux # make deinstall install
===>  Deinstalling for tmux
===>   tmux not installed, skipping
===> Cannot create /var/db/ports/sysutils_tmux, check permissions
*** [do-config] Error code 1

Stop in /usr/ports/sysutils/tmux.
*** [config-conditional] Error code 1

Stop in /usr/ports/sysutils/tmux.
```
Any idea what is causing the error? The permissions in the directory are all root:wheel


----------



## SirDice (May 11, 2016)

NasKar said:


> The permissions in the directory are all root:wheel


That's the ownership, not the permissions. What are the permissions on /var/db/ports/? The permissions should be 755 and the ownership root:wheel.


----------



## NasKar (May 12, 2016)

Yes my permission on the /var/db/ports is 755 and ownership is root:wheel but the directory is empty.
Also any idea why the command `mkdir` cannot be found? It doesn't exist in my /usr/bin or /bin.  Did I remove it by accident and how do I get it back?
My

```
echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/root/bin
```


----------



## NasKar (May 12, 2016)

it seems that

```
portsnap fetch && portsnap extract
```
eliminated the `mkdir` command. How do I reinstall it?


----------



## SirDice (May 12, 2016)

NasKar said:


> it seems that
> 
> ```
> portsnap fetch && portsnap extract
> ...


portsnap(8) doesn't touch anything outside /usr/ports/ and /var/db/portsnap, so that's highly unlikely. Besides that, mkdir(1) is part of the base OS.


----------

