PDA

View Full Version : How the hell do you use ports?


OptimusChrist
11-23-2006, 06:59 AM
I'm a total noob to *nix. I do want to learn though, so I figured I'd install Opera from ports. I add the pkg fine, but when I attempt to make a clean install it ALWAYS (no matter what program i'm trying to install from ports) tells me there is no such directory.

Is this because I need to run CVsup? I started too but it was downloading a sh*tload of data and my PC-BSD HDD is only 20 gigs and I didn't know how much it was gonna install. Any help?

TerryP
11-23-2006, 07:48 AM
You do need to install the ports collection before you can use ports to install software. It's about 200~400MB of directories, software discritions, makefiles e.t.c. Every thing needed to fetch, configure, compile, and install the port.

You can install the ports collection via GUI or CLI. In the GUI use the PC-BSD System program, Tasks Tab->Fetch Ports

Via command line depending on preference/verison

All Free/PC-BSD

portsnap fetch extract

or PC-BSD <=1.2

cvsup -L 1 /root/ports-supfile

Or PC-BSD == 1.3Beta

csup -L 1 /root/ports-supfile.

Install software by opening a terminal or changing direction in one to the ports directory. Example: Joe's Own Editor is in /usr/ports/editors/joe

give it a make install clean and go on coffer break. If it has any build options it will prompt you for them when needed. You might want to pkg_add -r portupgrade if it's not installed (good tool suite). You can uninstall ports the same as installing them but use "make deinstall" instead of "make install clean"

On http://www.pbidir.com there is a program named BPM (Bsd Ports Maniputlator) it's a dev build but it's a very nice no frillz ports install/uninstall GUI with basic searching.

Charles
11-23-2006, 10:25 AM
I hope this helps :)
http://docs.pcbsd.org/guide/chap4.1.html

jdarnold
11-23-2006, 02:48 PM
After you get the ports tree populated, I recommend using portmanager:

# portsnap fetch extract update
# cd /usr/ports/sysutils/portmanager
# make && make install && make clean
# rehash
# portmanager www/opera -l


Portmanager does a pretty good job of checking all the dependencies and building everything that needs it.

antik
11-23-2006, 03:14 PM
# portsnap fetch extract update
# make && make install && make clean


You can shorten it like this:

# make install clean

OptimusChrist
11-23-2006, 03:49 PM
Thanks guys, hopefully one day I will pwn my megahurtz as much as all of you.

jdarnold
11-23-2006, 04:30 PM
# portsnap fetch extract update
# make && make install && make clean


You can shorten it like this:

# make install clean

Yeah, you can, but I've always felt safer doing it in the 3 steps. For one, sometimes just 'make install' doesn't always make everything it should. For another, if the makefile isn't done "just so", doing one target then the other on the same line may not always work like you want it to. So I do it in three steps, and by using the '&&', if any of the steps fails it will abort the whole process.

OptimusChrist
11-24-2006, 02:25 AM
Speaking of..... I have been using the && parameter and every single one of my installs have failed thus far. Usually, it tells me that it requires an old version of a dependancy and I have newer ones installed. Now.... Will this cause problems or is it okay to use the newer versions of the dependencies? If this is the only error I'm getting should I just remove the "&&"?

TerryP
11-24-2006, 05:06 AM
Normally a newer minor version doesn't harm much of any thing. You might thumb around the /usr/ports/UPDATING file if you ever do a mass portupgrade of the system though.

pkg-x.y_z

antik
11-24-2006, 07:44 AM
Speaking of..... I have been using the && parameter and every single one of my installs have failed thus far. Usually, it tells me that it requires an old version of a dependancy and I have newer ones installed. Now.... Will this cause problems or is it okay to use the newer versions of the dependencies? If this is the only error I'm getting should I just remove the "&&"?

Use portupgrade -rR yourapplication

dracheflieger
11-24-2006, 12:47 PM
Speaking of..... I have been using the && parameter and every single one of my installs have failed thus far. Usually, it tells me that it requires an old version of a dependancy and I have newer ones installed. Now.... Will this cause problems or is it okay to use the newer versions of the dependencies? If this is the only error I'm getting should I just remove the "&&"?

Follow antik's advice but just for information, the && simply means to finish one command before moving on to the next.

11-24-2006, 01:14 PM
Speaking of..... I have been using the && parameter and every single one of my installs have failed thus far. Usually, it tells me that it requires an old version of a dependancy and I have newer ones installed. Now.... Will this cause problems or is it okay to use the newer versions of the dependencies? If this is the only error I'm getting should I just remove the "&&"?

For me, usually there is an older version of a dependancy, which is already installed by default. To fix this issue, cd to that directory, ie;
cd /usr/ports/x11-toolkits/gtk or whatever it is and then install that particular port but if it is already installed, it will tell you and offer you a chance to make deinstall or use package_delete "name of package" inluding the version number, at which point, you will then continue with the install by re-doing make install clean and the needed port is installed.
I always have to do this with the linux emulation, in order to have the FC4 emulation instead of the default.
Actually, I believe FreeBSD 6.2, now defaults to FC4. So, thats my 2 cent input. :D

jdarnold
11-24-2006, 03:16 PM
Speaking of..... I have been using the && parameter and every single one of my installs have failed thus far. Usually, it tells me that it requires an old version of a dependancy and I have newer ones installed. Now.... Will this cause problems or is it okay to use the newer versions of the dependencies? If this is the only error I'm getting should I just remove the "&&"?

Which is why I've been using sysutils/portmanager to install ports these days. It takes care of all this.

11-24-2006, 03:51 PM
Speaking of..... I have been using the && parameter and every single one of my installs have failed thus far. Usually, it tells me that it requires an old version of a dependancy and I have newer ones installed. Now.... Will this cause problems or is it okay to use the newer versions of the dependencies? If this is the only error I'm getting should I just remove the "&&"?

Which is why I've been using sysutils/portmanager to install ports these days. It takes care of all this.

I have not tried it yet but admit that it has been in my eyeballs path for a while. When I install again, I will check it out.
I installed Xandros Desktop 4 Professional on all my systems so I could add to the Xandros hardware list, while beta testing.
I have no installs of PCBSD at this time but I am probably looking at installing it today and maybe updating my system to FreeBSD 6.2RC1. :D

Note: FreeBSD6.2RC1 automatically acknowleges my atheros based wireless card and allows setup immediately through sysinstall. That's a sweet deal. :mrgreen:

dracheflieger
11-24-2006, 04:32 PM
So it's known, portupgrade just bumped a version a few days back and it's much smarter now...also fixed some STOOPIT! problems in pkgdb -F

mcrae
11-28-2006, 11:51 PM
when installing portmanager it ask if we like to "treat dependencies as leaves"

what does that mean?

Thanks,
McRae

jdarnold
11-29-2006, 12:50 AM
Here's what the man page says:

WITH_BUILD_DEPENDS_ARE_LEAVES

a) portmanager normally tries to keep ports that are only build depen-
dencies for other ports installed and current, some people have expressed
a dislike of tracking build dependencies this close. By setting
WITH_BUILD_DEPENDS_ARE_LEAVES=1 in pm-020.conf or through make config,
build dependencies that are missing won't be tracked and -sl -slid will
list these type of ports as leaves.

b) ports/java, ports in this category are allowed to build even if build
dependencies are missing in normal mode, all though in normal mode build
dependencies will still get identified as missing.


Basically, if something is only used to *build* something else, as opposed to being needed to actually run it, you can tell portmanager to treat it as a "leaf", ie, a port that nothing depends on and can be safely removed. I would say that unless diskspace is at a premium, you're better off just leaving this option alone (ie, not turning it on).

mcrae
11-29-2006, 01:39 AM
jdarnold,

Thanks for explaining this.....ummm. .I guess I should have checked the man page :oops:

I've installed it the way you said, leaving that option out, and it's working nicely.

Thanks Again,
McRae

jdarnold
11-29-2006, 10:38 AM
Don't worry, as it's a catch 22. You can't read the man page until you install the port and you can't install the port until you read the man page! So the man page isn't there to read until the port gets installed.

Adam_GUI
12-06-2006, 03:16 PM
Sorry to bump as old a thread as this is, but I have a relating question.

I've run portupgrade -arf And it's been compiling for well over 12 hours now on a 1.4GHz P4 with an ADSL connection.

Any ideas on how much longer this could take?
I can't help but wonder if I've doomed my PC to an eternity of compiling.

Thanks! :)

ranran
12-06-2006, 04:04 PM
So it's known, portupgrade just bumped a version a few days back and it's much smarter now...also fixed some STOOPIT! problems in pkgdb -F

PCBSD#pkgdb -F
pkgdb: Command not found.


Umm, what now?

dracheflieger
12-06-2006, 04:43 PM
Sorry to bump as old a thread as this is, but I have a relating question.

I've run portupgrade -arf And it's been compiling for well over 12 hours now on a 1.4GHz P4 with an ADSL connection.

Any ideas on how much longer this could take?
I can't help but wonder if I've doomed my PC to an eternity of compiling.

Thanks! :)

As long as it takes...it's rebuilding everything you had installed ;-)

Adam_GUI
12-06-2006, 08:01 PM
Sorry to bump as old a thread as this is, but I have a relating question.

I've run portupgrade -arf And it's been compiling for well over 12 hours now on a 1.4GHz P4 with an ADSL connection.

Any ideas on how much longer this could take?
I can't help but wonder if I've doomed my PC to an eternity of compiling.

Thanks! :)

As long as it takes...it's rebuilding everything you had installed ;-)

woot! I started at 1:00PM yesterday EST. It's been going over 24 hours now!
WHEeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeee!!!!!!!!!!! :mrgreen:

TerryP
12-07-2006, 11:02 PM
It usually takes me around 8 hours with only a few ports installed other then whats in PC-BSD. I've got a Pentium D 930 & 2GB of Ram /w a fast HDD though.

I've been waiting to rebuild my kernel and start installing a few nifty things on my laptop till 1.3 comes out b/c the laptops sempron is not exactly up to compiling kde 3.5.4

domecq
12-25-2006, 01:13 AM
Don't worry, as it's a catch 22. You can't read the man page until you install the port and you can't install the port until you read the man page! So the man page isn't there to read until the port gets installed.
There's actually this alternative:
http://www.freebsd.org/cgi/man.cgi?manp ... +and+Ports (http://www.freebsd.org/cgi/man.cgi?manpath=FreeBSD+6.1-RELEASE+and+Ports)

Cheers

marc
12-25-2006, 01:50 PM
portsnap fetch extract[code]


Damn, you saved my ass with this command :D
I always tried to do it with CVSup with no results.[/quote]

TerryP
12-25-2006, 05:46 PM
I believer 'portsnap fetch update' may fetch and update the ports tree as well, been awhile since I've used portsnap. I kinda like cvsup ^_^

dracheflieger
12-25-2006, 06:07 PM
I would use portsnap fetch extract for a first run and then always after portsnap fetch update

marc
12-25-2006, 08:57 PM
Thanks for the precious tips. Portsnap is a great tool.