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);

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

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.