# Accidentally deleted lib files for pkg-ng



## atmosx (Mar 26, 2013)

Hello,

I did [cmd=]rm /usr/lib/libpkg.so.0[/cmd] for some (stupid probably) reason I can't recall. However now I can't compile PKGNG.


```
[root /usr/ports/ports-mgmt/pkg]# make install clean
Shared object "libpkg.so.0" not found, required by "pkg"
Shared object "libpkg.so.0" not found, required by "pkg"
===>  Installing for pkg-1.0.9_2
===>   Generating temporary packing list
===>  Checking if ports-mgmt/pkg already installed
Shared object "libpkg.so.0" not found, required by "pkg"
*** [check-already-installed] Error code 1

Stop in /usr/ports/ports-mgmt/pkg.
*** [/usr/ports/ports-mgmt/pkg/work/.install_done.pkg._usr_local] Error code 1

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

Any ideas how to overcome this? 

Thanks.


----------



## kpa (Mar 26, 2013)

Do a `# make clean` first.


----------



## allanjude@ (Mar 26, 2013)

Restore the file from the backup you did before you started the upgrade

The easiest way around it is to copy that lib from another machine with the same version of FreeBSD or start a jail and compile the port in there and copy the lib from that.


----------



## fonz (Mar 26, 2013)

atmosx said:
			
		

> I did "[red][cmd=#][/red]`# rm /usr/lib/libpkg.so.0`[red][/cmd][/red]" for some (stupid probably) reason I can't recall. However now I can't compile pkgng[red]ports-mgmt/pkg.[/red]


No port should be its own dependency. Can't you just do the following:
`# cd /usr/ports/port-mgmt/pkg`
`# make deinstall`
`# make clean install`


----------



## kpa (Mar 26, 2013)

It's very odd that it depends on the base system libpkg.so.0, it should depend on /usr/local/lib/libpkg.so.0 instead. Are you on some pre-release version of 9.0 or 9.1?

There should not be a libpkg.so.0 in /usr/lib in any case.


----------



## atmosx (Mar 26, 2013)

```
root@comodino /usr/ports/ports-mgmt/pkg]# make deinstall
Shared object "libpkg.so.0" not found, required by "pkg"
===>  Deinstalling for ports-mgmt/pkg
Shared object "libpkg.so.0" not found, required by "pkg"
===>   pkg not installed, skipping
[root@comodino /usr/ports/ports-mgmt/pkg]# make install clean
Shared object "libpkg.so.0" not found, required by "pkg"
Shared object "libpkg.so.0" not found, required by "pkg"
===>  Installing for pkg-1.0.9_2
===>   Generating temporary packing list
===>  Checking if ports-mgmt/pkg already installed
Shared object "libpkg.so.0" not found, required by "pkg"
*** [check-already-installed] Error code 1

Stop in /usr/ports/ports-mgmt/pkg.
*** [/usr/ports/ports-mgmt/pkg/work/.install_done.pkg._usr_local] Error code 1

Stop in /usr/ports/ports-mgmt/pkg.
```
No, my mistake was install the git version first, then try to use the system version because pkg2ng didn't work.


----------



## atmosx (Mar 27, 2013)

Just another question that popped up to mind. I never actually use `pkg_add` or will use `pkg`. I install everything using ports directly or portmaster. If I wait until FreeBSD 9.2 comes out, will the upgrade take care of upgrading/re-installing this file too? Because other than problems with PKGNG I didn't notice anything wrong in my workflow.


----------

