DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 17th March 2016
Roydd85 Roydd85 is offline
Real Name: Roy
Port Guard
 
Join Date: Mar 2014
Location: Dallas, TX
Posts: 26
Default PKG_PATH not changing

Hello,

I originally tried to put OpenBSD on a laptop once about two years ago when I created this account and I got frustrated and gave up because of driver issues and quit trying to learn. I recently installed OpenBSD on an extra desktop because I am determined to get the hang of it this time. I am only mentioning this because it is the reason why I have had an account at this site for two years yet I still need basic beginner help.

With that out of the way, I would like some help setting the PKG_PATH so that I can use packages. I don't know what I am doing wrong. I have read the man pages and the openBSD site as well as the chapter in "Absolute OPENBSD".

Here is what I did so far:
1. using vi, I added the following line to the end of .profile while logged in as root:
# export $PKG_PATH=ftp://ftp3.usa.openbsd.org/pub/openbsd/5.7/packages/amd64/

I run pkg_add apache(or any program with same results)
and it says "cant find apache"

Even though I added this path to .profile, when I echo the PKG_PATH variable it displayed another path.

I then changed the .profile to a different ftp mirror and now if I echo $PKG_PATH nothing shows up but a blank line.

I tried reading other threads but they are not the same problem and even the book I have does not help much here.

One last thing, I wanted to post my PKG_PATH output as well as my .profile but I cant seem to get them on my flash drive to transfer them to this computer.

Any tips or suggestions will be greatly appreciated.
Reply With Quote
  #2   (View Single Post)  
Old 17th March 2016
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,319
Default

Quote:
Originally Posted by Roydd85 View Post
Even though I added this path to .profile, when I echo the PKG_PATH variable it displayed another path.
This is the correct behavior.

~/.profile is a simple text file -- nothing more. And it can be edited as a text file which is a plus. No Unix (that I am aware of...) hooks into the filesystem to monitor changes made to configuration files in real-time & adjust the system configuration accordingly. If you think about it, do you really want the system to expend clock cycles merely on monitoring configuration file changes? Perhaps this is a hold-over from the days where processors were not particularly powerful, but the unspoken goal was to free the system to do things which were more important. Good performance has been a hallmark of Unix for a very long time because systems can be configured to run very lean.

So the answer to your question is force the system to re-read ~/.profile. This can be done in any of three ways:
  • Manually, by sourcing:

    $ . ~/profile
  • Logging out of the account, & logging back in. Typing Ctrl-d or exit in the log-in shell will close the account's session.
  • Rebooting the system. In the days of mainframe Unix, turning off a system was frowned upon because of the cost in starting back up was high, but that isn't quite the case today. However, minimizing server downtime in production environments is still very important today.
Quote:
One last thing, I wanted to post my PKG_PATH output as well as my .profile but I cant seem to get them on my flash drive to transfer them to this computer.
Looking at the examples in the mount(8) manpage may help. And knowing what the filesystem is on the flash drive is a necessary prerequisite. disklabel(8) will help.

Last edited by ocicat; 18th March 2016 at 01:28 AM. Reason: fixed errant formatting tag...
Reply With Quote
  #3   (View Single Post)  
Old 17th March 2016
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,507
Default

To address your question, there is no longer a package named "apache".
You can browse OpenPorts to see what the current naming conventions are. There is www/apache-httpd.

An observation, OpenBSD 5.8 is the latest release and when 5.9 is released within the month, 5.7 will no longer be supported. Since you appear to be starting with a clean slate, why not start with 5.8?
Reply With Quote
  #4   (View Single Post)  
Old 17th March 2016
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 1,027
Default

Quote:
Originally Posted by Roydd85 View Post
Here is what I did so far:
1. using vi, I added the following line to the end of .profile while logged in as root:
# export $PKG_PATH=ftp://ftp3.usa.openbsd.org/pub/openbsd/5.7/packages/amd64/
The # is a comment character; everything after it on the line will be ignored. So try removing the #, make sure the PKG_PATH value is right, log out, log in and try again.

Quote:
Originally Posted by ocicat
If you think about it, do you really want the system to expend clock cycles merely on monitoring configuration file changes? Perhaps this is a hold-over from the days where processors were not particularly powerful, but the unspoken goals was to expend effort doing things which were deemed more important.
Also, one wouldn't want the system to start picking up changes while a config file was in a broken state because it was part-way through being edited.
Reply With Quote
  #5   (View Single Post)  
Old 17th March 2016
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

Welcome back. Two last bits of advice.

You can test the value of an environment variable with the echo command. An example would be typing in the command "echo $PATH" -- this should output the value of your PATH variable, which lists all the directories searched for executable files when you type a command. If you type in the command "echo $PKG_PATH" and get a blank line in response, you'll know the environment variable has not been set.

And lastly, the pkg_add command will look for the file /etc/pkg.conf if you don't have a PKG_PATH variable set, where package installation paths and other settings can be provisioned. If you do a network installation, rather than from local media, that file is automatically created.
Reply With Quote
  #6   (View Single Post)  
Old 21st March 2016
jjstorm jjstorm is offline
Package Pilot
 
Join Date: Nov 2014
Location: Buenos Aires, AR
Posts: 144
Default

I am in a similar situation as you. I too tried OpenBSD about a year and a half ago, and having gotten overwhelmed by it, and do to time constraints, I postponed the installation of it.

I now have a basic system on my laptop, and do to this forum and a lot of reading and rereading of the faq and man pages, I can at least do some basic things with it. I am too determined to learn. OpenBSD is currently my only OS.

I posed this very same question on this forum 1 week ago. Take a look at this thread.

You can edit the pkg.conf file using vi as I have below ( adding your own servers of course)

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/
Make sure you change the /snapshops path to your version (i.e 5.8 ) and of course your platform.

Last edited by jjstorm; 21st March 2016 at 03:16 PM.
Reply With Quote
  #7   (View Single Post)  
Old 6th April 2016
Roydd85 Roydd85 is offline
Real Name: Roy
Port Guard
 
Join Date: Mar 2014
Location: Dallas, TX
Posts: 26
Default

I want to apologize for not responding until now. Unfortunately, and embarrassingly, I was hammered drunk when I posted this original thread, which also explains the awkward preface; not that this one is not as equally awkward and unnecessary. In short, I completely forgot about this post until I decided to mess with this OS again tonight and encountered the problem and tried to find help.

Firstly, I took the advice from Shep and installed 5.9 since all I did before was manually install a urtwn0 driver and was not heavily invested at that point.

Anyway, I tried most of the suggestions with the same results. I also forgot to mention that I always rebooted after updating the .profile config file and the # in the path was a typo and was never included in the PKG_PATH that I added to that file.

I did not have a pkg.conf file in etc so I created a file in vi and added this line
installpath=http://ftp3.usa.openbsd.org/pub/openbsd/5.9/packages/amd64/

after a reboot and run pkg_add lynx I get the following error:

error from http://.../amd64/
ftp:error retrieving file: 404 Not Found
http://.../amd64/ is empty
cant find lynx
(or any packages)

I also run
echo $PKG_PATH and I still get a blank line. But this new error with the pkg.conf file seems like some progress. I still dont see what I am doing wrong.

*EDIT* I forgot to mention that the path actually has a list of packages and is not a dead link.

Last edited by Roydd85; 6th April 2016 at 12:34 AM. Reason: left out info
Reply With Quote
  #8   (View Single Post)  
Old 6th April 2016
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

URLs are case sensitive. The directory "openbsd" in your path needs to be revised to "OpenBSD" with a blend of upper and lower case characters.

Also, the pkg.path(5) file will only be used if $PKG_PATH is not defined. Be sure you don't have one in your .profile, else it will use that instead.
Reply With Quote
  #9   (View Single Post)  
Old 6th April 2016
Roydd85 Roydd85 is offline
Real Name: Roy
Port Guard
 
Join Date: Mar 2014
Location: Dallas, TX
Posts: 26
Default

I double checked the URL in the pkg.conf file and even added a second line with another URL, both are spelled perfectly.

In the .profile file after last line that reads "esac", I added the line

export $PKG_PATH=http://ftp3.usa.openbsd.org/pub/OpenBSD/5.9/packages/amd64/

this is exactly how it is written in the mirror list. Upon logging in I get this message:
ksh: /root/.profile[22]: export: =http://ftp3.usa.openbsd.org/pub/OpenBSD/5.9/packages/amd64: not identifier

I have no idea what that means? I think its saying that URL is wrong but I triple checked it.
Also, I definitely have an entry appended to the .profile for PKG_PATH but when I echo $PKG_PATH it is still a blank line.
Reply With Quote
Old 6th April 2016
TronDD TronDD is offline
Spam Deminer
 
Join Date: Sep 2014
Posts: 305
Default

Take the '$' off of PKG_PATH in your export. You need to export the variable name. Putting a $ in front represents the variable's value.

If you look at the error, it's telling you that it's not valid to export blank=http://etc. That blank space is the value of PKG_PATH.

Tim.
Reply With Quote
Old 6th April 2016
Roydd85 Roydd85 is offline
Real Name: Roy
Port Guard
 
Join Date: Mar 2014
Location: Dallas, TX
Posts: 26
Default

Holy crap, I feel like the biggest idiot in the world right now. I thought the $ was like a declaration of the path. it works now. Thanks a lot. Do you have a specific man page or something that explains enviroment variable better?
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: 7,983
Default

The ksh(1), sh(1), and csh(1) man pages are long and involved, and are not designed as tutorials. While the do discuss variables, including environment variables, they point to the environ(7) man page and otherwise treat them syntactically as other variable types.

Yeah, there are management tools such as export (ksh/sh) or setenv (csh), but otherwise they are variables that can be passed to a new process.

There are many introductory tutorials, and a quick search for "introduction to shell scripting and environment variables" brings me 282,000 hits on Google.
Reply With Quote
Old 7th April 2016
Roydd85 Roydd85 is offline
Real Name: Roy
Port Guard
 
Join Date: Mar 2014
Location: Dallas, TX
Posts: 26
Default

I just started a 60+ video tutorial series about shell programming. I have some experience with c++ and have played with Perl which is why I should have already figured this out.
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 has short term memory jjstorm OpenBSD Installation and Upgrading 11 6th April 2016 01:12 AM
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
What is the PKG_PATH for NetBSD 6.0.1 Binary Installs? haziz NetBSD General 9 19th March 2013 01:12 AM


All times are GMT. The time now is 12:39 AM.


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