How to prevent script not to stop after apt-get?

Posted by Eonil on Ask Ubuntu See other posts from Ask Ubuntu or by Eonil
Published on 2013-11-08T03:59:10Z Indexed on 2013/11/08 4:19 UTC
Read the original article Hit count: 195

Filed under:
|
|
|

I keep some bash snippets and copy&paste them when I needed for management. But I discovered apt-get cancels script execution. Here's my script where problematic.

apt-get -y install gcc g++ make cmake perl

cd ~/
mkdir t1
cd t1

I copy & paste this script on OS X Terminal to Ubuntu 12.04 LTS server (fresh install on VM) Script always stop after apt-get finished.

I run this command with root account like this.

ssh user1@server

<password…>

sudo su

<password…>

apt-get -y install gcc g++ make cmake perl

cd ~/
mkdir t1
cd t1

Can this be a problem? Or why my script stops after apt-get finished, and how to make it to continue?

© Ask Ubuntu or respective owner

Related posts about command-line

Related posts about apt