Gentoo Portage Slot Conflict

Posted on
This page contains changes which are not marked for translation.
English • ‎español • ‎italiano • ‎polski • ‎русский • ‎中文(中国大陆)‎ • ‎日本語 • ‎한국어

–backtrack= is supposed to automate manual picking resolvable versions. But if you have blocker on a popular package (like glib) the search space increases quickly to the point where portage can’t do it automatically in a reasonable amount of time. Multiple package instances within a single package slot have been pulled: 14. Resulting in a slot conflict: 15: 16.

The purpose of this page is to provide users, in particular new ones, with a set of techniques and tools to allow them to troubleshoot and fix problems with their Gentoo setups on their own. In addition, for those problems which are more complicated, this article seeks to provide users with the skills to collect information that will aid them and their supporters in resolving their issues with a greater degree of expediency.

This article assumes that the Gentoo Handbook has been read and that there is a basic understanding of using Gentoo.

Where to get help

Gentoo has quite a few wikis all of which have a wealth of information. Be wary that some articles may contain old or outdated information, but hands down, reading wiki articles is always a critical step when using Gentoo.

  • Knowledge Base, for common practices and problems

On IRC, the #gentoo is the recommended channel for general issues. This is probably the fastest way to get an answer.

Since IRC channels require active presence, some users might prefer leaving a message at a forum or mailing list which continues to exist after closing the browser. When an answer pops up, a notification (usually through an e-mail) is sent back.

When all else fails, and it appears something is broken with Gentoo, Gentoo's bug tracker is a great resource to see if something has already been reported, or to create new bugs if need be. This is a very effective way to reach the Gentoo Developers, which can then use the given feedback to improve the problematic situation and solve the problem.

Programs

This is a collection of tools that are highly recommended:

Package management

PackageDescription
app-portage/gentoolkitprovides a collection of tools for interacting with Gentoo; it includes the valuable equery, eclean, euse and eshowkw, see their man pages for more information.
app-portage/eixprovides eix, a tool for querying portage for packages
app-portage/pflprovides e-file, a tool for querying what package contains a given file; it also works for packages that aren't installed since it uses an online lookup.
app-portage/genlopprovides genlop, a tool for parsing emerge logs; handy to figure out when certain packages were installed, updated and to see how long they took to compile.
app-portage/elogvprovides elogv, a ncurses based interface for browsing emerge logs.

Hardware

PackageDescription
sys-apps/pciutilsprovides lspci, a tool for gathering information about PCI devices.
sys-apps/usbutilsprovides lsusb, a tool for gathering information about USB devices.

Monitoring

PackageDescription
sys-process/htopprovides htop, a tool for monitoring processes. Like top, but more advanced.
sys-process/iotopprovides iotop, a top-like tool for monitoring IO activity by process.
net-analyzer/nettopprovides nettop, a top-like tool for examining network traffic by protocol, port, and process.

Miscellaneous

PackageDescription
app-text/wgetpasteprovides wgetpaste, a tool for uploading text directly to a pastebin.
net-irc/weechatprovides weechat, a simple text based IRC client.

First steps

In order to shape a problem into a solution you first need to understand the problem well enough. If the problem is not clear then it will be very hard, if not impossible to come up with a solution. An accurate, detailed description of the problem is more likely to yield a solution that best fits the problem.

Identifying the problem

This part may seem like it's a no-brainer, but without it, any troubleshooting will be next to impossible.

Take note of a few things:

  1. Is this problem related to hardware or software?
  2. What was done or has been changed recently that may have been the cause of this issue?
  3. Can additional information about the problem be collected?

Storing any form of detail, logs, other people experiencing it and more can be valuable and gives a good overview.

Hardware issues

Drivers

Driver issues for hardware is one of the more common issues that are reported on IRC.

First and foremost, identify what the hardware is that is causing problems. lspci and lsusb are great tools for this purpose. For demonstration purposes, we'll be looking at an Ethernet card as the troublesome device.

Determining the proper driver

First look with lspci and find the device information:

It is also possible to use the -n option to give a short-hand notation (which might be easier to search for on the Internet):

The model name (0200) and vendor/model (11ab:436b) can be used to look up the device on a place like WikiDevi or Debian HCL to find the right driver to use in Linux.

Verifying the driver is loaded

Getting the driver is less than half of the battle. Most of the trouble with drivers is making sure that they are loaded and operating correctly.

Relying on our friend lspci again, run:

Note that here, an indicator is given that a driver is in use. If not, then no driver has claimed responsibility over this hardware. Assuming the driver was built as a module rather than built-in, try modprobe <modulename> to attempt loading the right module. If the driver was built-in, consider making it a module, because modules can be loaded with modprobe and unloaded with modprobe -r which saves on number reboots while debugging the issue.

Troubleshooting a driver

Compile the driver as a module, then capture the output it generates when the module is loaded. Make sure to first remove all modules that depend on the driver (see lsmod).

The following command will compare the dmesg output after removing the module (in this example, r8169) with the output after adding the module again, effectively showing the messages that were added (lines starting with +).

root #diff -u <(modprobe -r r8169; dmesg) <(sleep 1; modprobe r8169; dmesg) grep ^+

The most common issue is missing firmware. If a message shows up that informs the administrator about missing firmware, grab either sys-kernel/linux-firmware or a specific firmware package from Portage and install it. After the firmware installation, unload and load the kernel module again to see if this fixes the situation.

Software issues

Portage issues

Dependency graph slot conflicts

Occasionally, messages like this occur when trying to emerge a package:

Generally, this means that the packages listed have multiple requested versions in the dependency graph. And fortunately most, if not all, cases allow to resolve it by manually upgrading to the highest requested version. So assuming that the following message was received:

The most recent version desired is 20120520, so:

root #emerge --ask --oneshot =app-emulation/emul-linux-x86-xlibs-20120520

Often, it's advantageous to one-shot (--oneshot or -1) all of the conflicts at once because they sometimes depend on one another.

Here is another example of a block:

There should be no problem changing poppler versions. Note that app-text/texlive-core does not require a specific version of poppler, but it needs to be rebuild with whatever version is used:

root #emerge --ask --oneshot =app-text/poppler-0.24.5 app-text/texlive-core


Here is another example that could have resulted in a blockage:

root #emerge --ask --verbose --update --newuse --deep @world

Portage warns about an update that can not be performed, however, there is no issue because this update is not required by a package. More precisely, the update must be skipped because mate-base/mate-applets-1.12.1-r4 requires a version of sys-power/cpupower package lower than 4.7.

Gentoo Portage Slot Conflict Games

Debug a binary

Trouble shoot a compiled binary by Debugging with powerful tools.

Collecting additional information

When seeking help, often additional information will be asked, such as the output of a command. Some of these produce dozens or hundreds of lines of text - too much to be suitable for pasting into chat rooms, such as the Gentoo IRC support channel.

Wgetpaste allows users to post short links to a website that contains long output.

To show the contents of /etc/conf.d/net:

If someone needs the detailed output of an lspci command is:

Sometimes it is necessary to redirect stderr to stdout so that error messages can be pasted as well:

  • In case of hardware problems or kernel issues:
  • In case of portage issues:
  • In case of package installation failures:
root #wgetpaste /var/tmp/portage/<category>/<package>-<version>/temp/build.log
  • In case of Xorg issues:

Gentoo Portage Slot Conflict Bracket

  • In case all installed packages on the system needs to be provided:

Wrapping things together

Below is a shell function that can be used to have several commands executed and their output processed by a single wgetpaste command so that only one URL needs to be provided to the user or developer that wants to help out:

Please do not use pastebin services on the gentoo-user mailing list

Most pastebin services expire old pastes periodically (not to mention that pastebin services are hardly profitable, and close down all the time) whereas mailing list messages are archived in multiple places and are referenced for years. If the relevant output is short, or can be trimmed, then copy and paste it into the body of the email - longer output can be directed into a text file and added as a plain attachment.

Forming a solution

With a good description of the problem, a complete history of actions and all sorts of debugging data (problem details, hardware / software information, logs, backtraces and more) a good set of useful data is available to look for a solution.

In general, repeat the following steps to come to a solution:

  • Get an idea where the problem might be, think about possible causes.
  • If there are no obvious areas to look into, become more acquainted with the related areas or ask an expert more about it.
  • Sometimes it is necessary to make assumptions to proceed. When assumptions are made, put it to the test: false assumptions should not make users and developers blind of other causes.
  • Obtain additional debugging information in the area of a problem, or perform tests.

Often this will lead to multiple possible causes. It is important to test them (to verify it is the actual cause or not) and therefore test them individually; this is also known as 'divide and conquer'.

Let's say a problem like 'my browser sometimes displays white pages when I boot' comes up and a lot of details are already known about it, then there may be number of possible causes:

  • Is this because the browser was improperly closed when the system rebooted?
Verify this by killing the process and pulling the plug several times, each time checking if the pages are white after booting again. If this is a cause, is it the actual cause or are there other causes?
  • Is this the result of a specific browser version being broken?
Try older or newer versions for a few days or reboots and see if they are broken as well.

And so on...

With the additional information, dare to think about more specific causes:

  • Does a certain pinned tab X that loads plugin Y break the system?
Unpin the tab so it doesn't open on launch anymore or disable the plugin, see if this keeps the problem away.
  • Graphical issues were reported as well, might this maybe mean this is caused by the video drivers?
Try a different version for those drivers, or alternative drivers if available.

As each possible cause is investigated, the actual cause of the problem might come closer and closer.

And in the end, if the cause is still not found, the Where to get help resources at the top of this article yield a multitude of places with people that are looking forward to help; make them happy with a careful problem description and mentioning what has already been tried so far, it'll help them help out.

See also

Retrieved from 'https://wiki.gentoo.org/index.php?title=Troubleshooting&oldid=861626'
< Project:Portage

How can 'blocks' between packages be resolved?

See the Blocked Packages section in the Gentoo Handbook.

Why is it that emerge does not update all packages?

By default, the dependency graph may not include some packages. For example, it will not include any packages that are listed in the output of emerge --pretend --depclean. It will also not include any build time dependencies for installed packages or binary packages. If you would like to include such build time dependencies even though they are not strictly required, use --with-bdeps=y. You can set EMERGE_DEFAULT_OPTS='--with-bdeps=y' in /etc/portage/make.conf if you would like this option to be enabled by default. If you would like a specific package to be updated in any case, you can use emerge --noreplace <atom> to have it added to the world set.

After running emerge --deep --with-bdeps=y --update @world, it is a good idea to use emerge --pretend --depclean to see if there are any packages that it would remove. If that command shows a package that you would like to keep, use emerge --noreplace <atom> to have it added to the world set.

Warning
When you use emerge --depclean to remove unwanted packages, it is a good idea to run revdep-rebuild (from the app-portage/gentoolkit package) afterward.
Note
Run man emerge to view the manual page which documents all emerge options.

How can I check for reverse dependencies of a package, to know if it can be safely uninstalled?

Run emerge --depclean --pretend --verbose [atom]... to see if there are any reverse dependencies for matched packages.

Warning
When you use emerge --depclean to remove unwanted packages, it is a good idea to run revdep-rebuild (from the app-portage/gentoolkit package) afterward.

Why does emerge --depclean sometimes remove system packages?

For system dependencies that are specified as virtuals, such as virtual/editor, it's common to have multiple packages installed that are capable of satisfying the dependency. In this case, redundant packages may be removed by emerge --depclean unless they are explicitly added to the world set. You can use emerge --noreplace <atom> to have a package added to the world set, and this will guarantee that this package will not be removed by emerge --depclean.

Why doesn't emerge account for reverse dependencies sometimes?

Gentoo Emerge Slot Conflict

Complete accounting for reverse dependencies is time-consuming, and many users would be likely to complain about poor performance if this was the default behavior. So, reverse dependencies will often be neglected by dependency calculations unless the emerge --complete-graph option is enabled. You can set EMERGE_DEFAULT_OPTS='--complete-graph' in /etc/portage/make.conf if you would like this option to be enabled by default. Refer to the emerge manual page (run man emerge) for more information about the --complete-graph option.

Can I mount the Gentoo repository (/var/db/repos/gentoo) via NFS?

It is possible to share the Gentoo repository (/var/db/repos/gentoo) over NFS so that emerge --sync only needs to be run on an NFS server. However, even though NFS clients do not need to run emerge --sync, they must run emerge --metadata each time that the Portage tree is updated since otherwise their dependency calculations will slow down due to their metadata cache (located in /var/cache/edb/dep) becoming stale.

Note
With versions of Portage >=2.1.5_rc6 there is never any need to run emerge --metadata as long as the user has not enabled FEATURES='metadata-transfer' in make.conf. When metadata-transfer is disabled, metadata cache from the /var/db/repos/gentoo/metadata/md5-cache/ directory will be used directly. Run man make.conf to learn more about metadata-transfer.

If you encounter problems with an NFS setup it is important that you ensure you have the proper locking daemons on both the NFS client machines and the NFS server machine. Portage uses hardlinks over NFS in an attempt to lock files; if the locking daemon fails to lock files Portage may complain about failed or stale locks. There is a script /usr/lib/portage/bin/clean_locks that can be used to clean out old lockfiles.

Why does emerge display 'waiting for lock' messages?

The most common reason is due to FEATURES='parallel-fetch' which is enabled by default in /usr/share/portage/config/make.globals. Set FEATURES='-parallel-fetch' in /etc/portage/make.conf if you would like to disable this feature. Refer to the make.conf manual page (run man make.conf) for more information about possible FEATURES values.

If the emerge command is invoked multiple times concurrently, or if DISTDIR location is on a shared network file system, this may also trigger similar 'waiting for lock' messages. Such locks are necessary in order to prevent interference between concurrently running processes.

Why does the @preserved-rebuild set contain packages that have already been rebuilt?

This is a common problem which indicates that the build system for the given ebuild causes the package to inappropriately link against the old (preserved) version of the library, instead of the new one. As a workaround, you can manually remove the old library (such as libreadline.so.5.2) and then run revdep-rebuild in order to rebuild the packages which linked against it. A list of all preserved libraries may be obtained from portageq list_preserved_libs /.

When packages are built in parallel with the --jobs option, why aren't some packages installed immediately after they have finished building?

As a safety precaution, installation actions for system packages and their deep dependencies are executed only when no other packages are building. This behavior is required in order to avoid cases like bug #256616 (unspecified system dependencies) and bug #259954 (temporarily unsatisfied system dependencies).

Why doesn't emerge --pretend output show the correct SLOT for a package with USE=multislot enabled?

Since ebuilds that support USE=multislot violate established rules about 'constant metadata', cached SLOT value differs from the SLOT value that you will actually get once the package is installed. There is nothing portage can do about this except to implement an extension such as bug #174407.

How do I configure environment variable settings that apply only to specific packages?

Put an entry such as sys-libs/glibc debug.conf in /etc/portage/package.env, and put your variable settings in /etc/portage/env/debug.conf (using the same format as make.conf). An example debug.conf file might appear as follows:

What should I do when emerge reports a lot of dependency conflicts involving built slot-operator (foo/bar:X/Y=) dependencies?

Built slot-operator (foo/bar:X/Y=) dependencies tend to introduce a lot of noise when emerge dependency calculations fail. If you encounter this problem, then you should temporarily add the emerge --pretend and --ignore-built-slot-operator-deps=y options to your emerge command, in order to suppress noise related to built slot-operator dependencies so that it is easier to identify issues that are more important. This problem is tracked by bug #598503.

Gentoo Portage Slot Conflict Guide

It addition to the --pretend and --ignore-built-slot-operator-deps=y options mentioned above, it can also be helpful to temporarily add --backtrack=0 to the emerge options, so that the dependency resolver does not spend extra time backtracking before it ultimately fails. Also, it can be helpful to use --ask instead of --pretend, so that emerge will ask you if you would like to write configuration changes that have been automatically generated by the --autounmask option.

Also see Built Slot Operator Dependency Conflicts.

What should I do if emerge fails to solve conflicts when there are 'no parents that aren't satisfied by other packages in this slot'?

This is a known issue, reported in bug #595224. If the conflict solely involves built slot-operator (foo/bar:X/Y=) dependencies (the --verbose-conflicts option can help you determine this), then you should temporarily add the emerge --pretend and --ignore-built-slot-operator-deps=y options to your emerge command, as discussed in the answer to the previous question. Otherwise, it may be necessary to solve the conflict by masking one of the packages with package.mask.

Gentoo Portage Slot Conflict Buster

Why is there a dependency conflict when I attempt to upgrade a single package?

Attempts to upgrade single packages will often trigger dependency conflicts because emerge does not have an option to specify that it should automatically update reverse dependencies as needed. As discussed in bug #559354, there are plans to implement an option for automatically update of reverse dependencies. Meanwhile, the recommended practice is to update all packages together (after each emerge --sync operation), using a command such as emerge --deep --with-bdeps=y --update @world.

Emerge
Retrieved from 'https://wiki.gentoo.org/index.php?title=Project:Portage/FAQ&oldid=825265'