# Issues with pkg commands



## Mayhem30 (May 5, 2014)

Today, I'm running into some weird issues. When I try to run pkg_version, pkgdb, etc.

These are the errors I am running into:

```
localhost# pkgdb -F
Unknown modifier 't'

Unknown modifier 't'

Unknown modifier 't'

Unknown modifier 't'

Unknown modifier 't'

"/usr/ports/Mk/bsd.sites.mk", line 957: Malformed conditional (!empty(_PERL_CPAN_ID) && ${_PERL_CPAN_FLAG:tl} == "cpan")
Unknown modifier 't'

"Mk/bsd.port.mk", line 2929: Unclosed conditional/for loop
"Mk/bsd.port.mk", line 2929: Unexpected end of file in for loop.

"Mk/bsd.port.mk", line 6706: Unclosed conditional/for loop
"Mk/bsd.port.mk", line 6706: Unexpected end of file in for loop.

1 open conditional:
         at line 1179 (evaluated to true)
make: fatal errors encountered -- cannot continue
can't convert nil into String
localhost#
```


----------



## wblock@ (May 5, 2014)

What version of FreeBSD, and did you recently upgrade?


----------



## jb_fvwm2 (May 6, 2014)

I was going to guess an earlier version of FreeBSD (v8-something) but trying the command here, it is not completing the stale dependency as expected, with a not-before-seen

```
make: Max recursion level (500) exceeded.  Deleted (irrelevant)
```


----------



## Mayhem30 (May 6, 2014)

wblock@ said:
			
		

> What version of FreeBSD, and did you recently upgrade?



I'm using  8.3-RELEASE-p11 (haven't upgraded yet).


----------



## kpa (May 6, 2014)

Support for 8.3 just ended and there was a commit yesterday to the ports tree that deliberately broke the ports tree for 8.3 to encourage upgrading. This one:

http://svnweb.freebsd.org/ports?view=revision&revision=352986


----------



## denzill (May 6, 2014)

kpa said:
			
		

> Support for 8.3 just ended and there was a commit yesterday to the ports tree that deliberately broke the ports tree for 8.3 to encourage upgrading. This one:


FreeBSD senior 9.0-RELEASE-p7 and FreeBSD 9.0-RELEASE-p7 give the same issues.


----------



## kpa (May 6, 2014)

denzill said:
			
		

> kpa said:
> 
> 
> 
> ...



Yes, and the same reason. Support for 9.0 ended on March 31, 2013, over a year ago.

http://www.freebsd.org/security/unsupported.html


----------



## snowfly (May 6, 2014)

FreeBSD 8.4-RELEASE-p7 gives the same issues.

When I want use the command `make install` to install ports , the system shows a message as below:

```
make install clean
Unknown modifier 't'

Unknown modifier 't'

Unknown modifier 't'

Unknown modifier 't'

Unknown modifier 't'

Unknown modifier 't'

Unknown modifier 't'

Unknown modifier 't'

"/usr/ports/Mk/bsd.sites.mk", line 957: Malformed conditional (!empty(_PERL_CPAN_ID) && ${_PERL_CPAN_FLAG:tl} == "cpan")
Unknown modifier 't'

"/usr/ports/Mk/bsd.port.mk", line 2929: Unclosed conditional/for loop
"/usr/ports/Mk/bsd.port.mk", line 2929: Unexpected end of file in for loop.

"/usr/ports/Mk/bsd.port.mk", line 6706: Unclosed conditional/for loop
"/usr/ports/Mk/bsd.port.mk", line 6706: Unexpected end of file in for loop.

1 open conditional:
         at line 1179 (evaluated to true)
make: fatal errors encountered -- cannot continue
```


----------



## kpa (May 6, 2014)

Upgrade first to the latest patch level of 8.4 that is 8.4-RELEASE-p9 at the moment and see if that fixes the issue. According to the commit message the make(1) in 8.4 should support the :tu and :tl modifiers. If it doesn't then this is an oversight from the portmgr@ team and should be reported. 8.4 is promised to be supported until June 30, 2015.


----------



## sdecleire (May 14, 2014)

9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825 gives the same issues.


----------



## kpa (May 14, 2014)

sdecleire said:
			
		

> 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825 gives the same issues.



Your system is out of date and needs updating, the latest SVN revision for 9.1-RELEASE (releng/9.1) is 265988. I would make a bet that the newer bmake that understands those modifiers that are giving you an error was added to 9.1-RELEASE after the release and since your system doesn't have any of the errata or security updates it's failing to build any ports.


----------



## joint (May 19, 2014)

snowfly said:
			
		

> FreeBSD 8.4-RELEASE-p7 gives the same issues.
> 
> When I want use the command `make install` to install ports , the system shows a message as below:
> 
> ...



Had the same issue and there is a fix: just take the file /usr/bin/make off the FreeBSD-8.4 default image and replace it on your server. Good luck!


----------



## GreenReaper (May 27, 2014)

In case you're someone like me who's stuck in an outdated jail and has to do everything remotely:

Grab the disk1 distribution for your architecture.
In the 8.4_Release/base directory, from a bash prompt (Git Bash is fine) do:

```
cat BASE.?? | tar -xpzf - -C /some/path [or c:/some/path on Windows]
```

Extract the make() program from /usr/bin and copy it to /usr/bin on the server (remember to `chmod 555`, `chown root`, `chgrp wheel`).
Hope it works! Remember, you're on an unsupported OS, so ports will probably break and the base itself is likely insecure. Upgrade properly ASAP.


----------



## HL1234 (Aug 1, 2014)

Hello, for me FreeBSD 9.1 Release #17. I found a solution on http://rtfm.co.ua/usrportsmkbsd-sites-m ... nditional/ (I can not read this side, but see the code and commands).

I have installed the newest devel/bmake and do the following:
`cp /usr/bin/make /usr/bin/make.old`
`ln -sv /usr/local/bin/bmake /usr/bin/make`

Then the error was gone.

Herald


----------



## tingo (Aug 26, 2014)

I got bitten by this today. Situation:
I have a machine with an old installation on it:

```
root@kg-vm2# uname -a
FreeBSD kg-vm2 8.3-RC2 FreeBSD 8.3-RC2 #0: Sat Mar 24 16:15:47 UTC 2012
     root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
```
naturally I want to upgrade to the latest FreeBSD 8.4-stable. This installation didn't have a ports tree installed, so I used portsnap to get a ports tree installed. Then I try to install devel/subversion.
Except that it doesn't work. Nor can I install devel/bmake, because the whole ports tree is broken. So I check /usr/ports/UPDATING for clues on how to handle this situation, but can't find any???

So the people in charge broke the ports tree for 8.3 and older (fine, I can live with that), but didn't find it necessary to warn users?

I'm not a happy customer (or user) right now.
(Yes, I know I can fix this with unconventional steps, but that is beside the point)


----------



## ohauer (Aug 26, 2014)

The best way is to use `freebsd-update` and update to 8.4.
After the upgrade the ports tree will work again.
Are there any special reasons why the box was running on a 8.3-rc2 snapshot and not upgraded?

Note:
In a few days the old pkg_$tools will be deprecated, the new tool to use is then ports-mgmt/pkg.
Please take the time and read how it works and how to migrate already installed packages / ports to pkg.


----------



## ohauer (Aug 26, 2014)

Perhaps the tip on blog.multiplay.co.uk will also work for you and others still on EOL releases.


----------



## adiposity (Sep 29, 2014)

Here are the commands I had to run to get things working on my FreeBSD 9.0 box that was still using old pkg_ tools.


```
pkg_add -r http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/ports/i386/packages-9.0-release/devel/bmake-20111111.tbz
cp /usr/bin/make /usr/bin/make.old
rm /usr/bin/make
ln -sv /usr/local/bin/bmake /usr/bin/make
cd /usr/ports/ports-mgmt/pkg
make -m /usr/share/mk UPGRADEPKG=1 install clean
pkg2ng
```

To use ports after this, I have to run `make -m /usr/share/mk` instead of `make`.


----------

