# New to everything - Ports.



## kasumi (Dec 15, 2010)

Hello. 

Well, as already said, I'm quite new to everything related to FreeBSD, but I've been using PCBSD several months.

I'm currently running Slackware here, because of the missing software I'd like to switch to FreeBSD now, I've already read about the ports and packages.

OpenBSD was the system running on my server once, I downloaded the ports from the University in Erlangen, everything worked fine for me. But for some reason the server broke down.

I want to use FreeBSD on a Desktop PC (2,8 Quad, 4GB RAM) and the first question is; How do I install applications? What's the command for downloading the ports? Please name a server in Europe, no too far away from Austria. ;D

On OpenBSD, I had to cd to the right directory and run "make install" in order to make the software running. The most important thing for me would be a Desktop, either GNOME or Fluxbox/Openbox. I couldn't really understand the handbook, so I'm posting in this forum..

Please help,

kasumi


----------



## graudeejs (Dec 15, 2010)

Read the Handbook:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports.html


----------



## UNIXgod (Dec 15, 2010)

If your system does not have ports installed you can aquire them through portsnap()


----------



## graudeejs (Dec 15, 2010)

UNIXgod said:
			
		

> If your system does not have ports installed you can aquire them through portsnap()



That's covered in handbook as well


----------



## kasumi (Dec 15, 2010)

I'm currently reading again, and only understanding 60% of them.

Thank you for answering.


----------



## kasumi (Dec 15, 2010)

So, everything runs now, but now I fail on configuring the Internet connection in sysinstall.

Host, Domain, IPv4 Gateway, Name Server.......... what are these?


----------



## phil10 (Dec 15, 2010)

All of that config depends on the network setup you have. The gateway is the device which grants you access to the internet for example.


----------



## kasumi (Dec 15, 2010)

```
# ifconfig

em0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
 options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
 ether 08:00:27:68:dd:fc
 media: Ethernet autoselect (1000baseT <full-duplex>)
 status: active
lo0: flags=8808<LOOPBACK,MULTICAST> metric 0 mtu 16834
 options=3<RXCSUM,TXCSUM>
```

Well... how do I configure everything?


----------



## phil10 (Dec 15, 2010)

```
# sysinstall
```

then select Configure, then Networking and then Interfaces which will show you a dialog how you want to configure your network interface.


----------



## graudeejs (Dec 15, 2010)

in /etc/rc.conf

```
ifconfig_em0="123.123.123.123 netmask 255.255.255.0"
defaultrouter="123.123.123.1"
```
replace 123.123.123.123 with your IP
replace 123.123.123.1 with your ISP gateway

in /etc/resolv.conf

```
nameserver 123.123.123.1
nameserver 123.123.123.2
```
Here IPs are IPs of your ISP DNS servers

If you don't have static IP, then simply in /etc/rc.conf add

```
ifconfig_em0="DHCP"
```

More info in handbook, rc.conf(5) and ifconfig(8)


----------



## kasumi (Dec 15, 2010)

When I enter "ee rc.conf" and change something, I get the following error message: "unable to create file rc.conf"


----------



## graudeejs (Dec 15, 2010)

Make sure you have *root* priviledges (su(1), must be in wheel group to use su)


----------



## kasumi (Dec 15, 2010)

# chmod 777 rc.conf
chmod: rc.conf: Read-only file system

What now? >.< I'm getting disappointed.


----------



## UNIXgod (Dec 15, 2010)

kasumi said:
			
		

> When I enter "ee rc.conf" and change something, I get the following error message: "unable to create file rc.conf"



You need to be root user. If your in wheel you can change your user with the switch user command su()


----------



## UNIXgod (Dec 15, 2010)

kasumi said:
			
		

> # chmod 777 rc.conf
> chmod: rc.conf: Read-only file system
> 
> What now? >.< I'm getting disappointed.



why did you do that?


----------



## kasumi (Dec 15, 2010)

Why did I do what?

And what wheel do you mean? Well... /etc/sudoers does not seem to exist, if that is what you're talking about.


----------



## UNIXgod (Dec 15, 2010)

kasumi said:
			
		

> Why did I do what?
> 
> And what wheel do you mean? Well... /etc/sudoers does not seem to exist, if that is what you're talking about.



don't run chmod on those files. 

log off your user and log on as root

then you can run your editor.

consider putting your user in the wheel group so you can switch to root from your user in the future.


----------



## sk8harddiefast (Dec 15, 2010)

> And what wheel do you mean? Well... /etc/sudoers does not seem to exist


You must install sudo from ports and after edit sudoers file on /usr/local/etc
Logout and login as root.

```
cd /usr/ports/security/sudo
make install clean
```
after:

```
cd /usr/local/etc
ee sudoers
```
Put user on sudoers. Log out and login as user. Use sudo for your jobs


----------



## phil10 (Dec 15, 2010)

You should really read the handbook 

If there is no sudoers file like in Linux, you can get the port for sudo from the ports directory.


----------



## wblock@ (Dec 16, 2010)

kasumi said:
			
		

> # chmod 777 rc.conf
> chmod: rc.conf: Read-only file system
> 
> What now? >.< I'm getting disappointed.



First: FreeBSD is not a funny-looking Linux.  Some things are different.  Keep this in mind.

Second: a read-only filesystem is usually due to yanking the power without shutting down.  Boot normally and wait, and the system will automatically repair the filesystems.

Third: after the initial install, don't use sysinstall any more.  It's built for installing, and if you use it for maintenance, it will surprise you in unpleasant ways.

Fourth: log in as root, or use "su -".  sudo is unnecessary at this stage (and many stages).

Fifth: don't 'chmod 777' anything.  It is a failure waiting to happen.

Sixth: do one thing at a time.  Get your Ethernet card to obtain a DHCP lease before going on to other things.  The Handbook covers this and many other things, but if you try to do them all at once it's almost always doomed to failure.  Accomplish one thing, then move on to the next.  Race car drivers don't drive fast at first, either.


----------



## sk8harddiefast (Dec 16, 2010)

> Fourth: log in as root, or use "su -"


I was not sure if su was a part of sudo or not. Probably comes with the system


----------



## wblock@ (Dec 16, 2010)

sk8harddiefast said:
			
		

> I was not sure if su was a part of sudo or not. Probably comes with the system



It's part of the base: su(1).  (Clickable link!)


----------



## kpedersen (Dec 16, 2010)

wblock said:
			
		

> It's part of the base: su(1).  (Clickable link!)



Hmm, that clickable link was good fun. I am off to explore the internet for more clickable links!


----------



## kasumi (Dec 16, 2010)

When I boot FreeBSD, the last message is:


```
Enter full pathname of shell or RETURN for /bin/sh:
```
And when I hit enter, I get the #, waiting for my commands.


----------



## SirDice (Dec 16, 2010)

It's booting to single user mode. Did you do that on purpose or was there an error?

Standard way of dealing with single user mode:

```
fsck -y
mount -u /
mount -a -t ufs
swapon -a
```


----------



## UNIXgod (Dec 16, 2010)

kasumi said:
			
		

> When I boot FreeBSD, the last message is:
> 
> Enter full pathname of shell or RETURN for /bin/sh:
> 
> And when I hit enter, I get the #, waiting for my commands.



After you deal with what SirDice just mentioned type return and you'll get back to multi-mode.


----------



## wblock@ (Dec 16, 2010)

UNIXgod said:
			
		

> After you deal with what SirDice just mentioned type return and you'll get back to multi-mode.



exit or ctrl-D to leave the single-user shell.


----------



## UNIXgod (Dec 16, 2010)

wblock said:
			
		

> exit or ctrl-D to leave the single-user shell.



cool. Didn't know that worked as well.


----------



## kasumi (Dec 16, 2010)

Hello and thank you all, it still won't work.


```
cd /usr/ports/x11/gnome2
make install

blahblahblah
fetch: [url]ftp://ftp.FreeBSD.org/pub/FreeBSD/distfiles/python/Python-2.6.5.tgz[/url]
: No access record

=> Couldn't fetch it - please try to retrieve this
=> port manually into /usr/ports/dsitfiles/python and try again.
```

So my connection still doesn't seem to work.


----------



## UNIXgod (Dec 16, 2010)

sounds like your nic isn't set up.


----------



## phil10 (Dec 16, 2010)

SirDice said:
			
		

> It's booting to single user mode. Did you do that on purpose or was there an error?
> 
> Standard way of dealing with single user mode:
> 
> ...



Like SirDice said, did you intentionally boot the single user mode?
If no, you should reboot.

Do you have internet access with your machine at all?
Does

```
# ping google.com
```
give you replies?

If not, please post your /etc/rc.conf file here.


----------



## DutchDaemon (Dec 16, 2010)

Sounds like PC-BSD is the way to go for you.


----------



## lme@ (Dec 16, 2010)

There's also a German version of the handbook: http://www.freebsd.org/doc/de_DE.ISO8859-1/books/handbook/
_Please_ read at least some of it first.


----------



## kasumi (Dec 16, 2010)

Yeah I know of these handbooks and I'm reading them again and again. PC-BSD doesn't boot.

The problem IS, that my PC doesn't get any IP-Address by DHCP.

http://h-2.abload.de/img/ajagjdz57.jpg

Here you can see what I typed during the OpenBSD-Installation.


----------



## UNIXgod (Dec 16, 2010)

kasumi said:
			
		

> Yeah I know of these handbooks and I'm reading them again and again. PC-BSD doesn't boot.
> 
> The problem IS, that my PC doesn't get any IP-Address by DHCP.
> 
> ...



I can't help you with openbsd. But maybe you need to make sure your router is set up correctly first.


----------



## kasumi (Dec 16, 2010)

Account Name  	 RP614v4
Firmware Version 	V1.0.2_06.29
Internet Port
MAC Address 	00:18:4D:E0:5A:37
IP Address 	192.168.1.14
DHCP 	DHCPClient
IP Subnet Mask 	255.255.255.0
Domain Name Server 	192.168.1.1
	0.0.0.0
LAN Port
MAC Address 	blahblah
IP Address 	192.168.178.1
DHCP 	ON
IP Subnet Mask 	255.255.255.0

That's what my router says.


----------



## wblock@ (Dec 16, 2010)

What have you done to try to get a DHCP lease?


----------



## kasumi (Dec 16, 2010)

Well, I edited rc.conf, and I tried EVERYTHING at the OpenBSD-installation. It just.. won't work. And installing FreeBSD from a PC-BSD DVD also won't work. I haven't tested internet connection with PC-BSD on the live-cd. A few days ago, I had Fedora running on this PC and it worked without problems. And it still works on every PC, but just not on the BSD'd one.


----------



## wblock@ (Dec 16, 2010)

If you want useful responses, please provide details.  Did you edit /etc/rc.conf (note the /etc)?  What did you put in it?  What Ethernet card do you have?  Does ifconfig show that you have the Ethernet card you think you have?


----------



## kasumi (Dec 16, 2010)

killasmurf86 said:
			
		

> in /etc/rc.conf
> 
> ```
> ifconfig_em0="123.123.123.123 netmask 255.255.255.0"
> ...



I added what he told me to add. I tried both possibilities, none worked.


----------



## lme@ (Dec 17, 2010)

`# dhclient em0` ?


----------



## kasumi (Dec 17, 2010)

Well... Doesn't tell me anything useful. Just a few dots and then "sleeping"

I'm currently running the Ubuntu Live CD, Internet connection works without problems. And PC-BSD also didn't get a connection...


----------

