Ubuntu – apt-get install not working in script

aptinstallationUbuntu

I create a small script that installs a set of linux paquets .

Strangely apt-get install always fails and tells me that the package have not been found.
Here is my script:

#! /bin/bash
sudo apt-get install python-software-properties
sudo apt-get update
sudo add-apt-repository ppa:pitti/postgresql
sudo apt-get install xfce4 postgresql-9.0 pgadmin3 chromium-browser wine iftop

What can i do to fix this ?

Thanks .

Best Answer

First line of your script. Remove the space.

#!/bin/bash

Also what @Shane said: on a script you may want to use -y to automate the process.

Update
Have you run chmod +x scriptname before trying to run it? Can you please post the exact error you're getting?