diff --git a/src/helperscripts/n2-helper.py b/src/helperscripts/n2-helper.py index 39bd8842..5ad0514b 100644 --- a/src/helperscripts/n2-helper.py +++ b/src/helperscripts/n2-helper.py @@ -331,7 +331,7 @@ def install_neuron_driver(self, args): if args.mode != 'compile': # if args.ami != 'dlami-base': - install = 'install' if args.install_type == 'install' else 'update' + install = 'install' if args.install_type == 'install' else 'upgrade' str += f'\n# {install} Neuron Driver\n' if args.os == 'ubuntu18' or args.os == 'ubuntu20' or args.os == 'ubuntu22': @@ -347,7 +347,10 @@ def install_neuron_driver(self, args): 'pin_major'].values[0] == 'true': version = '=' + self.get_package_version(category='driver', name=driver_package, neuron_version=args.neuron_version) - str += f'sudo apt-get {install} {driver_package}{version}* -y\n' + str += f'sudo apt-get {install} {driver_package}{version}* -y' + if args.install_type == 'update': + str += ' --allow-change-held-packages' + str += '\n' elif args.os == 'amazonlinux2': yum_install = 'install' if args.install_type == 'install' else 'update' @@ -403,10 +406,16 @@ def install_neuron_runtime(self, args): if args.neuron_version == None: if self.df_package_properties.loc[self.df_package_properties['name'] == runtime_package][ 'pin_major'].values[0] == 'true': - str += '=' + self.get_major_version(runtime_package, args.instance) + '.* -y\n' + str += '=' + self.get_major_version(runtime_package, args.instance) + '.* -y' + if args.install_type == 'update': + str += ' --allow-change-held-packages' + str += '\n' elif (args.neuron_version != None) & (args.install_type == 'install'): str += '=' + self.get_package_version(category='runtime', name=runtime_package, - neuron_version=args.neuron_version) + '* -y\n' + neuron_version=args.neuron_version) + '* -y' + if args.install_type == 'update': + str += ' --allow-change-held-packages' + str += '\n' else: str += '\n' @@ -467,7 +476,10 @@ def install_neuron_system_tools(self, args): if args.neuron_version == None: if self.df_package_properties.loc[self.df_package_properties['name'] == system_tool][ 'pin_major'].values[0] == 'true': - str += '=' + self.get_major_version(system_tool, args.instance) + '.* -y\n' + str += '=' + self.get_major_version(system_tool, args.instance) + '.* -y' + if args.install_type == 'update': + str += ' --allow-change-held-packages' + str += '\n' elif (args.neuron_version != None) & (args.install_type == 'install'): str += '=' + self.get_package_version(category='system-tools', name=system_tool,