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 3rd June 2008
aleunix aleunix is offline
Real Name: Alessandro
Spam Deminer
 
Join Date: May 2008
Location: Italy
Posts: 224
Default There is an alternative way to find a packages?

There is an alternative way to find a packages?
I have seen Faq 15.2.3 - Finding packages.

There is an equivalent to command debian?
apt-cache search package_name
Reply With Quote
  #2   (View Single Post)  
Old 3rd June 2008
corey_james corey_james is offline
Uber Geek
 
Join Date: Apr 2008
Location: Brisbane, Australia
Posts: 238
Default

I wrote a pretty dodgy shell script a few years ago that went off to the openbsd ftp site and did a directory listing and stored this as an index. Then used a simple grep to find the package from the index

i just found the script - i wrote it in perl. if you want it pm me
__________________
"No, that's wrong, Cartman. But don't worry, there are no stupid answers, just stupid people." -- Mr. Garrison

Forum Netiquette
Reply With Quote
  #3   (View Single Post)  
Old 3rd June 2008
cubo cubo is offline
Real Name: Luca
Port Guard
 
Join Date: May 2008
Location: Italy - Torino
Posts: 21
Default

Code:
curl ftp://mirror.switch.ch/pub/OpenBSD/4.3/packages/i386/ | grep bash (or any other package)
Reply With Quote
  #4   (View Single Post)  
Old 3rd June 2008
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by aleunix View Post
There is an equivalent to command debian?
apt-cache search package_name
pkg_info -Q. See the manpage for pkg_info(1) for more information.
Reply With Quote
  #5   (View Single Post)  
Old 3rd June 2008
ai-danno's Avatar
ai-danno ai-danno is offline
Spam Deminer
 
Join Date: May 2008
Location: Boca Raton, Florida
Posts: 284
Default

ocicat's right - and here's how to make that permanently useful:

if logging in as root (or searching and adding packages as root), add the following line to your /root/.profile file-

PKG_PATH=ftp://ftp.usa.openbsd.org/pub/OpenBSD/4.x/packages/i386/

FIVE THINGS ABOUT THE PRECEDING LINE-
1) you may want to change to a different site other than usa.openbsd.org
2) change the 4.x to the version of OBSD you are using (i.e. 4.3 if you are running the current release.)
3) change the i386 if you are using a different archeticture.
4) Log out and back in as root for this line to take effect.
5) Make sure your DNS is working properly so the path can be properly resolved.


From there, running the pkg_info -Q xxxx (where xxxx is the package name you are looking for) should bring up the exact package name you are looking for (if it exists.)

From there run pkg_add yyyy (where yyyy is the exact package name you found above.)

Good luck
__________________
Network Firefighter
Reply With Quote
  #6   (View Single Post)  
Old 4th June 2008
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

You don't need to set the release and architecture if you apply a little creative scripting:

Code:
PKG_PATH="ftp://ftp.usa.openbsd.org/pub/OpenBSD/`uname -r`/packages/`uname -m`/:ftp://ftp.openbsd.org//pub/OpenBSD/`uname -r`/packages/`uname -m`/"; export PKG_PATH
the above sets my PKG_PATH to the two mirrors (see the man page for pkg_add), and it uses the current installations release level and arch ;-)

i.e.

Code:
$ echo "ftp://ftp.usa.openbsd.org/pub/OpenBSD/`uname -r`/packages/`uname -m`/"

ftp://ftp.usa.openbsd.org/pub/OpenBSD/4.3/packages/i386/
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
  #7   (View Single Post)  
Old 4th June 2008
aleunix aleunix is offline
Real Name: Alessandro
Spam Deminer
 
Join Date: May 2008
Location: Italy
Posts: 224
Default

Quote:
Originally Posted by ai-danno View Post
ocicat's right - and here's how to make that permanently useful:

if logging in as root (or searching and adding packages as root), add the following line to your /root/.profile file-

PKG_PATH=ftp://ftp.usa.openbsd.org/pub/OpenBSD/4.x/packages/i386/

...
Yes i know this solution.

But on this point i would have another question as to ensure that this change is immediately detected by the system?
Do I must end the user session with the command exit and re-enter?

In linux i use the command line source to make these changes immediately active here do not know.

TerryP good tricks!
Reply With Quote
  #8   (View Single Post)  
Old 4th June 2008
Dazhelpwiz Dazhelpwiz is offline
Port Guard
 
Join Date: May 2008
Location: Townsville, Australia
Posts: 34
Default

you could always just search the webpage too if thats an option your interested in.

http://www.openbsd.org/4.3_packages/i386.html

depending on release just change x.x_packages and the platform ur after : "amd64.html"
Reply With Quote
  #9   (View Single Post)  
Old 4th June 2008
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

Once your shells environment is modified, all programs executed from that shell after the change will understand the change.

Placing the setting in your shells config file will make it perminate for all new shells, and you can have the current shell read the configuration again (e.g. use: . ~/.profile)


Programs executed before the change but still running will probably not (reliably) take notice.


In C programs you would probably use getenv() to look up an environment variable, whether or not the 'current environment' in my manual page refers to a copy of the environment created by the programs process or a hook into the parent processes current environment, I don't know since I've never tested it or read the standard on it.

But I'd expect it to be a copy of the environment taken when the process is created.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
Old 5th June 2008
aleunix aleunix is offline
Real Name: Alessandro
Spam Deminer
 
Join Date: May 2008
Location: Italy
Posts: 224
Default

Quote:
Originally Posted by TerryP View Post
you can have the current shell read the configuration again (e.g. use: . ~/.profile)
Now I do not on X.
I have modified the environment variable PKG_PATH with add an error but the new content isn't read.
Attached Images
File Type: jpg openbsd-profile.jpg (34.5 KB, 88 views)
Reply With Quote
Old 5th June 2008
Dazhelpwiz Dazhelpwiz is offline
Port Guard
 
Join Date: May 2008
Location: Townsville, Australia
Posts: 34
Default

Quote:
Originally Posted by aleunix View Post
Now I do not on X.
I have modified the environment variable PKG_PATH with add an error but the new content isn't read.
your path is wrong.

PKG_PATH="ftp://ftp.openbsd.org/pub/OpenBSD/4.3/packages/i386/"
Reply With Quote
Old 5th June 2008
Sunnz's Avatar
Sunnz Sunnz is offline
Real Name: I don't have real time
Just a computer user...
 
Join Date: May 2008
Location: See Google Maps
Posts: 101
Default

Hmm why not just search the ports tree?

cd /usr/ports/
make search name=searchname

or

make search key=searchkey

Packages are just precompiled ports... right?
__________________
She sells C shells by the seashore.
Reply With Quote
Old 5th June 2008
aleunix aleunix is offline
Real Name: Alessandro
Spam Deminer
 
Join Date: May 2008
Location: Italy
Posts: 224
Default

Quote:
Originally Posted by Dazhelpwiz View Post
your path is wrong.
Yes I know, but I wanted to make a test to see if the new content for the variable was taken without having to end the session instead nothing.
Reply With Quote
Old 6th June 2008
ai-danno's Avatar
ai-danno ai-danno is offline
Spam Deminer
 
Join Date: May 2008
Location: Boca Raton, Florida
Posts: 284
Default

Quote:
Originally Posted by aleunix View Post
Yes I know, but I wanted to make a test to see if the new content for the variable was taken without having to end the session instead nothing.

I'm a little confused by that reasoning, but oookay. A wrong path will show you no success whatsoever, in the current or future sessions.

Anyway, you can just execute the export PKG_PATH command at the command prompt for instant gratification (aka, being able to check right then without restarting a session.) This can be good in comparing various sources for packages (for completeness, latency, etc.)

However, this will only be good for the duration of the session- adding it to your /root/.profile will make it workable for every session in the future.

Sunnz asked "why not search the ports tree?" and suggested looking in /usr/ports ... but for those of us without a ports tree on their local system, this is the next best thing.
__________________
Network Firefighter
Reply With Quote
Old 6th June 2008
ai-danno's Avatar
ai-danno ai-danno is offline
Spam Deminer
 
Join Date: May 2008
Location: Boca Raton, Florida
Posts: 284
Default

to test the PKG_PATH you placed in /root/.profile, you can also just "sh /root/.profile"
__________________
Network Firefighter
Reply With Quote
Old 6th June 2008
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by ai-danno View Post
to test the PKG_PATH you placed in /root/.profile, you can also just "sh /root/.profile"
For clarity, I think you are intending to specify $HOME/.profile.
Reply With Quote
Old 6th June 2008
Sunnz's Avatar
Sunnz Sunnz is offline
Real Name: I don't have real time
Just a computer user...
 
Join Date: May 2008
Location: See Google Maps
Posts: 101
Default

Quote:
Originally Posted by ai-danno View Post
Sunnz asked "why not search the ports tree?" and suggested looking in /usr/ports ... but for those of us without a ports tree on their local system, this is the next best thing.
Oh yes I can understand that... I just find that works for me and others new to OpenBSD may not know about this...

As far as I know of, there some stuff in the ports tree are not available in packages, which might be useful to get the ports tree if you need that software.

Quote:
Originally Posted by ocicat View Post
For clarity, I think you are intending to specify $HOME/.profile.
Meh... just put it in /etc/profile and everybody gets it.
__________________
She sells C shells by the seashore.
Reply With Quote
Old 6th June 2008
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by Sunnz View Post
As far as I know of, there some stuff in the ports tree are not available in packages...
This is correct, especially for the more exotic supported hardware platforms. Due to restricted resources, packages for all ports are not created.

The rule of thumb is to use packages when available; otherwise, compile from ports.
Reply With Quote
Old 6th June 2008
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by Sunnz View Post
Meh... just put it in /etc/profile and everybody gets it.
...or do you mean /etc/skel/.profile?
Reply With Quote
Old 6th June 2008
Sunnz's Avatar
Sunnz Sunnz is offline
Real Name: I don't have real time
Just a computer user...
 
Join Date: May 2008
Location: See Google Maps
Posts: 101
Default

Actually I do mean /etc/profile.

From my vague memory it is not there in the first place... you may need to su and create it.

Last time I read the man page for ksh, that's what it reads first before it reads ~/.profile...

It also works the same for bash, not sure about sh or tch though... zsh uses /etc/zprofile and ~/.zprofile instead.
__________________
She sells C shells by the seashore.
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
sysjail alternative Stellar OpenBSD General 7 4th September 2009 04:38 PM
VPN alternative: ssh -w s2scott OpenBSD Security 15 16th April 2009 01:09 AM
Alternative Architecture Laptops JMJ_coder General Hardware 6 7th October 2008 05:05 PM
Alternative to FoxPro? michaelrmgreen Programming 2 18th July 2008 11:40 AM
iTunes alternative stukov Off-Topic 8 14th June 2008 01:55 PM


All times are GMT. The time now is 08:58 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