|
OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD. |
|
Thread Tools | Display Modes |
|
|||
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. |
|
|||
Quote:
~/.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:
Quote:
Last edited by ocicat; 18th March 2016 at 01:28 AM. Reason: fixed errant formatting tag... |
|
|||
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? |
|
||||
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. |
|
|||
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/ Last edited by jjstorm; 21st March 2016 at 03:16 PM. |
|
|||
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 |
|
||||
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. |
|
|||
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. |
|
|||
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. |
|
|||
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?
|
|
||||
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. |
|
|||
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.
|
|
|
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 |