Portage is the package management system used by Gentoo Linux. It is known for its flexibility and power, allowing users to customize their software installations to fit their specific needs. Here are some key features and concepts associated with Portage:
-
Source-Based System:
- Portage typically installs software from source code, allowing for optimizations tailored to the user’s hardware and preferences.
-
USE Flags:
- USE flags are a way to customize how software is built. They allow users to enable or disable optional features for packages during installation. For instance, if you don’t want multimedia support, you can disable it with the relevant USE flag.
-
Slots:
- Portage allows multiple versions of the same package to be installed simultaneously, referred to as “slotting.” This is useful for maintaining different software versions for compatibility with different applications.
-
Ebuilds:
- Ebuilds are scripts that define how to install a particular package. They include instructions for fetching the source code, configuring it, compiling it, and installing it.
-
World File:
- The world file keeps track of the packages that the user wants to have installed. You can view and modify it to manage your installed software.
-
Dependencies:
- Portage automatically handles package dependencies, ensuring that all necessary libraries and tools are installed for a package to function correctly.
-
Portage Tree:
- The Portage tree is a collection of ebuilds organized into categories. It can be synced with the latest available software from the Gentoo repositories using commands like
emerge --sync
.
¶ Basic Commands
-
Installing Packages:
emerge package_name
-
Updating Packages:
emerge --update --deep --newuse @world
-
Searching for Packages:
emerge --search package_name
-
Removing Packages:
emerge --unmerge package_name
-
Syncing the Portage Tree:
emerge --sync
-
/etc/portage/make.conf:
This file contains global settings for Portage, such as CFLAGS (compiler flags) and the USE flags for your system.
-
/etc/portage/package.use:
This file is used to specify USE flags for individual packages.
-
/etc/portage/package.accept_keywords:
This file is used to manage which versions of packages can be installed (e.g., unstable versions).