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 18th July 2009
badguy badguy is offline
Fdisk Soldier
 
Join Date: Jul 2009
Location: MD, USA
Posts: 59
Thanked 0 Times in 0 Posts
Default How do I edit my .profile to permanently have an ftp site to point to

$ export PKG_PATH=ftp://your.ftp.mirror/pub/OpenBSD/4.5/packages/machine/

It's usually a good idea to add a line similar to the above examples to your ~/.profile. As with the classic PATH variable, you can specify multiple locations, separated by colons.

Please How do I edit my . profile to have that permanently? Currently this is what I when I view the .profile file.

# $OpenBSD: dot.profile,v 1.5 2005/03/30 21:18:33 millert Exp $
#
# sh/ksh initialization

PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin
export PATH
: ${HOME='/root'}
export HOME
umask 022

if [ -x /usr/bin/tset ]; then
eval `/usr/bin/tset -sQ \?$TERM`
fi
~
~
~
Reply With Quote
  #2   (View Single Post)  
Old 18th July 2009
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,797
Thanked 214 Times in 189 Posts
Default

You can learn to use a text editor, such as vi(1), sed(1), ed(1), mg(1), or any of the innumerable X11 text editors.

Meanwhile, to append a line to an existing file, you can echo(1) some text and append it to the file with ">>", e.g.:

$ echo "export PKG_PATH=........" >> .profile
Reply With Quote
  #3   (View Single Post)  
Old 18th July 2009
badguy badguy is offline
Fdisk Soldier
 
Join Date: Jul 2009
Location: MD, USA
Posts: 59
Thanked 0 Times in 0 Posts
Default

thanks. will that allow it to be available the next time the system boots up?
Reply With Quote
  #4   (View Single Post)  
Old 18th July 2009
badguy badguy is offline
Fdisk Soldier
 
Join Date: Jul 2009
Location: MD, USA
Posts: 59
Thanked 0 Times in 0 Posts
Default

okay yeah it does. tnx
Reply With Quote
  #5   (View Single Post)  
Old 18th July 2009
badguy badguy is offline
Fdisk Soldier
 
Join Date: Jul 2009
Location: MD, USA
Posts: 59
Thanked 0 Times in 0 Posts
Default

Okay actually that just put it in to the /.profile file which i could also done with vi. the question is where within the lines do i put that? because even after i do a

$ echo "export PKG_PATH=........" >> .profile

it still says No packages available in the PKG_PATH
Reply With Quote
  #6   (View Single Post)  
Old 18th July 2009
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 2,902
Thanked 190 Times in 160 Posts
Default

Quote:
Originally Posted by badguy View Post
...because even after i do a

$ echo "export PKG_PATH=........" >> .profile

it still says No packages available in the PKG_PATH
Close.

~/.profile is only a text file. However, when logging into your account ~/.profile is read to initialize your shell environment. To have changes in ~/.profile be read by the running shell, you must "source" the file, ie.

$ . ~/.profile

As for where to put such lines, convention is to be put lines like this at the very bottom of the file.

For more information, study the ksh(1) manpage (or whatever shell you are using...).

You might also benefit from going to a library & checking out an introductory text on Unix. Most beginning Unix texts cover issues like this.

Last edited by ocicat; 18th July 2009 at 08:07 PM.
Reply With Quote
  #7   (View Single Post)  
Old 18th July 2009
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,797
Thanked 214 Times in 189 Posts
Default

It's also possible you misunderstand what the PKG_PATH environment variable should actually contain.

If you're still confused, post the output from:
$ echo $PKG_PATH
Reply With Quote
  #8   (View Single Post)  
Old 18th July 2009
badguy badguy is offline
Fdisk Soldier
 
Join Date: Jul 2009
Location: MD, USA
Posts: 59
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by jggimi View Post
It's also possible you misunderstand what the PKG_PATH environment variable should actually contain.

If you're still confused, post the output from:
$ echo $PKG_PATH
Exactly. I am trying to avoid having to "export PKG_PATH" every time the system is rebooted.

after i used the echo PKG_PATH this is what i got

# $OpenBSD: dot.profile,v 1.5 2005/03/30 21:18:33 millert Exp $
#
# sh/ksh initialization

PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin
export PATH
: ${HOME='/root'}
export HOME
umask 022

if [ -x /usr/bin/tset ]; then
eval `/usr/bin/tset -sQ \?$TERM`
fi
export PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/4.5/packages/i386/
~
~
~


it just added the line after fi which is the bottom of the file as ocicat has said but it still does not find the package.

ps: i am wondering if i am editing the wrong file. i am editing the .profile file found in root directory (i.e. "/" not "/root")
Reply With Quote
  #9   (View Single Post)  
Old 18th July 2009
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 2,902
Thanked 190 Times in 160 Posts
Default

Quote:
Originally Posted by badguy View Post
after i used the echo PKG_PATH this is what i got
...
The output provided appears to be a screenshot of your vi window. Just so we are all on the same page, post the output of the following command:

$ cat .profile
Quote:
ps: i am wondering if i am editing the wrong file. i am editing the .profile file found in root directory (i.e. "/" not "/root")
You should be editing .profile found in your user account's home directory. Or are you administrating your system from the root account?
Reply With Quote
Old 18th July 2009
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,797
Thanked 214 Times in 189 Posts
Default

Even if you are using "root", root's home directory is /root, and it's profile is /root/.profile.

The one in the "/" directory is only used when operating in single-user mode.
Reply With Quote
Old 18th July 2009
badguy badguy is offline
Fdisk Soldier
 
Join Date: Jul 2009
Location: MD, USA
Posts: 59
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by ocicat View Post
You should be editing .profile found in your user account's home directory. Or are you administrating your system from the root account?
Yes. its a virtual machine for development purpose that is y i am working from root.

the output of cat .profile is on the attached image (profile pic)
Attached Images
File Type: jpg profile.jpg (22.4 KB, 93 views)
Reply With Quote
Old 18th July 2009
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,797
Thanked 214 Times in 189 Posts
Default

I'll ask, once more, for the output of
$ echo $PKG_PATH
Your screen shot doesn't show the environment variable. Still. All it has done is confirmed you are editing /root/.profile instead of /.profile or a normal user's $HOME/.profile.

Regarding root, please see the afterboot(8) man page:
# man afterboot
Reply With Quote
Old 19th July 2009
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 2,902
Thanked 190 Times in 160 Posts
Default

Quote:
Originally Posted by badguy View Post
it still says No packages available in the PKG_PATH
This also is shown in the uploaded image.

It is unclear if you are thinking that pkg_info(1) is used to install packages. It is not. The application used to add packages is pkg_add(1), however, you need to ensure that PKG_PATH is correct set & accessible first.

Studying Section 15.2 of the FAQ would be worth your time as it discusses these issues:

http://openbsd.org/faq/faq15.html#PkgMgmt
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
Wireless NIC for access point dewarrn1 FreeBSD General 1 15th September 2009 11:01 PM
Routing between site-to-site tunnels docrice OpenBSD General 5 26th September 2008 09:21 AM
Point-to-Point VPN + Firewall + Router (sorta) - What should I use? Bruco FreeBSD General 6 5th July 2008 11:09 PM
Permanently Change Default sound device. shep FreeBSD General 5 14th June 2008 05:58 PM
Bare Minimum Site-to-Site VPN on OpenBSD ai-danno Guides 0 20th May 2008 12:45 AM


All times are GMT. The time now is 09:30 PM.


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