# Issue updating pkg shared-mime-info 2.0



## SamKook (Jan 15, 2022)

When I try to update FreeBSD packages, shared-mime-info creates and error and it halts the whole process so I have to update everything else one by one if I want stuff up-to-date since I'm at a loss on how to fix this.

Here's what I get if I try to update:

```
pkg upgrade
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking for upgrades (4 candidates): 100%
Processing candidates (4 candidates): 100%
Checking integrity... done (0 conflicting)
The following 4 package(s) will be affected (of 0 checked):

Installed packages to be UPGRADED:
        shared-mime-info: 2.0 -> 2.0_2

Installed packages to be REINSTALLED:
        docbook-xml-5.0_3 (ABI changed: 'freebsd:13:x86:64' -> 'freebsd:13:*')
        hicolor-icon-theme-0.17 (ABI changed: 'freebsd:13:x86:64' -> 'freebsd:13:*')
        p5-Heap-0.80_1 (ABI changed: 'freebsd:13:x86:64' -> 'freebsd:13:*')

Number of packages to be upgraded: 1
Number of packages to be reinstalled: 3

The operation will free 2 MiB.

Proceed with this action? [y/N]: y
[1/4] Upgrading shared-mime-info from 2.0 to 2.0_2...
[1/4] Extracting shared-mime-info-2.0_2: 100%
shared-mime-info-2.0: missing file /usr/local/share/licenses/shared-mime-info-2.0/GPLv2
shared-mime-info-2.0: missing file /usr/local/share/licenses/shared-mime-info-2.0/LICENSE
shared-mime-info-2.0: missing file /usr/local/share/licenses/shared-mime-info-2.0/catalog.mk
pkg: Fail to set time on /usr/local/share/mime/x-epoc:No such file or directory
```

"/usr/local/share/licenses/shared-mime-info-2.0/" contains:

```
-rw-r--r--    1 root  user    18K Nov 19 20:34 GPLv2.pkgsave
-rw-r--r--    1 root  user    81B Nov 19 20:34 LICENSE.pkgsave
-rw-r--r--    1 root  user   319B Nov 19 20:34 catalog.mk.pkgsave
```

and the x-epoc file indeed doesn't exist.

If I copy and rename the 3 missing files, that takes care of those errors but if I manually create an empty x-epoc file, it simply gets deleted and the 3 missing files become missing again.

Haven't found a solution to this from google and not really sure what that file is supposed to be either so I don't want to mess too much with this.

Any help with this would be great.


----------



## grahamperrin@ (Jan 15, 2022)

Via misc/shared-mime-info the list of bugs does not include this.

Which version of FreeBSD, exactly? `freebsd-version -kru && uname -aKU`

Packages from quarterly, or latest? `pkg -vv | grep -e url -e enabled`


Below, it seems that *nothing* in latest (for CURRENT) provides /usr/local/share/mime/x-epoc, so (without knowing more about your system) my first guess is that you should defocus from misc/shared-mime-info; there might be something wrong with the bigger picture.


```
% pkg provides /usr/local/share/mime/x-epoc

% pkg -vv | grep -e url -e enabled
    url             : "http://pkg0.pkt.freebsd.org/FreeBSD:14:amd64/latest",
    enabled         : yes,
    url             : "https://alpha.pkgbase.live/current/FreeBSD:14:amd64/latest",
    enabled         : no,
    url             : "file:///usr/local/poudriere/data/packages/main-default",
    enabled         : yes,
% uname -iKrsU
FreeBSD 14.0-CURRENT GENERIC 1400047 1400047
%
```


----------



## SamKook (Jan 15, 2022)

Version output

```
13.0-RELEASE-p4
13.0-RELEASE-p4
13.0-RELEASE-p4
FreeBSD RuiBox 13.0-RELEASE-p4 FreeBSD 13.0-RELEASE-p4 #0: Tue Aug 24 07:33:27 UTC 2021     root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64 1300139 1300139
```

Which pkg output

```
url             : "pkg+http://pkg.FreeBSD.org/FreeBSD:13:amd64/latest",
    enabled         : yes,
```

If I remember right, I started with installing v12, did almost nothing with it and near the beginning of last year upgraded to v13 and started to actually install stuff. Didn't take me long to switch from quarterly to latest because a package or two were a bit too outdated for what I wanted to do.
Got the x-epoc issue a few months ago but just assumed it was an issue with latest and would fix itself eventually and piling on my laziness and lack of free time, I just let it be for far too long.

I only install stuff using pkg on that system except for 1 git software(sickgear) that doesn't mess with any external config as far as I'm aware so don't think that would be an issue. I pretty much just use the software installed and use the server as storage, nothing else so not sure what could have messed something up.

If I try your pkg provides command, it tells me provides isn't an available command so I assume that's a v14 thing.


Edit: Just did an OS update since I didn't think of trying that and same result after.

new version output

```
13.0-RELEASE-p6
13.0-RELEASE-p6
13.0-RELEASE-p6
FreeBSD RuiBox 13.0-RELEASE-p6 FreeBSD 13.0-RELEASE-p6 #0: Mon Jan 10 06:28:50 UTC 2022     root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64 1300139 1300139
```


----------



## grahamperrin@ (Jan 16, 2022)

ports-mgmt/pkg-provides

Is anything locked? 

`pkg lock -l`

If it's FreeBSD on ZFS, then try: 

create a new boot environment
activate then boot the new environment
`pkg upgrade -f`


----------



## SamKook (Jan 16, 2022)

No, nothing locked.

Tried to force the upgrades in a new BE(cool stuff, gotta learn more about this) and same result when it gets to the package:

```
[49/488] Upgrading shared-mime-info from 2.0 to 2.0_2...
[49/488] Extracting shared-mime-info-2.0_2: 100%
shared-mime-info-2.0: missing file /usr/local/share/licenses/shared-mime-info-2.0/GPLv2
shared-mime-info-2.0: missing file /usr/local/share/licenses/shared-mime-info-2.0/LICENSE
shared-mime-info-2.0: missing file /usr/local/share/licenses/shared-mime-info-2.0/catalog.mk
pkg: Fail to set time on /usr/local/share/mime/x-epoc:No such file or directory
```

I also get no results from pkg provides for x-epoc with or without the path and using a * instead of x-epoc only returns 1 result for gbsplay-0.0.94,1 so not a folder packages usually put stuff into looks like.

Edit: Did some tests in a VM and the whole mime folder gets created when you install the shared-mime-info package. Copying the x-epoc directory and putting it on my system changes nothing, it just gets deleted when trying to upgrade, same as when I created an empty file before. I also noticed I'm missing quite a few things other than x-epoc in that directory compared to the new version that gets installed.

Edit2: Tried to remove the 2.0 package and then reinstall the two main software that had it as a dependency and version 2.0_2 installed fine. As far as I can tell so far, everything seems back to normal.
Thanks for the help. Still don't know why it wouldn't update but I learned a few things in the process of getting things back to normal.


----------

