# shells/bash pkg install issue



## Mayhem30 (Dec 21, 2020)

When I tried to upgrade shells/bash today,  I got the following error.

Any ideas what I need to do to fix this?


```
The following 2 package(s) will be affected (of 0 checked):

Installed packages to be UPGRADED:
        bash: 5.1 -> 5.1.4
        libnghttp2: 1.41.0 -> 1.42.0

Number of packages to be upgraded: 2

Proceed with this action? [y/N]: y
[1/2] Upgrading libnghttp2 from 1.41.0 to 1.42.0...
[1/2] Extracting libnghttp2-1.42.0: 100%
[2/2] Upgrading bash from 5.1 to 5.1.4...
[2/2] Extracting bash-5.1.4: 100%
pkg: Failed to execute lua script: [string "shell_path = pkg.prefixed_path("bin/bash")..."]:7: attempt to index a nil value (global 'shell')
```


----------



## a6h (Dec 21, 2020)

1. `pkg update -f`
2. `pkg upgrade`


----------



## Mayhem30 (Dec 21, 2020)

Still have the same issue.


----------



## a6h (Dec 21, 2020)

There was a possible related PR 250926 (2020-11-07) and its related libpkg: open up rootfd for old package cleanup on upgrade #1900.

What's `uname -a`?

In the meantime:

`freebsd-update fetch install`
`pkg delete shells/bash`
`pkg autoremove`
`pkg clean`
`pkg update -f`
`pkg upgrade`
`pkg install shells/bash`

then, report back.

Warnings:
1. I've supposed you're on RELEASE, and
2. You're using binary update to update your base (kernel/userland).
3. Deleting and autoremove shells/bash may affects your other packages.


----------



## Mayhem30 (Dec 21, 2020)

It appears it's a known bug in PKG. Why the patch (fixed on November 7th) has not been merged yet is beyond me.






						250926 – ports-mgmt/pkg: @shell keyword is broken: attempt to index a nil value (global 'shell') pkg: lua script failed
					






					bugs.freebsd.org


----------

