# How could I run an installed package?



## Hossein (Jan 9, 2015)

I started using FreeBSD today. How could I run an installed package?


----------



## Juanitou (Jan 9, 2015)

Welcome! Could you be more explicit? What application (package) are you trying to run and how did you install it?


----------



## Hossein (Jan 9, 2015)

Juanitou said:


> Welcome! Could you be more explicit? What application (package) are you trying to run and how did you install it?


Firefox which I have installed it by this: `pkg install firefox` as the handbook says.


----------



## getopt (Jan 9, 2015)

For a quick experience open a terminal like xterm and do
`> firefox &`
If your window manager has a command line feature you can do it there.

For more comfort you have to edit the menu of your window manager then you can use your mouse to start programs.


----------



## Hossein (Jan 10, 2015)

getopt said:


> For a quick experience open a terminal like xterm and do
> `> firefox &`
> If your window manager has a command line feature you can do it there.
> 
> For more comfort you have to edit the menu of your window manager then you can use your mouse to start programs.


  I installed xwindow but I don't know how to run it. I installed Firefox and xwindow only as I installed FreeBSD today.


----------



## MeesterWood (Jan 10, 2015)

Install x11/xfce4 (I think the command is `pkg install xfce`) and run it with `startxfce4`. Once xfce has loaded, open a terminal and run `firefox` or `firefox&` as was previously mentioned.


----------



## getopt (Jan 10, 2015)

There is a nice HOWTO you should read:
https://forums.freebsd.org/threads/howto-minimal-freebsd-desktop.35308/


----------



## h5n1 (Jan 10, 2015)

and, you always have Google ...


----------



## Kiiski (Jan 10, 2015)

There is also PCBSD http://www.pcbsd.org/
http://www.pcbsd.org/
Which has a smaller learning curve, but is FreeBSD under hood.


----------



## bsdkeith (Jan 10, 2015)

N.B. PCBSD is 64 bit only, no 32 bit.


----------



## ANOKNUSA (Jan 10, 2015)

If only things were so simple. Have a look at the Wikipedia pages for Desktop Environments and Window Managers. You need to configure a graphical environment before you can start using graphical applications. MeesterWood recommended x11-wm/xfce4, which is a rather traditional desktop that's pretty light on resources and easy to get running quickly, but there are a half-dozen other desktop environments and dozen popular of stand-alone window managers you might try (not to mention oodles of not-so-popular "cult" window managers).


----------



## bsdkeith (Jan 10, 2015)

For a quick/easy GUI - `pkg install Xorg fluxbox firefox`.
(Add /usr/local/bin/startfluxbox to your .xinitrc file.)


----------



## Hossein (Jan 10, 2015)

h5n1 said:


> and, you always have Google ...


Well...What does it mean?


----------



## Hossein (Jan 11, 2015)

getopt said:


> For a quick experience open a terminal like xterm and do
> `> firefox &`
> If your window manager has a command line feature you can do it there.
> 
> For more comfort you have to edit the menu of your window manager then you can use your mouse to start programs.




```
#firefox &
(process :763) :glib-critical **: g_slice_set_config: assertion ' sys_page_size ==0' failed
Error : no display specified
```
what should I do?


----------



## formateur_fou (Jan 11, 2015)

Hossein said:


> what should I do?


I think you should read the Handbook at least until chapter 8. By reading it, you would have learnt that X (and Firefox) is not meant to be used with the root user. This is why you're are getting this error. Take your time, and read the documentation from the site, this is one of the very good aspects of this project.
If you don't feel like it, which is understandable as it's a lot of reading, you'd better choose another system that do most of the work for you, otherwise you are going to stumble over many problems like this one.


----------



## getopt (Jan 11, 2015)

The error has nothing to do that the program possibly was run as root.
But formateur_fou is absolutely right that it is a no-go to run internet connecting programs as root which would be a security risk.

```
Error : no display specified
```
This points to a misconfigurated Xserver configuration or a missing video driver. So before trying to get Firefox running you should take care that first Xorg is well configured and does not show any errors.


----------



## formateur_fou (Jan 11, 2015)

getopt said:


> The error has nothing to do that the program possibly was run as root.


From a X terminal:

```
$ su -
Password:
# firefox   
Error: no display specified
# exit
$ firefox
$
```


----------



## formateur_fou (Jan 11, 2015)

getopt said:


> I do not have this error when starting Firefox as root via su


Probably because you became root by using `su` and not `su -`, so $DISPLAY was already set from your user account.


----------



## getopt (Jan 11, 2015)

formateur_fou
Which is true.


----------



## formateur_fou (Jan 11, 2015)

So now, we've shown the OP how to run Firefox as the root user... Not very good, is it? ;-)
A good practice would be to read the output of a program installation and its manual.


----------



## Hossein (Jan 11, 2015)

formateur_fou said:


> I think you should read the Handbook at least until chapter 8. By reading it, you would have learnt that X (and Firefox) is not meant to be used with the root user. This is why you're are getting this error. Take your time, and read the documentation from the site, this is one of the very good aspects of this project.
> If you don't feel like it, which is understandable as it's a lot of reading, you'd better choose another system that do most of the work for you, otherwise you are going to stumble over many problems like this one.


I don't log in with root.


----------

