Question: While installing `oracle-java7-installer` via `ppa:webupd8team/java` repository, I see the following error:

```
dpkg: error processing /var/cache/apt/archives/oracle-java7-installer_7u25-0~webupd8~1_all.deb (--unpack):
 trying to overwrite '/usr/share/applications/JB-java.desktop', which is also in package oracle-java6-installer 6u37-0~eugenesan~precise1
Errors were encountered while processing:
 /var/cache/apt/archives/oracle-java7-installer_7u25-0~webupd8~1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

```

Do I need to delete the file `/usr/share/applications/JB-java.desktop` manually to make this installation work?

Answer: 
```
$url = 'http://www.example.com/example.jpg)';
print_r(get_headers($url));

```

It will give an array. Now you can check the response to see if image exists or not
**Fastest & efficient Solution for broken or not found images link**   

i recommend you that don't use getimagesize() because it will 1st download image then it will check images size+if this will not image then it will throw exception so use below code 

```
if(checkRemoteFile($imgurl))
{
//found url, its mean
echo "this is image";
}

function checkRemoteFile($url)
{
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,$url);
    // don't download content
    curl_setopt($ch, CURLOPT_NOBODY, 1);
    curl_setopt($ch, CURLOPT_FAILONERROR, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    if(curl_exec($ch)!==FALSE)
    {
        return true;
    }
    else
    {
        return false;
    }
}

```

**Note:**
this current code help you to identify broken or not found url image this will not help you to identify image type or headers