DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Installation and Upgrading

OpenBSD Installation and Upgrading Installing and upgrading OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 7th March 2016
jjstorm jjstorm is offline
Package Pilot
 
Join Date: Nov 2014
Location: Buenos Aires, AR
Posts: 144
Default PKG_PATH has short term memory

setting the PKG_PATH variable with the export command only holds for one session.

for example, say that I enter the following string:

Code:
# export PKG_PATH=http://your.local.mirror/pub/OpenBSD/$(uname -r)/packages/$(machine -a)/
next time I reboot, it will be lost, and I will have to enter it again. I thought that it was supposed to stay permanently?

It also states in the faq 15.2.2 that it is a good idea to enter a line like the above one in ~/.profile for the purpose of being able to retain multiple mirrors in case one is not working, it will move on to the next. servers can be separated by ":" which I inserted between servers, but I still can't get PKG_PATH to retain its contents. What am I doing wrong?
Reply With Quote
  #2   (View Single Post)  
Old 7th March 2016
e1-531g e1-531g is offline
VPN Cryptographer
 
Join Date: Mar 2014
Posts: 368
Default

Environment variables are not permanent if you just type them in shell.
You need to save that variable in file.
Alternatively you can insert inside pkg.conf:
Code:
cat /etc/pkg.conf                                                            
#installpath=http://ftp.fr.openbsd.org/pub/OpenBSD/snapshots/packages/amd64/
installpath=http://ftp.hostserver.de/pub/OpenBSD/snapshots/packages/amd64/
It will configure pkg_*'s mirror path, but not create environment variable.
Reply With Quote
  #3   (View Single Post)  
Old 7th March 2016
Oko's Avatar
Oko Oko is offline
Rc.conf Instructor
 
Join Date: May 2008
Location: Kosovo, Serbia
Posts: 1,101
Default

All add this into the /root/.profile of your root account if that is what you use to

Code:
PKG_PATH=http://openbsd.mirrors.pair.com/$(uname -r)/packages/$(arch -s)/
PKG_PATH=https://stable.mtier.org/updates/$(uname -r)/$(arch -s):${PKG_PATH}
export PKG_PATH
Reply With Quote
  #4   (View Single Post)  
Old 7th March 2016
jjstorm jjstorm is offline
Package Pilot
 
Join Date: Nov 2014
Location: Buenos Aires, AR
Posts: 144
Default

Quote:
Originally Posted by Oko View Post
All add this into the /root/.profile of your root account if that is what you use to

Code:
PKG_PATH=http://openbsd.mirrors.pair.com/$(uname -r)/packages/$(arch -s)/
PKG_PATH=https://stable.mtier.org/updates/$(uname -r)/$(arch -s):${PKG_PATH}
export PKG_PATH
Can you please explain what the 2 entries do? What is the one with the /updates/ path?


Thanks.
Reply With Quote
  #5   (View Single Post)  
Old 7th March 2016
e1-531g e1-531g is offline
VPN Cryptographer
 
Join Date: Mar 2014
Posts: 368
Default

It is setting PKG_PATH environment variable.
First line sets up PKG_PATH equal to:
http://openbsd.mirrors.pair.com/$(uname -r)/packages/$(arch -s).
Of course $(uname -r) and $(arch -s) will be executed and results appended to rest of string.
Second line performs addition/appending PKG_PATH and new line:
https://stable.mtier.org/updates/$(uname -r)/$(arch -s)
and then set up PKG_PATH to totality/sum/concatenation of these variables.

If you are not following current, to receive security and/or reliablity fixes you need to:
1. Manually fetch souce code and compile it
or
2. Use unofficial, but commonly trusted M:Tier.
Reply With Quote
  #6   (View Single Post)  
Old 7th March 2016
jjstorm jjstorm is offline
Package Pilot
 
Join Date: Nov 2014
Location: Buenos Aires, AR
Posts: 144
Default

Quote:
Originally Posted by e1-531g View Post
It is setting PKG_PATH environment variable.
First line sets up PKG_PATH equal to:
http://openbsd.mirrors.pair.com/$(uname -r)/packages/$(arch -s).
Of course $(uname -r) and $(arch -s) will be executed and results appended to rest of string.
Second line performs addition/appending PKG_PATH and new line:
https://stable.mtier.org/updates/$(uname -r)/$(arch -s)
and then set up PKG_PATH to totality/sum/concatenation of these variables.

If you are not following current, to receive security and/or reliablity fixes you need to:
1. Manually fetch souce code and compile it
or
2. Use unofficial, but commonly trusted M:Tier.
No, I do not follow current. I am just beginning to learn, so I am following stable.

Last edited by jjstorm; 7th March 2016 at 10:39 PM.
Reply With Quote
  #7   (View Single Post)  
Old 7th March 2016
jjstorm jjstorm is offline
Package Pilot
 
Join Date: Nov 2014
Location: Buenos Aires, AR
Posts: 144
Default

Quote:
Originally Posted by e1-531g View Post
Environment variables are not permanent if you just type them in shell.
You need to save that variable in file.
Alternatively you can insert inside pkg.conf:
Code:
cat /etc/pkg.conf                                                            
#installpath=http://ftp.fr.openbsd.org/pub/OpenBSD/snapshots/packages/amd64/
installpath=http://ftp.hostserver.de/pub/OpenBSD/snapshots/packages/amd64/
It will configure pkg_*'s mirror path, but not create environment variable.
This actually worked. I inserted my own servers of course and replaced 'snapshots' with '5.8'. since I follow stable.
Reply With Quote
  #8   (View Single Post)  
Old 7th March 2016
Oko's Avatar
Oko Oko is offline
Rc.conf Instructor
 
Join Date: May 2008
Location: Kosovo, Serbia
Posts: 1,101
Default

Quote:
Originally Posted by jjstorm View Post
Can you please explain what the 2 entries do? What is the one with the /updates/ path?


Thanks.
Security updates of the packages by MTier for 5.8 stable. Without it you will have to build manually updates to Firefox for example.
Reply With Quote
  #9   (View Single Post)  
Old 5th April 2016
jjstorm jjstorm is offline
Package Pilot
 
Join Date: Nov 2014
Location: Buenos Aires, AR
Posts: 144
Default /etc/pkg.conf will not accept $(uname -r) and $(machine -a)

I am trying to create a configuration file for pkg.conf that can be used on different versions of OpenBSD, however, I am getting an error. I have tried it several times by manually entering the information. The string works when assigned to PKG_PATH.

Below is the string as it appears on /etc/pkg.conf

Code:
 
installpath=ftp://openbsd.c3sl.ufpr.br/pub/OpenBSD/$(uname -r)/packages/$(machine -a)/
The error displayed.

Code:
# pkg_add vim
Error from ftp://openbsd.c3sl.ufpr.br/pub/OpenBSD/$(uname -r)/packages/$(machine -a)/quirks-2.197.tgz
550 Can't change directory to pub/OpenBSD/$(uname -r)/packages/$(machine -a): No such file or directory
Ambiguous: choose package for vim
a       0: <None>
        1: vim-7.4.900-gtk2
        2: vim-7.4.900-gtk2-lua
        3: vim-7.4.900-gtk2-perl-python-ruby
        4: vim-7.4.900-gtk2-perl-python3-ruby
        5: vim-7.4.900-no_x11
        6: vim-7.4.900-no_x11-lua
        7: vim-7.4.900-no_x11-perl-python-ruby
        8: vim-7.4.900-no_x11-perl-python3-ruby
        9: vim-7.4.900-no_x11-ruby
Your choice: 1
Error from ftp://openbsd.c3sl.ufpr.br/pub/OpenBSD/$(uname -r)/packages/$(machine -a)/vim-7.4.900-gtk2.tgz
550 Can't change directory to pub/OpenBSD/$(uname -r)/packages/$(machine -a): No such file or directory
Can't find CONTENTS from ftp://openbsd.c3sl.ufpr.br/pub/OpenBSD/$(uname -r)/packages/$(machine -a)/vim-7.4.900-gtk2.tgz
--- vim-7.4.900-gtk2 -------------------
Can't install vim-7.4.900-gtk2: bad package

Is it that only PKG_PATH can resolve $(uname -r) and $(machine -a) ?
Reply With Quote
Old 6th April 2016
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,941
Default

The pkg.conf file is not a shell script.

To make your life much, much easier, see the pkg.conf(5) man page. There is a paragraph under the installpath option that begins, "Special sequences..."

If you ever conduct a network install, you will find a pkg.conf(5) file created for you, that uses these sequences.
Reply With Quote
Old 6th April 2016
jjstorm jjstorm is offline
Package Pilot
 
Join Date: Nov 2014
Location: Buenos Aires, AR
Posts: 144
Default

Quote:
Originally Posted by jggimi View Post
The pkg.conf file is not a shell script.
see the pkg.conf(5) man page. There is a paragraph under the installpath option that begins, "Special sequences..."
from pkg.conf(5)
Quote:

Special sequences `%a', `%c', `%m', `%v' will be expanded to
`package architecture', `OS version or snapshots', `full
mirror path' and `OS version' respectively.
How could I miss that? duh.

Thanks.
Reply With Quote
Old 6th April 2016
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,941
Default

I must admit, I only know of them because of network installs. It's not a highlighted section in the man page.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PKG_PATH change in Current shep OpenBSD Installation and Upgrading 2 6th February 2016 08:47 PM
export PKG_PATH betweendayandnight OpenBSD General 4 9th August 2015 12:07 PM
can't setup PKG_PATH after install of 5.5 spermwhale_warrior OpenBSD Packages and Ports 10 26th August 2014 09:29 PM
Diskless Gnome 3 - a short history jggimi OpenBSD Installation and Upgrading 5 2nd July 2014 05:00 PM
Firefox long term support shep News 0 3rd February 2012 02:40 AM


All times are GMT. The time now is 11:16 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick