Are there any proper method to copy already installed packages from one server to other?
I've got a bunch of FreeBSD servers (10.1 and 10.2 releases), and sometimes need to setup new one that differs only in some network settings.
Currently I do some customized setup script from USB flash with modified FreeBSD "memstick edition", that untar base system to disk and copy over changed files. For packages copying I doing
So I decided to create local repo:
/etc/pkg/FreeBSD.conf
But when I trying to install it on new server, it gives me many duplicate or even "required shared library ... not found":
On
So, the question is - how should I copy installed packages to other server or install same?
I've got a bunch of FreeBSD servers (10.1 and 10.2 releases), and sometimes need to setup new one that differs only in some network settings.
Currently I do some customized setup script from USB flash with modified FreeBSD "memstick edition", that untar base system to disk and copy over changed files. For packages copying I doing
pkg create -a
on a production server and pkg add *.txz
in chroot of the new one. But I believe it's a wrong way since it install some packages whatever it's already have been installed earlier. Moreover ( and it's more important), it can't install some dependencies due it doesn't know that it's in catalog.So I decided to create local repo:
pkg repo / && scp /*.txz root@NEW_SERV:/pkg/ && scp /var/cache/pkg/*.txz root@NEW_SERV:/pkg/var/cache/pkg/
/etc/pkg/FreeBSD.conf
Code:
# $FreeBSD: release/10.0.0/etc/pkg/FreeBSD.conf 258710 2013-11-28 14:24:26Z gjb $
myrepo: {
url: "file:////pkg",
mirror_type: "file",
enabled: yes
}
FreeBSD: {
url: "pkg+[URL]http://pkg.FreeBSD.org/${ABI}/latest[/URL]",
mirror_type: "srv",
signature_type: "fingerprints",
fingerprints: "/usr/share/keys/pkg",
enabled: yes
}
But when I trying to install it on new server, it gives me many duplicate or even "required shared library ... not found":
On
# pkg upgrade
Code:
...
pkg: ruby-2.1.5_4,1: duplicate dependency listing: libyaml, ignoring
pkg: ruby-2.1.5_4,1: duplicate dependency listing: libffi, ignoring
pkg: ruby-2.1.5_4,1: duplicate dependency listing: libedit, ignoring
pkg: ruby-2.1.5_4,1: duplicate dependency listing: libyaml, ignoring
pkg: ruby-2.1.5_4,1: duplicate dependency listing: libffi, ignoring
pkg: ruby-2.1.5_4,1: duplicate dependency listing: libedit, ignoring
pkg: ruby-2.1.6,1: duplicate dependency listing: libyaml, ignoring
pkg: ruby-2.1.6,1: duplicate dependency listing: libffi, ignoring
pkg: ruby-2.1.6,1: duplicate dependency listing: libedit, ignoring
pkg: ruby-2.1.6,1: duplicate dependency listing: libyaml, ignoring
pkg: ruby-2.1.6,1: duplicate dependency listing: libffi, ignoring
pkg: ruby-2.1.6,1: duplicate dependency listing: libedit, ignoring
pkg: ruby-2.1.7,1: duplicate dependency listing: libyaml, ignoring
pkg: ruby-2.1.7,1: duplicate dependency listing: libffi, ignoring
pkg: ruby-2.1.7,1: duplicate dependency listing: libedit, ignoring
pkg: ruby-2.1.7,1: duplicate dependency listing: libyaml, ignoring
pkg: ruby-2.1.7,1: duplicate dependency listing: libffi, ignoring
pkg: ruby-2.1.7,1: duplicate dependency listing: libedit, ignoring
...
# pkg check -aBds
Code:
...
Checking all packages: 93%
(svnup-1.07_1) /usr/local/bin/svnup - required shared library libmd.so.6 not found
(svnup-1.07_1) /usr/local/bin/svnup - required shared library libssl.so.7 not found
(svnup-1.07_1) /usr/local/bin/svnup - required shared library libc.so.7 not found
Checking all packages: 100%
# locate libc.so.7
Code:
/lib/libc.so.7
# file /lib/libc.so.7
Code:
/lib/libc.so.7: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, stripped
So, the question is - how should I copy installed packages to other server or install same?