I installed and run OpenBSD and I wanted to install git but there were no repositories for OpenBSD. What should I do if I want to install some programs with pkg_add?
2 Answers
On 6.0 and below, add a mirror to the file /etc/pkg.conf
:
installpath = http://ftp.eu.openbsd.org/pub/OpenBSD/5.9/packages/amd64/
On 6.1 and later, use the file /etc/installurl
:
https://ftp.eu.openbsd.org/pub/OpenBSD/
-
1I did but when I try to to add with
pkg_add
it says the repo is empty. Apr 24, 2016 at 4:33 -
2
-
2Run this command:
ftp http://ftp.eu.openbsd.org/pub/OpenBSD/5.9/packages/amd64/SHA256
. Works? Apr 24, 2016 at 23:39 -
1Show me the output of :
ifconfig | grep '^[a-z]' | cut -d' ' -f1
Apr 25, 2016 at 0:33 -
2Run as root:
echo dhcp > /etc/hostname.em0
and reboot the system. Apr 25, 2016 at 0:45
You have to add one or more mirrors to your /etc/pkg.conf. You can add multiple mirrors by using the += notation.
installpath = http://ftp5.eu.openbsd.org/ftp/pub/OpenBSD/%c/packages/%a/
installpath += http://ftp2.eu.openbsd.org/pub/OpenBSD/%c/packages/%a/
%c and %a are variables that get replaced by the release and the architecture of your installation. That way you don't have to upgrade your config file after every release.
PKG_PATH
environment variable.