If you are brand new to Gentoo Linux or Funtoo Linux, this page will help you to get familiar with your new system, and how it works.

Intro to Emerge: 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 /var/git/meta-repo 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:

root#emerge vim

An important note about any commands you specify on an emerge command-line -- Portage will automatically add them to your "selected" set, which means that Portage now understands that you want to keep this package updated as part of your system.

Using the --pretend (-p) option, you can see what emergewould do, without actually doing it:

root#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 as to whether you would like to proceed and merge the packages, or not:

USE Variables

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.

It is possible to enable USE variables globally in /etc/portage/make.conf, on a per-package basis in /etc/portage/package.use, or as logical sets by using Funtoo Profiles. It's recommended that you first take a look at Funtoo Profiles and see if there may be sets of USE variables that you want to enable as a group. You can set your system flavor to more accurately reflect the intended use of your Funtoo system, and by doing so, many more USE variables will be set (or unset) to reasonable defaults for your intended use.

These USE variables can be set globally by adding a line such as this to /etc/portage/make.conf:

/etc/portage/make.conf (bash source code)

USE="gif jpeg png tiff xpm"

Or, alternatively, you can enable just these USE variables for emacs by adding the following line to /etc/portage/package.use:

/etc/portage/package.use (bash source code)

app-editors/emacs gif jpeg png tiff xpm

However, it's generally best to find a Funtoo Profile flavor or mix-in that serves your purpose. For example, setting your system to be a desktop by running epro flavor desktop or adding the appropriate mix-in via epro mix-in +mediaformat-gfx-common gives you more opportunity to dial in sets of related USE variables with a single command.

See the emerge page for more information on various emerge command-line options and best practices.

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:

You may also want to update your system after you have changed USE flag settings. To take advantage of the USE flags you have just enabled, it's necessary to recompile everything that includes them.

Below, you'll find a recommended emerge command for updating your entire system. The -a option will cause emerge to prompt you for confirmation before starting the merge:

root#emerge -auDN @world

-u tells emerge to update any already-installed but out-of-date packages that we specify on the command-line. The -D option tells emerge to perform a deep dependency tree graph, so it will include sub-dependencies of packages that we have specified on the command line as well. This allows emerge to perform as thorough an update of your system as possible.

The -N (--newuse) option tells Portage to check for any new USE flags that have been enabled or disabled, and rebuild packages so that all USE flags are set as currently defined in Funtoo Profiles, /etc/portage/make.conf and /etc/portage/package.use.

world is a "meta-package" or "package set" which includes every package that you have manually installed plus all packages in the system set. If you want to see a list of all these packages, look at /var/lib/portage/world: