The following is what we use, works great as a startup script:
on error resume next
dim WshShell
dim RegKey
dim ScriptVerKey
Set WshShell = CreateObject("WScript.Shell")
'checks to see if registry key exists, if it does, the cleanup runs.
RegKey = "HKLM\SOFTWARE\EDU\Cleanup\"
ScriptVerKey = WshShell.RegRead(RegKey & "JAVAOldVer")
if ScriptVerKey <> "1" Then
Cleanup()
Else
WScript.Quit
End If
Sub Cleanup()
' Uninstall Java 1.4.1.01
WshShell.Run "msiexec /x {1666FA7C-CB5F-11D6-A78C-00B0D079AF64} /q",1,True
' Uninstall Java 1.4.2.04
WshShell.Run "msiexec /x {7148F0A8-6813-11D6-A77B-00B0D0142040} /q",1,True
' Uninstall Java 5.0.2
WshShell.Run "msiexec /x {3248F0A8-6813-11D6-A77B-00B0D0150020} /q",1,True
' Uninstall Java 5.0.4
WshShell.Run "msiexec /x {3248F0A8-6813-11D6-A77B-00B0D0150040} /q",1,True
' Uninstall Java 5.0.5
WshShell.Run "msiexec /x {3248F0A8-6813-11D6-A77B-00B0D0150050} /q",1,True
' Uninstall Java 5.0.6
WshShell.Run "msiexec /x {3248F0A8-6813-11D6-A77B-00B0D0150060} /q",1,True
' Uninstall Java 5.0.7
WshShell.Run "msiexec /x {3248F0A8-6813-11D6-A77B-00B0D0150070} /q",1,True
' Uninstall Java 5.0.10
WshShell.Run "msiexec /x {3248F0A8-6813-11D6-A77B-00B0D0150100} /q",1,True
' Uninstall Java 5.0.11
WshShell.Run "msiexec /x {3248F0A8-6813-11D6-A77B-00B0D0150110} /q",1,True
' Uninstall Java 5.0.12
'WshShell.Run "msiexec /x {3248F0A8-6813-11D6-A77B-00B0D0150120} /q",1,True
' Uninstall Java 6.0.0
WshShell.Run "msiexec /x {3248F0A8-6813-11D6-A77B-00B0D0160000} /q",1,True
' Uninstall Java 6.0.1
WshShell.Run "msiexec /x {3248F0A8-6813-11D6-A77B-00B0D0160010} /q",1,True
' Uninstall Java 6.0.2
WshShell.Run "msiexec /x {3248F0A8-6813-11D6-A77B-00B0D0160020} /q",1,True
' Uninstall Java 6.0.5
WshShell.Run "msiexec /x {3248F0A8-6813-11D6-A77B-00B0D0160050} /q",1,True
' Uninstall Java 6.0.30 (020608)
WshShell.Run "msiexec /x {3248F0A8-6813-11D6-A77B-00B0D0160030} /q",1,True
'regkey below stops the script from running again
WshShell.RegWrite "HKLM\Software\EDU\", "Default"
WshShell.RegWrite "HKLM\Software\EDU\Cleanup\", "Default"
WshShell.RegWrite "HKLM\Software\EDU\Cleanup\JAVAOldVer", 1, "REG_SZ"
End Sub
Your /etc/interfaces
file looks fine, and since you managed to run apt-get update
and apt-get upgrade
successfully, this indicates that your network config is good.
As to why you can't install GNOME, the package is called gnome-desktop-environment
rather than ubuntu-desktop
. You may want to opt for gnome-core
instead, which contains less bloat than the full blown desktop environment would.
If that doesn't work, please could you edit your original question to include the error text from apt-get
.
Edit 1
Since you're getting package not found for everything, check out /etc/apt/sources.list
and check the repositories for universe and multiverse aren't commented out (i.e have a # at the beginning of the line). If they are, remove the # and try again.
Edit 2
For the key error, try the following command sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 16126D3A3E5C1192
. (Source)
Best Answer
Try getting the jvm in .tar.gz format from oracle:
http://www.oracle.com/technetwork/java/javase/downloads/index.html?ssSourceSiteId=otnjp
Get the server JRE or JDK for instance:
Untar it into /opt:
java -> jdk1.7.0_51/
Make a symlink to
/opt/java
Set
JAVA_HOME=/opt/java
Put
/opt/java/bin
somewhere on your path.You should then be able to run
which java
and see it come from/opt/java` and finally
java -version`` should report the version of java you just downloaded.This keeps everything outside of the operating system's package management system and dependencies, which is why ubuntu is trying to load all those extra packages. It also means that you don't have to worry about breaking your java when you update your Ubuntu. You just need to make sure you keep java reasonable upto date yourself.