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 00000000..19c45988 --- /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 b66b7417..25ba76f3 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 cb522611..9cc266e0 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 292be0d6..8dde3454 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 }}'" } ] }