[pve-devel] [PATCH manager 3/9] report: add list of upgradable packages

Alexander Zeidler a.zeidler at proxmox.com
Thu Apr 11 19:08:56 CEST 2024


On Mon, 2024-03-25 at 09:02 +0100, Thomas Lamprecht wrote:
> On 22/03/2024 14:59, Alexander Zeidler wrote:
> > * to easily see if APT already knows about old packages in use and
> >   their exact version
> > * to reconsider asking for applying updates as a first recommendation
> >   if the list is empty and no updates have been released very recently
> > 
> >  # apt list --upgradable ...
> >  Listing...
> >  pve-manager  testing  8.1.6  amd64  [upgradable  from:  8.1.4]
> > 
> > Signed-off-by: Alexander Zeidler <a.zeidler at proxmox.com>
> > ---
> >  PVE/Report.pm | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/PVE/Report.pm b/PVE/Report.pm
> > index 6014f13e..ad5c2aa0 100644
> > --- a/PVE/Report.pm
> > +++ b/PVE/Report.pm
> > @@ -36,6 +36,7 @@ my $init_report_cmds = sub {
> >  		'cat /etc/hosts',
> >  		'pvesubscription get',
> >  		'cat /etc/pve/jobs.cfg',
> > +		'apt list --upgradable 2>/dev/null | sed "s/\//\t/g" | column -tL',
> 
> this can easily add a few 100s KiB of text to the report on major upgrades,
> this is just to verbose for an initial report.
> I'd rather add just the count of available upgrades, i.e. lie `apt update`
> does, which allows you to draw similar conclusions without bloating the
> report to unwieldy sizes.
> 
> Maybe we could even add that info to the pveversion --verbose output,
> as then it'd be already included here and also help on other channels
> like the forum. 

Good points. I plan to include it into pveversion --verbose at the end like this:

```
# pveversion -v
proxmox-ve: 8.1.0 (running kernel: 6.5.13-5-pve)
pve-manager: 8.1.6 (running version: 8.1.6/b7e8e914a1db70cc) [available: 8.1.10]
...
vncterm: 1.8.0
zfsutils-linux: 2.2.3-pve1 [available: 2.2.3-pve2]

Number of upgradable packages: 25
```

Separated by a new line since it is not an expected <package>: <version> line.

Rather placed at the end because, for example, there are sometimes users
who unfortunately only attach a screenshot or copy the last visible lines.

Furthermore, it hints the user to update the system before posting this
information. But if doing so without instruction and if thereby the issue
gets not solved, it might also be bad since it changes the system setup
and previously reported observations/behavior might not be correct any more.


As seen in the example output above, it would be helpful if we append
upgradable package lines with their newest available version.

> 
> >  		'cat /etc/apt/sources.list',
> >  		sub { dir2text('/etc/apt/sources.list.d/', '.+\.list') },
> >  		sub { dir2text('/etc/apt/sources.list.d/', '.+\.sources') },
> 





More information about the pve-devel mailing list