4

doing

  emerge -avuDN --with-bdeps y --keep-going @world

takes a whole lot of time and often fails.

Is there a way to print a list of all upgrade-able packages in a Gentoo system?

  • You should use @world instead of world. – Francesco Turco Mar 10 '17 at 11:51
  • what is exactly the difference? – Oz123 Mar 10 '17 at 14:57
  • 2
    world is a package set (group of packages). Package sets must begin with an @ sign to be recognized by emerge. Otherwise they may be mistaken for normal packages. Omitting the @ sign is still supported by emerge but that may change in the future. @world is future-proof because it avoids potential confusion. What if a new package called world is added to the Gentoo repository? – Francesco Turco Mar 10 '17 at 15:59
6

eix is your best option for this.

eix --installed --upgrade will print all installed packages where the best version is not the present version (for each slot).

Does come at the cost that you need to keep the eix database up to date after each sync.

  • Thanks! this makes the output machine parsable also eix -u --format '<installedversions:NAMEVERSION>' – Oz123 Apr 1 '17 at 5:20
  • 1
    yes, there's many format options. Puppet's package provider for Gentoo/Portage uses eix with: '<category> <name> [<installedversions:LASTVERSION>] [<bestversion:LASTVERSION>] [<installedversions:LASTSLOTVERSIONS>] [<bestslotversions:LASTSLOTVERSIONS>] <homepage> <description>\n' – robbat2 Apr 2 '17 at 4:52
  • While I like eix this may be overkill. Before adding a tool, add 2 more options to emerge. -p for pretend and -t for treeview – eyoung100 Apr 12 '17 at 7:20
  • 1
    @eyoung100 the OP complained that emerge itself took too long and often failed. Simply adding -pt would not fix that issue. – robbat2 Apr 13 '17 at 23:17
  • @robbat2 I'm not saying it would fix it, but it would list the list of updates. Fixing the breakage is up to the OP, no matter what tool is used – eyoung100 Apr 13 '17 at 23:24
2

History

Now that I have a browser back(more on that below), I feel I should expand on my comments in @robbat2's answer. After 5+ years with Gentoo as my primary OS, and experimentation over those 5 years with portage, and Paludis I came to the realization that all major distributions are built around the Package Management System/Tool.

  1. Debian and it's variants use apt.
  2. Redhat/Fedora and it's variants use rpm.
  3. SuSE and it's variants use yum.
  4. The many others

For the full list see: List of Linux distributions. Note that the Wiki Entry divides the distributions by Package Management. Also note, that according to the timeline photo that Gentoo is a parent distribution. Enoch was the initial name.

The BSD's

Historically speaking most of the BSD Operating Systems, have had no concept of Package Management until recently, and it could use some work. I put FreeBSD on an extra hard drive I had to see how closely it and Gentoo are related, and just finished compiling my DE port and a browser.

  1. Gentoo has the Portage Tree, FreeBSD uses the Ports Tree.
  2. Gentoo has sys-apps/portage. The emerge command follows the same order as FreeBSD when installing software: configure, make, install - when installing source directly from the Ports Tree.

The major difference here is that the process in FreeBSD requires a user to install their chosen package manager, not one chosen by FreeBSD, and then that package manager keeps track of all installed software, and it's dependencies.


I say all this to show that if the package manager breaks while maintaining the system, the issue is either with the package being compiled or the underlying system. To illustrate see: FreeBSD Bug 218620 - x11-wm/muffin ver. 2.4.4 no longer builds. Notice Comment 1 prevented my chosen package manager from completing the install of the Cinnamon Desktop, not because the Package Manager that I use broke, or took too long, or was slow, but because the package being compiled is broken, and for that matter, no longer supported. In the same way, the OP's emerge command is not completing due to a breakage in the package being compiled. Instead of running the command:

emerge -avuDN --with-bdeps y --keep-going @world

blindly because it was found on some website, the OP should either add t for treeview, and remove --keep-going. At that point, study and fix the breakage in the offending package, and re-run the command. All packages up to the breakage will no longer appear in the output, because they were already recompiled under the new settings. This procedure should be used regardless of the tool you use to display the output. Eix vs emerge is moot, when the breakage is due to a compilation error.

Hint

The offending package information the OP needs to study will be located at /var/tmp/portage/package-cat/offending-package/temp/build.log

0

Imho the easiest way to print a list of all upgradeable packages in gentoo:

emerge --sync
emerge -puDv @world

The options do the following:

  • -p pretend: emerge does not actually install anything, it just prints a list of packages it would install without the -p flag. This even works without root privileges.
  • -u upgrade: only show upgradeable packages.
  • -D deep: also check for upgrades of dependencies (packages that are not in your @world file directly but required for one of your installed packages to run).
  • -v verbose: more verbose output also shows the use flags and the currently installed version.

If you are certain that your portage tree is already up do date, you can skip the emerge --sync part.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.