# pkg upgrade failing



## bgroper (Oct 8, 2022)

I'm trying to update a freshly installed system.
Done the fetch and install of base system.
pkg upgrade fails on GrantleeTheme package.


```
The following 1 package(s) will be affected (of 0 checked):
Installed packages to be UPGRADED:
    grantleetheme: 21.12.1 -> 22.08.1_1
Number of packages to be upgraded: 1

Proceed with this action? [y/N]: y
[1/1] Upgrading grantleetheme from 21.12.1 to 22.08.1_1...
[1/1] Extracting grantleetheme-22.08.1_1:   2%
pkg: Fail to create temporary file: /usr/local/include/KF5/GrantleeTheme/GrantleeTheme/.pkgtemp.GenericFormatter.Ab1LhWD9u6Dv:Not a directory
[1/1] Extracting grantleetheme-22.08.1_1: 100%
root@freebsd:~ #
```

It seems the package is confusing an existing filename as a directory.
Is there an easy fix ?
TIA's


----------



## T-Daemon (Oct 8, 2022)

bgroper said:


> Is there an easy fix ?


It's a know issue: /usr/ports/UPDATING

```
20220426:
  AFFECTS: users of deskutils/grantleetheme
  AUTHOR: kde@FreeBSD.org

  The pkg update of deskutils/grantleetheme to 22.04 can fail due
  to a filesystem location having changed from being a file to being
  a directory. This leads to pkg's temporary file creation throwing
  an error.

  *To update to KDE Gear 22.04 please run
  # pkg delete -f grantleetheme
  prior to the update.*
```


----------



## jb_fvwm2 (Oct 8, 2022)

That fix worked for /usr/ports/graphics/lensfun... thanks!


----------



## mer (Oct 8, 2022)

jb_fvwm2 said:


> That fix worked for /usr/ports/graphics/lensfun... thanks!


Yep, I ran into that yesterday, posted something about it.

Since you never know theres a problem until you run into it, it's safe to run into pkg upgrade, hit an error like this, delete the package, then rerun pkg upgrade.
Of course reading Updating is always a good idea, but you'd need go through the installed packages and compare against Updating.


----------



## T-Daemon (Oct 8, 2022)

mer said:


> Of course reading Updating is always a good idea, but you'd need go through the installed packages and compare against Updating.


It is not necessary going through all installed packages to compare UPDATING by yourself. One of the pkg(8) commands is pkg-updating(8), which does the job for the user automated (see description below).

The only requirement is the UPDATING file under /usr/ports (or other location, see `-f` option or ENVIRONMENT), which can be fetched before a pkg-upgrade(8) from the FreeBSD GIT repository, i.e. `fetch https://cgit.freebsd.org/ports/plain/UPDATING` (the command can be shortened by a permanent shell alias or a sh(1) script).

To display only newer entries use the `-d` option.

pkg-updating(8)

```
DESCRIPTION
     The pkg updating command scans the installed ports and show all UPDATING
     entries that affect one of the installed ports.  Alternatively, a list of
     pkg-names could be passed.
```


----------



## mer (Oct 8, 2022)

T-Daemon thanks.  The only downside I see is one needs to have an up to date UPDATING file which, if one is using packages they may not have unless they specifically fetch it as you point out.


----------

