1

Everybody knows that to check if there are newer versions of software available, we need to do apt-get update.

but in order to reduce bandwidth, I only want to check if there is an updated version of a specific package. How to achieve this? notice that I don't want to install the newer version, just retrieve information about the newer package.

(Please focus on the feasibility of this task rather than the sanity of it..)

Zanna
  • 72,312
Sajuuk
  • 252

1 Answers1

1

I believe that apt-get update cannot do this.

However, you can use the Launchpad API to retrieve the current version of the package.

From https://help.launchpad.net/API/Examples:

Listing the current package versions in a particular distroseries (Python)

from launchpadlib.launchpad import Launchpad

launchpad = Launchpad.login_with('hello-world', 'production')
ubuntu = launchpad.distributions["ubuntu"]
archive = ubuntu.main_archive
series = ubuntu.current_series
archive.getPublishedSources(exact_match=True, source_name="apport", distro_series=series)[0].source_package_version
### ==> should return u'0.123'

I'm sure you can do the same with curl if you prefer.

Related Question: Does packages.ubuntu.com provide a search API?

pLumo
  • 27,991