script -ac "sudo apt-get install"
The -c tells it to execute the command rather than invoking a subshell. The quotes around the command and its arguments insures that is what the -c acts upon.
Similar syntax works for me on RHEL:
script -ac "sudo yum list"
I don't have a system using apt-get but it seems it should work there as well as the purpose of both yum and apt-get is package management for their respective distros.