5

I'd like to see to what extent my system is LTS-supported by means of what packages are supported for 5 years and which are not. I could disregard some non-5yr-supported packages, as some are rarely used or very unlikely to get into (security) issues.

I think this is useful as one can get a report and draw a conclusion, e.g. "my system is 100% LTS", "due to packages X,Y,Z, my system is just 99% LTS", "due to the use of KDE, my system is now 50% LTS".

As related to my answer in the question Does 12.04 LXDE have LTS?, I posted a way to see which packages of Ubuntu feature five years of support. E.g.:

$ apt-cache show unity | grep ^Supported
Supported: 5y

$ apt-cache show lxde-core | grep ^Supported
<no output>

I could write a script to get all information for all the packages, however, the apt-cache commands are horribly slow:

real    0m1.535s
user    0m1.484s
sys     0m0.036s

With 2700+ packages installed, this would take roughly 70 minutes (!).

How can I speed up things and get a report for all non-5yr-supported packages on my system?

I'd prefer a simple apt-* shell command for the use in a simple shell script. If it would require more advanced scripting like going into Python, this is fine too. Eventually, I would like to release a (small) script to create a report on a system easily and quickly.

Note: I'm not interested in the discussion about whether or not a specific flavour of Ubuntu provides LTS or not - this is really just packages. You can just mix LTS and non-LTS packages on a system.

2 Answers 2

6

I don't know about your system, but this is what I did:

time dpkg -l | grep 'ii' |  awk ' {print $2}' | xargs apt-cache show | grep '^Supported:' | grep -v '5y' | wc -l
158

real        0m27.549s
user        0m5.580s
sys         0m21.701s

doesn't seem so bad right?

The total number of packages:

dpkg -l | grep 'ii' | wc -l
2602

I am running a AMD E-350 which isn't exactly a blazing fast cpu...

Edit: maximum number of arguments to xargs:

xargs --show-limits

...
POSIX upper limit on argument length (this system): 2091826
...
5
  • I think not, see my edit. Jan 7, 2013 at 11:07
  • (removed earlier comment) xargs to get the packages as arguments to apt-cache makes the difference here. Thanks! I'll use a Bash argument limit check in my script just to be sure I won't hit the argument limit for xargs.
    – gertvdijk
    Jan 7, 2013 at 11:09
  • The command excludes XFCE packages on Xubuntu 13.04, and in general it excludes packages that do not have the Supported: field. Does not work for me
    – ignis
    Aug 31, 2013 at 5:51
  • The purpose of this answer was to show that using xargs made the solution given by the OP much faster. If you want to list the individual packages you need a more complex script. Aug 31, 2013 at 20:19
  • @ignis You could use something like this (it's ugly, but does the job I think): dpkg -l | grep 'ii' | awk ' {print $2}' | xargs apt-cache show | grep 'Package:\|Supported:' | awk 'BEGIN{lts=false;p="Non-LTS packages:"} {if ($1 == "Package:"){ if (lts == false){print p}; p=$2 } else if ($0 == "Supported: 5y"){lts=true}} END {if (lts == false) print p}' Aug 31, 2013 at 21:02
4

Here's a quick one-liner to get you the list of packages which are maintained for LESS than the full LTS period of 5 years, using grep-dctrl(1):

sudo apt-get install dctrl-tools
dpkg -l | grep '^ii' |  awk ' {print $2}' | xargs apt-cache show | grep-dctrl -v -FSupported --exact-match -nsPackage 5y | sort | uniq

You can easily modify it to look for different support periods.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .