My Digital ContributionPosts RSS Comments RSS


Latest Release: 2.1.16 on 10/03/2014

Portpeek is still actively maintained and has been adding features and bug fixes.  Feel free to open bugs at if you encounter any issue aat all.


Portpeek is a script for Gentoo users to use to determine if packages the user has in package.keyword or package.unmask have gone stable and can be removed. The script can also remove these unneeded packages automatically. There is an ebuild available from Gentoo’s portage system.

Screen shot:

Latest Release: 1.8.0


Packaged Masked
Portpeek will now handle the tilde in the package.* files.
It will look for a package > the indicated package and remove
the line if a stabled version is detected. Please backup your files
before trying this feature

Portpeek now shows file information where line was found
Source Download Link (script and man page)


Fixed bug when determining if package is masked


Remove the use of deprecated portage python modules.


Packages without atoms (=<>) will not display as stable as this program is intended for managing version specific lines in package.mask and package.keywords

Fixed a bug where commented lines were removed when they matched a package being removed.

This version has the ability to turn off the color output.

30 Responses to “Portpeek”

  1. Hillaryon Jan 19th 2008 at 6:24 am

    You guys do a wonderful job! Keep up the good work!!!s

  2. […] Gentoo Firefox Toolbar […]

  3. […] Gentoo Firefox Toolbar […]

  4. oahongon Aug 30th 2008 at 10:56 am

    Is it possible to support dirs in /etc/portage? (/etc/portage/{package.unmask,package.mask,package.use}/)

  5. adminon Aug 30th 2008 at 11:05 am

    >Is it possible to support dirs in /etc/portage? (/etc/portage

    It does support the dirs, are you seeing a situation where it’s not traversing into the directories?

  6. oahongon Sep 19th 2008 at 10:09 am

    I’m not sure Is it really related to portpeek but all my files in /etc/portage has been deleted.
    I’ll test it again.

  7. oahongon Jan 3rd 2009 at 12:17 pm

    err… Sorry it’s my fault. I manually removed the entire directory by accident.
    Really nice tool, thanks 😉

  8. […] Portpeek ist ein kleines Skript fĂŒr Gentoo-Benutzer, das die package.keywords und die package.unmask von nicht mehr benötigten EintrĂ€gen bereinigt. Es ĂŒberprĂŒft ob die entsprechenden Programme bzw. Versionen mittlerweile als stabil gekennzeichnet sind und entfernt die entsprechenden EintrĂ€ge. […]

  9. Matton Mar 26th 2009 at 5:42 am

    Could you please add ‘~’ to the list of acceptable atom types. It is quite similar to ‘=’.

  10. adminon Mar 26th 2009 at 9:09 am

    Here’s why I don’t think ~ will work.

    Let’s say a user has this:

    Which means he wants every -rX release keyworded for installation.

    So now let’s say kdelibs-4.2.1-r3 goes stable.

    Do we remove his line? What if user wants to stay on top of 4.2.1 releases no matter what so when keyworded kdelibs-4.2.1-r4 comes out, he gets it.

    Please elaborate your thoughts if you think I am completely off base here.

  11. Eitanon Apr 16th 2009 at 8:09 am

    1. Great program, my package.keywords would get really messy without it.
    2. For ~, it would be good to at least have an option – what if all the -r packages are stable and you still have it in package.keywords (the test should be whether there is a currently installed package that would be masked without that line – true, they might use it so it will update when there’s a new -r, but it’s a weird thing to want if one of them is already stable)
    3. Feature request: for folks using package.* sub-directories, could you have it print which file the line in questions is in? Also, have it delete that file if it removes the last line (optional).
    4. Bug report: It doesn’t seem to handle packages with blank keywords – I have a line in package.keywords that says x11-plugins/gkacpi * because the package doesn’t have any keywords, but it gets reported in portpeek -ar.

  12. adminon Apr 17th 2009 at 3:46 pm

    @Eitan – new version (1.7.5) adds filename information

    4. Bug report: It doesn’t seem to handle packages with blank keywords – I have a line in package.keywords that says x11-plugins/gkacpi * because the package doesn’t have any keywords, but it gets reported in portpeek -ar.

    I added x11-plugins/gkacpi * but I don’t see it coming up as a problem. Can you open a bug on bugzilla if this is still a problem?

  13. […] Gentoo Firefox Toolbar […]

  14. Nicoon May 14th 2009 at 2:54 pm

    portpeek is fantastic!

    any chance to get it to cooperate with paludis? the files in /etc/paludis look very much like the original portage equivalents, so i guess it wouldn’t be terribly complicated to port it, but this is just a wild guess.

    anyway, that’d be highly appreciated.

  15. adminon May 14th 2009 at 4:30 pm


    Thanks for the kind words.
    Could you email me your paludis files? I’ve never seen them before and would like to take a look.

    mpagano at

  16. Stefanoon Jun 13th 2009 at 8:17 am

    Hi Mike,

    portpeek is really very useful… Nice work! I hope to see the latest version in stable as soon as possible.

    Just a little request: could you add back the no-color option? I use portpeek in a cron script, and those ANSI codes reduce the readability of the output messages.



  17. adminon Jun 13th 2009 at 8:00 pm


    Thanks for the nice comments.
    Color suppression added to portpeek-1.8.1

  18. McDuckon Aug 17th 2009 at 12:17 pm

    I am missing some functionality. I am using directories which portpeek does not read. It would be a nice feature.

    # pwd && ls -lR
    total 0
    drwxr-xr-x 2 root root 72 Jul 22 08:24 package.keywords
    drwxr-xr-x 2 root root 104 Aug 15 14:43 package.use

    total 4
    -rw-r–r– 1 root root 47 Jul 22 08:39 vlc

    total 8
    -rw-r–r– 1 root root 59 Jul 28 20:50 mediatomb
    -rw-r–r– 1 root root 178 Jul 22 09:57 vlc

  19. Daveon Sep 21st 2009 at 3:16 pm

    I was wondering if you’ve had any progress with paludis support? I could sent you my sample files if you like.

  20. adminon Sep 21st 2009 at 7:11 pm


    I’m sorry. I don’t use paludis.

  21. Solon Oct 14th 2009 at 9:47 am

    It looks like more recent versions of portage have removed the leading slash from USER_CONFIG_PATH. This causes portpeek to fail unless I add the slash manually. I currently have the following version installed:

    [I] sys-apps/portage
    Available versions: ~2.1.7 (~) [M]~2.2_rc33 [M]~2.2_rc41 [M]~2.2_rc42 [M]~2.2_rc44 [M]~2.2_rc45 [M]~2.2_rc46 {build doc epydoc linguas_pl python3 selinux}
    Installed versions: 10/12/09)(python3 -build -doc -epydoc -linguas_pl -selinux)
    Description: Portage is the package management and distribution system for Gentoo

  22. Marcoon Jan 25th 2010 at 1:20 pm

    Nice script. I found it by browsing the app-portage category, but whished such a tool existed for a few months. Thank you!

  23. Stephanon May 6th 2010 at 11:25 am

    If I remember correctly, Paludis includes a utility script functionally equivalent to portpeek… I just can’t remember what it’s called. (I know it’s not reconcilio though. That’s the revdep-rebuild equivalent)

  24. LuĂ­s Ferreiraon Nov 26th 2010 at 6:07 pm

    emerge -av portpeek

    These are the packages that would be merged, in order:

    Calculating dependencies… done!
    [ebuild UD] sys-apps/portage- [] USE=”-build -doc -epydoc -python3 (-selinux) (-ipc%*)” LINGUAS=”-pl” 0 kB
    [ebuild N ] app-portage/portpeek- 0 kB

    Total: 2 packages (1 downgrade, 1 new), Size of downloads: 0 kB

    Would you like to merge these packages? [Yes/No] n


  25. LuĂ­s Ferreiraon Nov 26th 2010 at 6:10 pm

    I’ve portage- installed. Portpeek requires portage-

  26. adminon Nov 29th 2010 at 2:59 pm

    @Luis, dependencies should all be sorted out now.

  27. BattleCoderon Oct 21st 2012 at 7:02 am


    I am using portpeek version 2.0.25, and I am getting the following error (in the bottom of full portpeek log)

    Traceback (most recent call last):
    File “/usr/bin/portpeek”, line 1370, in
    clean_useflagsFile(USER_CONFIG_PATH + “/package.use”)
    File “/usr/bin/portpeek”, line 1020, in clean_useflagsFile
    NameError: global name ‘cleanuseflagsFile’ is not defined

    I think it is kind of erratum in the script. Please, fix it.

  28. sargason Sep 27th 2014 at 11:36 am

    Not sure if this is still checked/maintained, but I wanted to point out an issue: SLOT-ed package atoms break things. For instance, ‘>=kde-base/lokalize-4.13.3:4′ in my one of my package.use files gives:

    Traceback (most recent call last):
    File “/usr/lib/python-exec/python2.7/portpeek”, line 1468, in
    get_recursive_info(USER_CONFIG_PATH + “/package.use”)
    File “/usr/lib/python-exec/python2.7/portpeek”, line 418, in get_recursive_info
    File “/usr/lib/python-exec/python2.7/portpeek”, line 420, in get_recursive_info
    File “/usr/lib/python-exec/python2.7/portpeek”, line 446, in get_info
    diffs_found = parse_package_use(line,filename)
    File “/usr/lib/python-exec/python2.7/portpeek”, line 538, in parse_package_use
    if (pkgcmp(pkgsplit(check_pkg),pkgsplit(str(current_package.cpv))) == 0) or (pkgcmp(pkgsplit(check_pkg),pkgsplit(str(current_package.cpv))) == 2):
    File “/usr/lib64/python2.7/site-packages/portage/”, line 292, in pkgcmp
    if pkg1[0] != pkg2[0]:
    TypeError: ‘NoneType’ object has no attribute ‘__getitem__’

  29. adminon Oct 3rd 2014 at 8:32 pm

    This should be fixed in 2.1.16. Please let me know if you still have issues.

  30. BattleCoderon Oct 31st 2014 at 2:16 pm


    Python-3.4 is unmasked in stable portage branch.
    Could you please add USE=”python3_4″ to this package?

    Thank you.

Leave a Reply