I am getting this error message, please help me.

Arduino: 1.6.5 (Linux), Board: "Arduino/Genuino Uno"

Build options changed, rebuilding all
Cannot run program "/home/udooer/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.3-arduino2/bin/avr-g++" (in directory "."): error=2, No such file or directory

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.

Here is the Code:
int pirPin = 7;

int minSecsBetweenEmails = 60; // 1 min

long lastSend = -minSecsBetweenEmails * 1000l;

void setup()
{
pinMode(pirPin, INPUT);
Serial.begin(9600);
}

void loop()
{
long now = millis();
if (digitalRead(pirPin) == HIGH)
{
if (now > (lastSend + minSecsBetweenEmails * 1000l))
{
Serial.println("MOVEMENT");
lastSend = now;
}
else
{
Serial.println("Too soon");
}
}
delay(500);
}

It is working in windows but not on Linux (ubuntu)

I would try to remove and reinstall Arduino. It appears to have lost some files or maybe didn't install properly for some reason.

Download and install the latest IDE.