# Error installing EXPECT



## philipz (Sep 20, 2010)

Hi,

I am trying to install the EXPECT scripting language on my FreeBSD 6.2 release.
When trying to do that from the port available on my system it fails:

```
[me@myserver /home/me]# cd /usr/ports/lang/expect
[me@myserver /usr/ports/lang/expect]# make
===>  Vulnerability check disabled, database not found
===>  Extracting for expect-5.43.0_3
=> MD5 Checksum mismatch for expect-5.43.0.tar.gz.
=> SHA256 Checksum mismatch for expect-5.43.0.tar.gz.
===>  Refetch for 1 more times files: expect-5.43.0.tar.gz expect-5.43.0.tar.gz
===>  Vulnerability check disabled, database not found
=> expect-5.43.0.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch from http://expect.nist.gov/src/.
fetch: http://expect.nist.gov/src/expect-5.43.0.tar.gz: Moved Permanently
=> Attempting to fetch from ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/.
fetch: ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/expect-5.43.0.tar.gz: size mismatch: expected 525570, actual 525572
=> Couldn't fetch it - please try to retrieve this
=> port manually into /usr/ports/distfiles/ and try again.
*** Error code 1

Stop in /usr/ports/lang/expect.
*** Error code 1

Stop in /usr/ports/lang/expect.
```

Although it says that expect-5.43.0.tar.gz doesn't exist in /usr/ports/distfiles/ it does.
So then I try to add this package manually:

```
[me@myserver /usr/ports/distfiles]# pkg_add expect-5.43.0_3.tbz
pkg_add: could not find package libpthread-stubs-0.3_3 !
pkg_add: could not find package libxcb-1.6 !
pkg_add: could not find package tk-8.4.19_2,2 !
[root@J-700S053 /usr/ports/distfiles]#
```

So I believe I am missing some dependencies here:

```
[root@J-700S053 /usr/ports/distfiles]# pkg_add libpthread-stubs-0.3_3
pkg_add: can't stat package file 'libpthread-stubs-0.3_3'
[root@J-700S053 /usr/ports/distfiles]# pkg_add -r libpthread-stubs-0.3_3
Error: FTP Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.2-release/Latest/libpthread-stubs-0.3_3.tbz: File unavailable 
(e.g., file not found, no access)
pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.2-release/Latest/libpthread-stubs-0.3_3.tbz' by URL
```

I am a bit stuck on how to proceed since I cannot find the 3 dependant packages (tbz-files to add to my system) on the web.

Not sure what I am missing to make this work; any advice?
I am not very familiar with packages/BSD systems so I might do something wrong anyway.

Thanks,

Phil


----------



## jb_fvwm2 (Sep 20, 2010)

sometimes you can find the .gz file elsewhere on
the web, download it and put it in
/usr/ports/distfiles (in the case of /expect/, it
is only potentially hosted at two places.)


----------



## jb_fvwm2 (Sep 21, 2010)

```
/bin/rm -rf work
make -DNO_CHECKSUM build
```
Do you know from where the file that
exists was downloaded from?


----------



## sk8harddiefast (Sep 21, 2010)

> I am a bit stuck on how to proceed since I cannot find the 3 dependant packages (tbz-files to add to my system) on the web.


For amd64
http://freebsd.csie.ncu.edu.tw/Free...es-8.1-release/All/libpthread-stubs-0.3_3.tbz
http://freebsd.csie.ncu.edu.tw/FreeBSD/ports/amd64/packages-8.1-release/All/libxcb-1.6.tbz
http://freebsd.csie.ncu.edu.tw/FreeBSD/ports/amd64/packages-8.1-release/All/tk-8.4.19_2,2.tbz
For i386
http://freebsd.csie.ncu.edu.tw/Free...es-8.1-release/All/libpthread-stubs-0.3_3.tbz
http://freebsd.csie.ncu.edu.tw/FreeBSD/ports/i386/packages-8.1-release/All/libxcb-1.6.tbz
http://freebsd.csie.ncu.edu.tw/FreeBSD/ports/i386/packages-8.1-release/All/tk-threads-8.4.19_2,2.tbz


----------



## philipz (Sep 21, 2010)

jb_fvwm2 said:
			
		

> sometimes you can find the .gz file elsewhere on
> the web, download it and put it in
> /usr/ports/distfiles


The file is in that directory, even if the system says it isn't:

```
[me@myserver /usr/ports/distfiles]# ls -l | grep expect
-rw-r--r--   1 me    wheel    525572 Sep 20 09:44 expect-5.43.0.tar.gz
```




			
				jb_fvwm2 said:
			
		

> ```
> /bin/rm -rf work
> make -DNO_CHECKSUM build
> ```
> ...


I am not sure what this code is supposed to do?
I downloaded that one from freebsd.org if I recall correctly.



			
				sk8harddiefast said:
			
		

> For i386
> http://freebsd.csie.ncu.edu.tw/Free...es-8.1-release/All/libpthread-stubs-0.3_3.tbz
> http://freebsd.csie.ncu.edu.tw/FreeBSD/ports/i386/packages-8.1-release/All/libxcb-1.6.tbz
> http://freebsd.csie.ncu.edu.tw/FreeBSD/ports/i386/packages-8.1-release/All/tk-threads-8.4.19_2,2.tbz



When I try to add these packages it comes complaining about dependencies and I cannot delete the old packages:


```
[me@myserver /usr/ports/distfiles]# pkg_add kbproto-1.0.4.tbz
pkg_add: package 'kbproto-1.0.4' or its older version already installed
[me@myserver /usr/ports/distfiles]# pkg_version -v | grep kbproto
kbproto-1.0.3                       =   up-to-date with port
[me@myserver /usr/ports/distfiles]# pkg_delete kbproto-1.0.3
pkg_delete: package 'kbproto-1.0.3' is required by these other packages
and may not be deinstalled:
libX11-1.1.3,1
tk-8.4.16,2
expect-5.43.0_3
[me@myserver /usr/ports/distfiles]#
```

With -r option:

```
[me@myserver /usr/ports/distfiles]# pkg_add -r pkg-config-0.23_1
Error: FTP Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.2-release/Latest/pkg-config-0.23_1.tbz: File unavailable (e.g., file not found, no access)
pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.2-release/Latest/pkg-config-0.23_1.tbz' by URL
```

Any other ideas? I tried to install with portmanager as well (portmanager /lang/expect/ -f) but that fails as well although all files are there:


```
Tue Sep 21 11:57:58 2010
 expect-5.43.0_3                     /lang/expect/
    MISSING                             expect-5.43.0_3                     /lang/expect/

Tue Sep 21 11:58:03 2010
 expect-5.43.0_3                     /lang/expect/
    failed during make, adding to ignore.db

Tue Sep 21 11:58:10 2010
 portmanager                         0.4.1_9
    INFO: finished with some ports not updated  if --log was used see /var/log/portmanager.log

Tue Sep 21 11:58:10 2010
 end of log
```


----------



## jb_fvwm2 (Sep 21, 2010)

FWIW portmanager I've not used recently, all of
a sudden a few years ago , it reports "MISSING"
erroneously
...
...
this code should work, halting on error in this
case on the expect part (checksum mismatch)...
which is why I posted the alternate code above.

```
portmaster -d -B /var/db/pkg/something-1.2 
lang/expect audio/yell 
/var/db/pkg/something-4.2.3 /var/db/pkg/something-1.2.3
&& yell
```
 seems easy usually.
... obviously you'd want /yell/ installed first
(added it to be above, might work)
............................
The code I posted 
in the post above this one would test more-or-less 
test 
if the
gz file (expect) would install successfully after a build.
...
The packages install (problems) (are 
usually)  much more complex than
the port install (problem(s)). (easy if you are
experienced, your shell saves history across
reboots or you've scripted it, only a few
dependencies for the port, etc etc.. ) all in
all if packages fail to install, unless a simple
fix (delete before install) the port builds are
easier to get working.


----------



## philipz (Sep 22, 2010)

So I have installed portmaster to get the above running.
Then I did the following:

```
[me@myserver /usr/ports/distfiles]# ls -l /usr/ports/distfiles/expect-5.43.0.tar.gz
-rw-r--r--  1 me  wheel  525572 Sep 22 11:34 /usr/ports/distfiles/expect-5.43.0.tar.gz
===>>> Waiting on fetch & checksum for lang/expect <<<===
===>  Vulnerability check disabled, database not found
=> expect-5.43.0.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch from http://expect.nist.gov/src/.
fetch: http://expect.nist.gov/src/expect-5.43.0.tar.gz: Connection refused
=> Attempting to fetch from ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/.
fetch: ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/expect-5.43.0.tar.gz: size mismatch: expected 525570, actual 525572
=> Couldn't fetch it - please try to retrieve this
=> port manually into /usr/ports/distfiles/ and try again.
*** Error code 1

Stop in /usr/ports/lang/expect.

===>>> make failed for lang/expect
===>>> Aborting update

[me@myserver /usr/ports/distfiles]# ls -l /usr/ports/distfiles/expect-5.43.0.tar.gz
ls: /usr/ports/distfiles/expect-5.43.0.tar.gz: No such file or directory
[me@myserver /usr/ports/distfiles]#
```

It appears that portmaster deletes the file expect-5.43.0.tar.gz from ../distfiles, tries to download it (which fails) and then complains that it is not available in ../distfiles 

Also, during the fetch it complains about a size mismatch:
fetch: ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/expect-5.43.0.tar.gz: size mismatch: expected 525570, actual 525572
Any way to get around that so that it will download and install the package anyway?

Thanks!


----------



## jb_fvwm2 (Sep 22, 2010)

see the post #3, substituting "install" for
"build" if you know the .gz came from one
of the two official sites.
...
/expect/ just downloaded here fine.  You maybe
can also try /expect-devel/ instead.  Or update
the ports tree for it
running the below from /usr/ports:

```
csup -g -L 2 -i ports/lang/expect supfile.new
```
You would need a new supfile.new in 
/usr/ports for that to work. (supfile-ports 
rewritten).  ...
to maybe fix the files in the /expect/ location
(distinfo) if they are older than they should
be maybe.


----------



## DutchDaemon (Sep 22, 2010)

Manually remove /usr/ports/distfiles/expect-5.43.0.tar.gz and run [cmd=]make distclean[/cmd] in the port directory. Then install the port again. Partial downloads are notoriously 'sticky'.


----------



## philipz (Sep 23, 2010)

jb_fvwm2 said:
			
		

> see the post #3, substituting "install" for
> "build" if you know the .gz came from one
> of the two official sites.
> ...



I am not sure what the goal would be of the code you first posted:

```
/bin/rm -rf work
make -DNO_CHECKSUM build
```
What would I remove here (work)?
It was downloaded from the official site.
I believe that the problem is that there's a version mismatch; my BSD is 6.2 and I think that the port or package are for more recent systems. Is there a compatibility list somewhere where I can check which Expect version is supposed to run on my system?
I never worked with csup either so would not know what to put in the supfile. I'll try to figure out when I find some more time.


@ Dutchdaemon:
I tried your suggestion; the removal went smooth but when reinstalling it comes back with error code 1 again:

```
=> Attempting to fetch from ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/.
fetch: ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/expect-5.43.0.tar.gz: size mismatch: expected 525570, actual 525572
=> Couldn't fetch it - please try to retrieve this
=> port manually into /usr/ports/distfiles/ and try again.
*** Error code 1

Stop in /usr/ports/lang/expect.
```
I am thinking about using expect on another system (where I have installed/compiled expect properly) and FTP the result via cron to my new server but this is far from ideal ofcourse.


----------



## jb_fvwm2 (Sep 23, 2010)

Removing /usr/ports/lang/expect/work/ is
standard for new builds. If /work/ does not
exist, no need to run that command.
....
create supfile.new in /usr/ports...
... as follows:  (7 lines in the file)


```
*default host=cvsup9.us.FreeBSD.org
*default base=/usr
*default prefix=/usr
*default release=cvs tag=.
*default delete use-rel-suffix

ports-all
```
...
I suggested expect-devel because sometimes the
-devel port is quicker to install (no 
troubles downloading the correct file etc)
and suffices to sub for the usual one.
...


----------



## philipz (Sep 23, 2010)

The supfile.new suggestion works, great...
Many thanks for the help and the solution, much appreciated!


----------

