View Full Version : sysinstall
05-23-2005, 08:24 PM
I like what I think I understand about the .pbi installer system, but of course one of the great things about FreeBSD is the oodles of software available. If I promise to look in the pbi packages list first, are there any problems with using software from the freebsd.org ports collection at freebsd.org? I mean other than not getting the benefits of the new system, will it break anything or cause conflicts with PC-BSD packages.
Next, is there any reason not to do that (or anything else) with sysinstall? I noticed a PC-BSD graphical installer screen offered a command (which I didn't write down) to CVSup the ports tree, but I'm a little familiar with sysinstall from back in the day when I tried FreeBSD 4.6.
I think what I have here is a perfectly functional FreeBSD system but with some additional benefits of PC-BSD, but I'm not sure how ignorant I am.
In any case, many thanks, pats on the back, and congrats to the FreeBSD team for what you've accomplished.
05-23-2005, 09:25 PM
I use PC-BSD with the FreeBSD Ports System and no problems yet. portsnap and portinstall/portupgrade are very easy to use applications and it works perfect for me :)
05-23-2005, 09:39 PM
use PC-BSD with the FreeBSD Ports System and no problems yet.
same here! :-)
I noticed a PC-BSD graphical installer screen offered a command (which I didn't write down) to CVSup the ports tree,
that would be cvsup /root/ports-supfile
05-23-2005, 10:04 PM
that would be cvsup /root/ports-supfile
I prefer portsnap.
You only have to # portsnap fetch and #portsnap update to update your ports collection and it's much faster than cvsup...
more on http://www.daemonology.net/portsnap/
06-10-2005, 04:51 AM
Can someone guide me on how to install this portsnap utilities into my pc-bsd 0.7? wat are the steps and can anyone kind enough to list it out? Thanks..... :)
06-10-2005, 05:27 AM
Ok, here is how I do it. First, install the ports collection as mentioned above.
Next it depends how fancy you want to be. This works for me. Rather than su-ing to root, I also install the sudo port.
cd /usr/ports/security/sudo && make install clean
Once that's done, assuming you're familiar with the vi editor
visudo -f /usr/local/etc/sudoers
Let's say your user name is john.
Add at the end (because sudo processes things from top to bottom, so put the important stuff at the end. If there are contradictory rules in there, sudo will process the 2nd one in the file.
john ALL= NOPASSWD: /usr/local/sbin/pkgdb, /usr/local/bin/portsnap
(That should be on one line--some browsers might break it.)
Before running portsnap for the first time, you have to have a /usr/local/etc/portsnap.conf. You'll see, after installing portsnap, that you'll have a /usr/local/etc/portsnap.conf.sample
cp portsnap.conf.sample portsnap.conf
Run portsnap the first time
You only run the extract command the first time. That one will take quite awhile, it's basically replacing the ports tree that you got with cvsup.
Now I create a script--I call it portsnap.sh, you can call it anything you like. I put it in my $HOME/bin directory. So, if I'm user john
I make the following script.
sudo portsnap fetch
sudo portsnap update
sudo pkgdb -u &&
portversion -vL = > ports.txt
wc -l ports.txt
If you're not familiar with shellscripting, the first line tells the program what shell to use, in this case, the very basic shell called sh.
Then, I use sudo to allow me to do various things that require root privilege.
I run portsnap fetch.
Then, I run portsnap update
Next, I update the pkg database with pkgdb -u. The && after that means, if the command completes succesfully, do the next step. (Sometimes, a new port will be installed, and other things have to be done to the pkgdb--with the &&, I get the error message if this happens.
Next I cd to my home directory--this way, if I'm somewhere else, the ports.txt file that will be created in a minute wil be created in my home directory. (For instance, if I were in /usr, checking something, and ran the script, if I didn't do the cd first, that is, doing a change directory to my home directory, I'd get permission denied when it went to create the ports.txt file.
Next, I run portversion which checks my packages against the ports tree. The -v, as in many commands is for verbose, the -L means to
leave out what I put next, which is the = sign. Otherwise, if I had
bash-3.0.16_1 and that's the version in the ports, using the -v flag would show me bash-3.0.16_1=bash-3.0.16_1 and do that for every package that I had installed from ports. :)
I send the output from the portversion -vL = command to a file I call ports.txt. Next, I use the wc (word count) command with an -l flag, to give me the number of lines. (That's a lower case L, not the numeral one).
Again, this script is for my own use, and I like to have an idea of how many ports might need upgrading. Also, sometimes, there is a port that I know is an older version than the ports tree, but I want to keep it--for instance, the eject command, version 1.4 something honors the -t option, that closes the CD tray. Version 1.5 in FreeBSD doesn't close the CD tray, so I don't want that upgrade.
So, if I get a result of ports.txt 1, I know that nothing's been updated, because the 1 means there's only one line, and I know that will be the eject port.
So, that's how I use it. Some people do it differently, for instance having it send an email to them through the system to inform them of ports that need updating. Others wouldn't bother with the wc -l part, but just have it give the output to a file (as I do with the > ports.txt part) and then read the file.
At any rate, this way works for me. :)
06-10-2005, 06:11 AM
Thank u very much man! Your guide should be able to guide me through on how to set it up.. many thanks to u! :D
06-10-2005, 07:31 AM
assuming if i dun use sudo and also not familiar with vi editor.. so can i replace the command with "eesudo" or is there such thing or command? kindly enlighten.. thanks man... :)
06-10-2005, 02:04 PM
I'm sorry do you mean you DO use sudo or DON'T? (That's the trouble
with mistuypes--err, mistypes, then we have to guess.) :)
I'm guessing from your question that you do want to use sudo.
Ok if you're not familiar with sudo, the simple way is to just do
ee /usr/local/etc/sudoers. The advantage of using visudo is that it
locks the file so two people don't work on it at once, and it also will
catch syntax errors.
There are ways to change the visudo editor. I'm still assuming you're
using csh. You should have a file in your home directory called .cshrc.
You will see a line setenv EDITOR vi. Change that vi to ee.
Then, log out and log in again. Then, visudo should use ee.
Let's make this a little simpler, though a little less secure. Do the
above as root, and make sure you're changing .cshrc in root's directory,
not your own. After doing your su to root do
to bring you to root's home directory.
(To doublecheck, you can always do pwd. This stands for print working
Ideally you might add user john to the wheel group and from here on in
always use sudo, after uncommenting the line in sudoers that allows
wheel group members to run all commands. (However, I would NOT choose
the option that allows them to run it without passwords.) You will see,
in /usr/local/etc/sudoers two lines--one that allows wheel group members
to run all commands and one that allows that without a password.
To add user john to the wheel group
pw groupmod wheel -m john
If you meant that you're not using sudo, then just ignore all of the
above, run portsnap as root and eliminate sudo from the script I posted.
06-13-2005, 03:49 AM
yep i meant that I DON't use the sudo command.. thanks again for the valuable feedback.. :)
06-13-2005, 03:56 AM
Heh, my pleasure. Oh well, if you don't use sudo, that will make it easier.
While we all think that no one is going to hack ~our~ machine, it really is considered better to use sudo (though it's not perfect either of course, there are various ways to take advantage of it as well)
Hopefully, my sudo instructions will help someone else along the way. :)
10-16-2005, 09:40 AM
As a matter of fact your directions did help someone. ME! Six months down the road but I sure learned a lot. I have been beating my head against a wall trying to figure out sudo. You gave me the needed push to get it straight in my mind. Thanks!
vBulletin® v3.8.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.