Funtoo Linux First Steps

From Funtoo Linux
Revision as of 02:14, 12 February 2012 by Drobbins (Talk)

Jump to: navigation, search

Help us improve this page by adding your favorite post-install first steps!


After booting into a new Funtoo Linux installation, you are ready to explore the full capabilities of your system.

Contents

Fundamentals

New Funtoo Linux systems generally benefit from performing the following steps:

Portage First Steps: Installing an Editor

By default, Funtoo Linux has the nano and vi editors installed. nano is the default editor.

If you are new to Funtoo Linux, you have probably heard about emerge, the Funtoo and Gentoo Linux command for installing packages from the Portage tree. Funtoo Linux has a git-based Portage tree, which is located at /usr/portage by default. It contains scripts called ebuilds that describe how to build and install packages from source. emerge is used to run these scripts and install packages, as follows:

# emerge vim

You can also see what packages would be installed, but not actually install them, by using the -p, or --pretend option:

# emerge -p vim

Another equally handy option is the -a, or --ask option, which will display the packages to be merged, and then ask for confirmation from you before continuing:

# emerge -a emacs

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N     ] app-admin/eselect-emacs-1.13 
[ebuild  N     ] net-libs/liblockfile-1.09 
[ebuild  N     ] app-emacs/emacs-common-gentoo-1.3-r1  USE="-X -emacs22icons" 
[ebuild  N     ] app-editors/emacs-23.4-r1  USE="alsa gif gpm jpeg png tiff xpm -X -Xaw3d (-aqua) -athena -dbus -gconf -gtk -gzip-el -hesiod -kerberos -livecd -m17n-lib -motif -sound -source -svg -toolkit-scroll-bars -xft" 
[ebuild  N     ] virtual/emacs-23 

Would you like to merge these packages? [Yes/No]  y

In the above emerge output, you can see some text beginning with USE= on the app-editors/emacs line. This means that this package has a number of optional build-time features which can be controlled using Portage USE variables. These USE variables can be set globally by adding a line such as this to /etc/make.conf:

USE="gif jpeg png tiff xpm"

If you go ahead and make these changes, and then run emerge -a emacs again, you will notice that several more dependencies will be pulled into the list of packages to be merged. You can control the footprint of your Funtoo Linux system (and avoid bloat) by enabling only the USE variables you need.

Above, we enabled several USE variables globally in /etc/make.conf. It is also possible to enable USE variables on a package-per-package basis, and often times this is the best approach. If we wanted to enable gtk for emacs only, we would create the /etc/portage/package.use directory, and create an emacs file in it that contained the following:

app-editors/emacs gtk

Note that package.use can also be a file if you prefer. However, using an /etc/portage/package.use directory is recommended as it keeps things better organized. The filenames you use inside the package.use directory do not impact Portage behavior and can be named whatever it convenient for you. You might want to put the settings above in a file called /etc/portage/package.use/editors if you have several USE settings that you use for editors.

Default editor

Funtoo Linux also has a special meta-command called eselect, which can be used to set many default system settings. One of the things it is used for is to set the default editor used by things like crontab -e, etc that will automatically start an editor when run. Here is how to use eselect to change the default system editor:

# eselect editor list
Available targets for the EDITOR variable:
  [1]   /bin/nano
  [2]   /bin/ed
  [3]   /usr/bin/ex
  [4]   /usr/bin/vi
  [ ]   (free form)
# eselect editor set 4
Setting EDITOR to /usr/bin/vi ...
Run ". /etc/profile" to update the variable in your shell.

After logging in again, or typing source /etc/profile in the current shell, the new system editor will be active.

Installing a logger

It's a good idea to install a system logging daemon, and then enable it. This will ensure that any important system messages are logged to text files in /var/log.

Metalog is a popular lightweight logger:

# emerge metalog
# rc-update add metalog default
# rc
 * Starting metalog ... 

Above, we used the rc-update helper command to add the metalog initialization script to the default runlevel. The default runlevel, defined at /etc/runlevels/default, contains symbolic links to all system initalization scripts to run by default.

The rc command will tell OpenRC to ensure that all services in the current runlevel are running, and if they are not, to start them. Since we added metalog to the default (current) runlevel, but did not start it, running rc will cause metalog (and any other scripts that need to start) to be started.

If you need to stop a service manually, you can run its initialization script directly from /etc/init.d:

# /etc/init.d/metalog stop
 * Stopping metalog ...     

Necessary applications for daily usage

A list of very useful tools:

app-misc/screen
Allows you to have persistent login sessions.
app-misc/tmux
Similar to screen -- some people prefer it.
app-admin/sudo
Grant root privileges to selected users and command combinations.
sys-process/htop
Colorful and informative text-based process list.
# emerge --jobs=5 app-misc/screen sudo htop

Creating a user account

It's a good idea to create a normal user account that you can use for general Linux tasks. Before rebooting, create a user account for everyday use. Adjust the groups in the example below to match your needs. Some of them may not exist yet on your system. Replace "user_name" with the name you're going to use for your everyday user. The "-m" option instructs useradd to create a home directory for your user. See man useradd for more info.

# useradd -m -g users -G audio,cdrom,games,video,wheel user_name

Don't forget to set a password for your new user:

# passwd user_name

Changing profile

Currently, Funtoo only supports a modified version of the 2008.0 profile. Running eselect profile list will show all available profiles.

# eselect profile list
Available profile symlink targets:
  [1]   default/linux/amd64/2008.0 *
  [2]   default/linux/amd64/2008.0/desktop
  [3]   default/linux/amd64/2008.0/developer
  [4]   default/linux/amd64/2008.0/server

In this example, we will enable the "desktop" profile, which enables many USE flags that a typical desktop user would find useful.

# eselect profile set 2

To take advantage of the USE flags you have just enabled, it's necessary to recompile everything that includes them. The D option means to also check dependencies for changes, and N means to check for new USE flags. world is a "meta-package" which includes every package that you have manually installed. Depending on the number of packages you've installed, this can take a long time.

# emerge -DN world

Installing a graphical environment

If you intend on using your Funtoo Linux installation for more than system administration, chances are you're going to want to have a GUI (graphical user interface). In the past, setting one up involved wading through text files and man pages. Thanks to modern tools like udev this is no longer the case.

Unlike most operating systems, Funtoo does not ship with a GUI pre-installed. If you've used Windows or Mac OS, you'd also know that their interfaces cannot be replaced easily. With Linux, the opposite is true -- you are free to choose from a huge selection of GUIs. From window managers such as Blackbox, IceWM, and xmonad, to fully-featured desktop environments like GNOME and KDE, the possibilities are vast in number.

X.Org

In order to use a graphical environment, it is necessary to install X.Org Server. Before we start, it's a good idea to make sure that your system is configured correctly. If you installed a kernel using the binary USE flag, chances are that your video card is already supported.

In order for Portage to know which video card(s) you want to support, you'll need to add a line to your make.conf.

# nano -w /etc/make.conf
...
VIDEO_CARDS="intel"

In this example, we're using Intel integrated graphics drivers. Examples of valid entries include radeon for AMD Radeon cards, and nouveau or nvidia for NVIDIA cards. If you haven't yet switched to the desktop profile, it's a good idea to do it now.

Next comes the actual installation:

# emerge xorg-x11

Now we need to test to make sure X.Org is working properly.

# startx

If everything is well, a simple GUI along with an analog clock and a terminal will appear.

Personal tools
Namespaces

Variants
Actions
Categories
Toolbox
Stuff