22

After clicking the Check Update, installing a few updates and clicking OK to restart Eclipse, the list of available software sites in the Install window is gone.

Is it possible to get it as it was?

If not, how can I rebuild it so that my plug-ins will be updated in the future?

I'm working with Eclipse 4.3.2 in Windows 7.

stenci
  • 8,290
  • 14
  • 64
  • 104
  • What is displaying in `Window > Preferences > Install/Update > Available software sites` it is blank or check whether software updates site are disables here. Also go to `Help > Install New Software` in **Work With** text box select **--All Available Sites** and check – Chandrayya G K Apr 30 '14 at 05:40
  • The list is empty in both. I'm downloading Eclipse again to create a fresh installation :( – stenci Apr 30 '14 at 05:43
  • 1
    Try opening eclipse on clean workspace. Check this post http://stackoverflow.com/questions/2030064/how-to-run-eclipse-in-clean-mode-and-what-happens-if-we-do-so – Chandrayya G K Apr 30 '14 at 06:16
  • 2
    Had same issue updating from 4.3 to 4.4. Anything solved it yet? – e-motiv Dec 13 '14 at 17:07
  • 1
    Same issue with Mars 4.5 to 4.5.1... – rdtsc Oct 12 '15 at 11:49
  • Got this issue on Win64 after upgrading from 2018-11 to 2018-12. – Lauris Dec 24 '18 at 08:36

7 Answers7

14

I ran into the same problem on a Win7-64bit after a set of automatic updates. All settings for "Available Software Sites" were lost. My eclipse version after the data lost was luna 4.4.2. (don't now the version number before, I had installed eclipse-cpp-luna-SR1a-win32-x86_64_2014.zip).

I set this site to get the "/Help/Install new software...." Dialog work again:

Eclipse-Project-Repository - http://download.eclipse.org/eclipse/updates/4.4

To get the repository for another eclipse version look here. Follow the link to your eclipse version and search there for the "Eclipse p2 Repository".

Geesz
  • 141
  • 1
  • 4
7

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

NoDataFound
  • 11,381
  • 33
  • 59
2

I ran into the same problem on a Win10-64bit after a set of automatic updates. All settings for "Available Software Sites" were lost. Eclipse p2 Repository
To update your Eclipse installation to this development stream, you can use the software repository at http://download.eclipse.org/eclipse/updates/4.5 . To update your build to use this specific build, you can use the software repository at http://download.eclipse.org/eclipse/updates/4.5/R-4.5.2-201602121500

2

Fixed in Neon

Good new is that the available update sites survive Eclipse update on Neon. But I still see this problem on Mars and older.

Fix for Mars and older releases

There is a simple change which fixed this problem for me on Mars-, it's adding the "-Djava.net.preferIPv4Stack=true" JVM param to Eclipse.ini file before running an update:

-Djava.net.preferIPv4Stack=true

Please note this is a VM argument, so it must go after the "-vmargs"

So why the available software sites were deleted on update?

Eclipse Update is done by ProvisioningJob which calls LoadMetadataRepositoryJob.runModal(), which in its turn calls MetadataRepositoryManager.loadRepository().

AbstractRepositoryManager.loadRepository() checks if a repository is valid by callingcheckNotFound(). If it's not found that the repo is not added. preferIPv4=true fixes it.

Tanya
  • 666
  • 5
  • 11
  • 2
    Is not really fixed in neon and oxygen. Happened to me yesterday on update from neon to oxygen. see also in eclipse bugzilla https://bugs.eclipse.org/bugs/show_bug.cgi?id=502524 – Horst Krause Sep 20 '17 at 08:50
  • still problem. Happened today – Miyagi Apr 18 '18 at 08:58
  • happened to me today. I thought it was my updatesite causing the issue. Seems that is not the case – jantje May 30 '18 at 19:56
1

Had the same problem while updating from 4.19 (2021-03) to 4.20 (2021-06). What worked for me was:

  • Re-Opening the "Help" -> "Install New Software" after the list was lost, this refreshed some of the repositories that went missing.

  • Manually adding the repo URL at "Window" -> "Preferences" -> "Install/Update" -> "Available Software Sites" -> "Add..."

I wanted to update to the last version (at that time) so I added the following URL. Replace that URL with the URL of the version you wish to install or your current version:

URL for 2021-06 repo

  • "Help" -> "Check for updates" again, it should work.
AkuLink1
  • 123
  • 10
0

I encountered this with Eclipse 4.16 (2020-06).

Inspired by @NoDataFound approach, I wrote a Perl script as an all-in-one-solution.

How it works:

  • Check each line of '/p2/org.eclipse.equinox.p2.engine/profileRegistry//.data/.settings/org.eclipse.equinox.p2.artifact.repository.prefs' for 'nickname', 'uri' or 'enabled' of a http[s] repo.
    Store captured property name and value in a hash associated with the repo identifier.

    my $propNameCapture = qr/(nickname(?==.*)|(?:uri|enabled)(?==.+))/;
    my ($repo, $propName) = m{^repositories/(http.+?)/$propNameCapture};
    next if !$repo || !$propName;
    
    my ($propValue) = m{^repositories/http.+?/$propName=(.*)};
    
    # Remove the backslash after http[s] if we have an uri.
    $propValue =~ s/\\// if $propName eq 'uri';
    
    # $repo is used merely to collect props belonging together.
    $SiteFromRepo{$repo}->{$propName} = $propValue;
    
  • Create an array of site properties

    for my $site (values %SiteFromRepo)
    {
        # There are many entries without a nickname.
        # These are not from "Available Software Sites", so skip them.
        next unless exists $site->{nickname};
    
        print("nickname:\t$site->{nickname}\nuri:\t\t$site->{uri}\nenabled:\t$site->{enabled}\n\n");
    
        push(@Sites, $site);
    }
    
  • Write XML file

    open($fh, '>:utf8', $OutFilePath) or die("Could not open file '$OutFilePath' for write, exiting.\n");
    
    $fh->print("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<bookmarks>\n");
    $fh->print("   <site url=\"$_->{uri}\" selected=\"$_->{enabled}\" name=\"$_->{nickname}\"/>\n") for @Sites;
    $fh->print('</bookmarks>');
    
    close($fh);
    

The complete script can be downloaded from my GitHub repo

Christoph
  • 712
  • 1
  • 6
  • 17
-2

Try to run Eclipse as administrator. That way the "check for updates" should work.

JCT
  • 1
  • There is no difference with the admin rights here. This has to do something with the eclipse update itself. – vijayinani Jan 09 '17 at 09:51