# Error code 1: pkg-1.0.1 is already installed



## Lido (Nov 6, 2012)

This kind of thing seems to happen every once in a while when I try to update the installed ports. This time I deinstalled/reinstalled and that didn't help. Anyone get through this (I was trying to update portmaster, not pkg by the way, but this was the error I got because pkg must be a dependency)?


```
===>>> Starting check for runtime dependencies
===>>> Gathering dependency list for ports-mgmt/pkg from ports
===>>> No dependencies for ports-mgmt/pkg

===>  Installing for pkg-1.0.1
===>   Generating temporary packing list
===>  Checking if ports-mgmt/pkg already installed
===>   pkg-1.0.1 is already installed
      You may wish to ``make deinstall'' and install this port again
      by ``make reinstall'' to upgrade it properly.
      If you really wish to overwrite the old port of ports-mgmt/pkg
      without deleting it first, set the variable "FORCE_PKG_REGISTER"
      in your environment or the "make install" command line.
*** Error code 1

Stop in /usr/ports/ports-mgmt/pkg.

===>>> Installation of pkg-1.0.1 (ports-mgmt/pkg) failed
===>>> Aborting update

===>>> Update for ports-mgmt/pkg failed
===>>> Aborting update

Terminated

===>>> You can restart from the point of failure with this command line:
       portmaster <flags> ports-mgmt/portmaster ports-mgmt/pkg
```


----------



## jb_fvwm2 (Nov 6, 2012)

I never upgrade portmaster with portmaster; usually I do it manually, but just today (on another box) I used portupgrade-devel. Another way is to deinstall and then proceed, or even delete the /var/db/pkg/pkg-# file in extreme cases, but as you are probably using pkg and portmaster both, I don't know enough about the setup to comment.


----------



## SirDice (Nov 6, 2012)

Do you have WITH_PKGNG=YES in /etc/make.conf?


----------



## Lido (Nov 6, 2012)

Yep.

```
$ more /etc/make.conf
# added by use.perl 2012-03-06 23:44:21
PERL_VERSION=5.12.4
#WITH_MPM=worker
BUILD_OPTIMIZED=yes
WITH_PKGNG=yes
```


----------



## kpa (Nov 6, 2012)

Reinstalling ports-mgmt/pkg should be done without any external tools. Like this:

`# make -C /usr/ports/ports-mgmt/pkg clean`

`# make -C /usr/ports/ports-mgmt/pkg install clean FORCE_PKG_REGISTER=1`

This should be done before any other updates to ports.


----------



## Lido (Nov 7, 2012)

Thanks, but I'm getting the same error:

```
===>  Installing for pkg-1.0.2
===>   Generating temporary packing list
===>  Checking if ports-mgmt/pkg already installed
===>   pkg-1.0.2 is already installed
      You may wish to ``make deinstall'' and install this port again
      by ``make reinstall'' to upgrade it properly.
      If you really wish to overwrite the old port of ports-mgmt/pkg
      without deleting it first, set the variable "FORCE_PKG_REGISTER"
      in your environment or the "make install" command line.
*** Error code 1

Stop in /usr/ports/ports-mgmt/pkg.
```


----------



## SirDice (Nov 7, 2012)

Does it show up with
`# portversion -vI`


----------



## Lido (Nov 7, 2012)

It looks like -I isn't a valid flag, but here's the output without it:

```
# portversion -v
USING PKGNG
pkg-1.0.2                   =  up-to-date with port
```


----------



## SirDice (Nov 8, 2012)

Oops, I meant *pkg_version -vI*.

Have a look in /var/db/pkg/. It may have registered the old way, which will probably conflict with pkgng.


----------



## Lido (Nov 8, 2012)

This is the closest thing to pkg:

```
pkgconf-0.8.9                       =   up-to-date with index
```


```
# l /var/db/pkg/pk*
-rw-r--r--  1 root  wheel  4916224 Nov  7 09:44 /var/db/pkg/pkgdb.db

/var/db/pkg/pkgconf-0.8.9:
total 48
-rw-r--r--   1 root  wheel     60 Sep 15 12:08 +COMMENT
-rw-r--r--   1 root  wheel    669 Sep 15 12:08 +CONTENTS
-rw-r--r--   1 root  wheel    280 Sep 15 12:08 +DESC
-rw-r--r--   1 root  wheel  17550 Sep 15 12:08 +MTREE_DIRS
-rw-r--r--   1 root  wheel    524 Oct 18 23:47 +REQUIRED_BY
drwxr-xr-x   2 root  wheel    512 Oct 18 23:47 ./
drwxr-xr-x  71 root  wheel   2560 Nov  7 00:32 ../
-rw-r--r--   1 root  wheel    136 Sep 15 12:08 distfiles
```


----------



## Lido (Nov 11, 2012)

Anyone? Still stuck here. Thanks.


----------



## tyrian (Nov 13, 2012)

I'm also stuck with the same problem. Any advice would be appreciated.


----------

