For those interested in restoring the update site, here is a way to do the job which may or may not work for you:
- Locate the
${ECLIPSE_HOME}\p2\org.eclipse.equinox.p2.engine\profileRegistry\<profile>\.data\.settings\org.eclipse.equinox.p2.artifact.repository.prefs
file. The <profile>
depends on the installed Eclipse, for me it was epp.package.rcp.profile
.
- Find all keys ending by
/uri=
: they would contains the original URI. You could use grep: grep --color -Po '/uri=.+' org.eclipse.equinox.p2.artifact.repository.prefs
(you may want to filter file:/
URI).
- Remove the
/uri
and unescape the property to regain valid URI: sed
is good for that. eg: sed -E -e 's@^/uri=@@g' -e 's@\\@@g'
- Apply a
sort --unique
Now, you would have this command line and result:
$ grep --color -Po '/uri=http.+' org.eclipse.equinox.p2.artifact.repository.prefs | sed -E -e 's@^/uri=@@g' -e 's@\\@@g' | sort
https://spotbugs.github.io/eclipse/
http://download.eclipse.org/e4/snapshots/org.eclipse.e4.tools/latest/
http://download.eclipse.org/eclipse/updates/4.7
http://download.eclipse.org/eclipse/updates/4.7/R-4.7-201706120950
http://download.eclipse.org/eclipse/updates/4.7/R-4.7.1-201709061700
http://download.eclipse.org/eclipse/updates/4.7/R-4.7.1a-201710090410
http://download.eclipse.org/eclipse/updates/4.7/R-4.7.2-201711300510
http://download.eclipse.org/eclipse/updates/4.7/R-4.7.3-201803010715
http://download.eclipse.org/eclipse/updates/4.7/R-4.7.3a-201803300640
You are almost there!
If you look at the example above, you can see multiple duplicate URI for the same endpoint (/eclipse/updates/4.7
) which is a P2 composite repository: you may add it to the sed command to remove these parts: -e 's@/(R-[^/]+|)20[0-9]{10}@@g'
.
That's better:
$ grep --color -Po '/uri=http.+' org.eclipse.equinox.p2.artifact.repository.prefs | sed -E -e 's@^/uri=@@g' -e 's@\\@@g' -e 's@/(R-[^/]+|)20[0-9]{10}@@g' | sort --unique
http://download.eclipse.org/e4/snapshots/org.eclipse.e4.tools/latest/
http://download.eclipse.org/eclipse/updates/4.7
http://download.eclipse.org/efxclipse/updates-released/3.0.0/site
http://download.eclipse.org/releases/oxygen
http://download.eclipse.org/technology/epp/packages/oxygen/
http://eclipse.pitest.org/release/
http://netceteragroup.github.io/quickrex/updatesite
http://repo1.maven.org/maven2/.m2e/connectors/m2eclipse-tycho/0.8.0/N/0.8.0.201409231215/
http://ucdetector.sourceforge.net/update/
Now we will transform that into a XML file to be imported: in the Available Software Sites, you may export a bookmarks.xml
file which contains this for one entry:
<?xml version="1.0" encoding="UTF-8"?>
<bookmarks>
<site url="http://download.eclipse.org/eclipse/updates/4.7" selected="true" name=""/>
</bookmarks>
As you would probably don't care about the name
or selected
(Eclipse may also update these using the Update site metadata), you may use builtin or sed
again:
$ grep --color -Po '/uri=http.+' org.eclipse.equinox.p2.artifact.repository.prefs.old | \
sed -E -e 's@^/uri=@@g' -e 's@\\@@g' -e 's@/(R-[^/]+|)20[0-9]{10}@@g' | \
sort --unique | \
while read url; do echo "<site url=\"${url}\" />"; done > bookmarks.xml
You now have a bookmarks.xml
to edit: simply add the <?xml version="1.0" encoding="UTF-8"?> <bookmarks>
and </bookmarks>
, and import it in Available Software Suite.
All that remains is to enable all site by selecting them and clicking Enable. When done, try to update Eclipse as usual and that should do the job!
You may want to:
- Remove any invalid entries or at least disable them
- Save your
bookmarks.xml
into a repository or "somewhere".
- Export the
bookmarks.xml
again, now with proper name.
Good luck!
And ... raise this bug report: https://bugs.eclipse.org/bugs/show_bug.cgi?id=502524