diff --git a/images/linux/scripts/base/apt-mock-remove.sh b/images/linux/scripts/base/apt-mock-remove.sh new file mode 100644 index 000000000..19c459887 --- /dev/null +++ b/images/linux/scripts/base/apt-mock-remove.sh @@ -0,0 +1,7 @@ +#!/bin/bash -e + +prefix=/usr/local/bin + +for tool in apt apt-get apt-fast;do + rm $prefix/$tool +done diff --git a/images/linux/ubuntu1604.json b/images/linux/ubuntu1604.json index b66b74177..25ba76f32 100644 --- a/images/linux/ubuntu1604.json +++ b/images/linux/ubuntu1604.json @@ -355,6 +355,11 @@ "/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync" ], "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" + }, + { + "type": "shell", + "script": "{{template_dir}}/scripts/base/apt-mock-remove.sh", + "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" } ] } diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index cb5226112..9cc266e0b 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -359,6 +359,11 @@ "/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync" ], "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" + }, + { + "type": "shell", + "script": "{{template_dir}}/scripts/base/apt-mock-remove.sh", + "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" } ] } diff --git a/images/linux/ubuntu2004.json b/images/linux/ubuntu2004.json index 292be0d62..8dde3454a 100644 --- a/images/linux/ubuntu2004.json +++ b/images/linux/ubuntu2004.json @@ -361,6 +361,11 @@ "/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync" ], "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" + }, + { + "type": "shell", + "script": "{{template_dir}}/scripts/base/apt-mock-remove.sh", + "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" } ] }