Skip to content

Check sources.list.d files for check update on Ubuntu #175

@nicolas-morel-claranet

Description

@nicolas-morel-claranet

Hello,

We met an issue on Ubuntu Virtual machine, our configuration set all our repositories to the directory level /etc/sources.list.d .

But the update detection failed with this error:
2023-02-28T08:47:46Z> ERROR:EXCEPTION during patch operation: Exception('Unexpected return code (1) from command: sudo grep security /etc/apt/sources.list > /tmp/az-update-security.list', '')

This command work for us:
root@localhost:/var/lib/waagent# sudo grep -ri security /etc/apt/sources.list.d/ /etc/apt/sources.list.d/XXXXX-distrib.list:## review or updates from the Ubuntu security team. /etc/apt/sources.list.d/XXXXX-distrib.list:## security team. /etc/apt/sources.list.d/XXXXX-distrib.list:## XXXXX Ubuntu jammy - Mirror of Official Security /etc/apt/sources.list.d/XXXXX-distrib.list:deb [arch=amd64] http://XXXXX/ubuntu/ jammy-security main restricted /etc/apt/sources.list.d/XXXXX-distrib.list:deb [arch=amd64] http://XXXXX/ubuntu/ jammy-security universe /etc/apt/sources.list.d/XXXXX-distrib.list:deb [arch=amd64] http://XXXXX/ubuntu/ jammy-security multiverse

Version used: Microsoft.CPlat.Core.LinuxPatchExtension-1.6.42/MsftLinuxPatchCore.py

Can you update the script to check all files in sources.list.d and sources.list
We can use this commande instead:
root@localhost/var/lib/waagent/Microsoft.CPlat.Core.LinuxPatchExtension-1.6.42# sudo grep -Eh '^deb .*security' /etc/apt/sources.list /etc/apt/sources.list.d/*

self.prep_security_sources_list_cmd = 'sudo grep security /etc/apt/sources.list > ' + os.path.normpath(self.security_sources_list)

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions