Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6881259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:05:06+00:00 2026-05-27T05:05:06+00:00

I’m facing a problem from past few months. I have tried hard to find

  • 0

I’m facing a problem from past few months. I have tried hard to find a solution.

I’m using Java over Fedora 14

The problem is, I’m trying to download and install a package using Runtime.exec(“yum -y install somePkg”) but when I use pc.getInputStream() to capture stdout, I don’t get to see the current download progress status i.e. the percentage download in any form. The output sticks at ‘downloading packages:’ until yum has finished downloading. After successful download. I see only a overall installed packages list and donwload complete message in the output console.

I need a solution even if it’s a dirty one. I need to somehow capture the whole download progress of yum using java.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:05:06+00:00Added an answer on May 27, 2026 at 5:05 am

    Directly answering the question, as asked:

    Found in the Yum (/usr/share/yum-cli/output.py) source:

        if self.conf.debuglevel < 2 or not sys.stdout.isatty():
            progressbar = None
            callback = None
        else:
            progressbar = YumTextMeter(fo=sys.stdout)
            callback = CacheProgressCallback()
    

    So, the hacky solution would be to allocate a pty for Yum…

    Unfortunately, it looks like the stock Java libraries don’t provide access to the ptmx interface that Linux uses for allocating PTY’s (although, one could conceivably do so with a JNI binding — the code would not be terribly complex; although a quick Google search didn’t turn up any nice stock libraries to do so, so perhaps there’s something I’m missing, or I would suspect someone should have one lying around by now), so the “easiest” way to do this might be to write a Python wrapper that calls into the Yum internals to do its bidding, and asks for a callback. Either way, not pure Java, but linking to an external Python interpreter (and, since Yum is Python, you know that there must be one installed) might be less hassle than doing JNI linking with some C code. (As an example, you might peek at ProcessTransPackageKitCallback in /usr/share/PackageKit/helpers/yum/yumBackend.py)

    However:

    Alternatively, have you considered using pkcon, or using DBus to talk to PackageKit?

    Using DBus wouldn’t require external libraries, but might require rethinking your installation process a bit. There’s a Java DBus library at http://dbus.freedesktop.org/doc/dbus-java/ that wraps the connection logic, at which point, the examples at http://www.packagekit.org/pk-faq.html#session-methods should give you the gist of accessing it. I believe that the DBus interface provides a way to check on a transaction as it progresses — but I’m not familiar enough with DBus to give a solid statement to that effect. That might be the least “hacky” solution I see; and, as a bonus, it’s portable to Ubuntu, at least (I believe).

    pkcon, however, would be an option. It appears to write progress to stdout in a nice, parseable format, even though it does reduce its output when it’s not a tty:

      $ pkcon update > tmp < /dev/null & tail -f tmp
    Transaction:    Updating packages
    Status:     Waiting for authentication
    Status:     Waiting in queue
    Status:     Starting
    Status:     Resolving dependencies
    Status:     Downloading packages
    Percentage: 10
    Percentage: 40
    Percentage: 50
    Percentage: 70
    

    That’s the actual output, so the granularity isn’t so great, but it looks pretty friendly for parsing.

    I’m afraid I don’t have a Fedora 14 box to compare against — this is on Fedora 15 — so your mileage may vary.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have thousands of HTML files to process using Groovy/Java and I need to
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a text area in my form which accepts all possible characters from
I am currently running into a problem where an element is coming back from
I have a view passing on information from a database: def serve_article(request, id): served_article
I have a bunch of posts stored in text files formatted in yaml/textile (from
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.