8

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?

Jonas Stein
  • 3,898
  • 4
  • 34
  • 55
oz123
  • 507
  • 7
  • 20
  • You should use `@world` instead of `world`. –  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? –  Mar 10 '17 at 15:59

3 Answers3

11

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.

robbat2
  • 3,599
  • 20
  • 32
  • Thanks! this makes the output machine parsable also `eix -u --format ''` – oz123 Apr 01 '17 at 05:20
  • 1
    yes, there's many format options. Puppet's package provider for Gentoo/Portage uses eix with: `' [] [] [] [] \n'` – robbat2 Apr 02 '17 at 04: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 07: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
  • @eyoung100 `eix` would list it even if emerge is broken (and can be helpful in getting everything else upgraded so you can narrow down the breakage) – robbat2 Apr 14 '17 at 22:02
  • @robbat2 if emerge is broken gentoo is screwed to the point of reinstalling. Try it yourself, and see what I mean. `emerge --sync && emerge -uDavNt --keep-going --with-beeps=y @world` will return the same results as eix. The point of my comment was that it's not portage that's slow or broken, it's a package on the list. The OP should look at the output before blindly running the command... if it breaks he needs to fix the breakage then re execute the command. – eyoung100 Apr 15 '17 at 00:26
  • @eyoung100 No, the slowness is `emerge`, not a broken package. On an otherwise identical system, that `emerge` command will _always_ run slower than the `eix` equivalent, even if you include an `eix-update` pass right before the `eix` command, simply because `emerge` is doing a hell of a lot more work. That's the whole reason `eix` came to be in the first place, `emerge` does way more work than necessary if you just want to search packages, and as a result is slow. – Austin Hemmelgarn Feb 12 '19 at 15:25
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

eyoung100
  • 5,717
  • 21
  • 50
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.

Thawn
  • 992
  • 6
  • 13