Short after upgrade, Synaptic failed to open but apt-get still works

Bug #842179 reported by Tony Janssen
This bug report is a duplicate of:  Bug #880003: Synaptic displays "An error occurred". Edit Remove
32
This bug affects 7 people
Affects Status Importance Assigned to Milestone
synaptic (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Following screen pops up when opening synaptics (sudo) : application will close when confirming dialog box

E: The value 'natty-proposed' is invalid for APT::Default-Release as such a release is not available in the sources
E: _cache->open() failed, please report.

Where can natty-proposed be disabled as default release, tried purging several locations in older posts without success.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: synaptic 0.75.2ubuntu6
ProcVersionSignature: Ubuntu 3.0.0-10.16-generic 3.0.4
Uname: Linux 3.0.0-10-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
Date: Mon Sep 5 23:52:54 2011
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
ProcEnviron:
 SHELL=/bin/bash
 PATH=(custom, no user)
 LANG=fr_BE.UTF-8
SourcePackage: synaptic
UpgradeStatus: Upgraded to oneiric on 2011-09-02 (3 days ago)

Revision history for this message
Tony Janssen (janssen-tony-deactivatedaccount) wrote :
Changed in synaptic (Ubuntu):
status: New → Confirmed
Revision history for this message
3t0g0 (freetogo) wrote :

By adding the dummy "natty" repo back into sources.list shall fix the problem temporarily

[yohjiubuntu-tv:~]$ cat /etc/apt/sources.list
deb http://tw.archive.ubuntu.com/ubuntu natty main universe restricted multiverse

Revision history for this message
Adam Delman (flyn-flyn) wrote :

I think this is related to the setting of "Prefer versions from" under Settings->Preferences->Distribution.
Might be worth it to run strace on Synaptic to see where it's reading the setting from.

Revision history for this message
Adam Delman (flyn-flyn) wrote :

I've traced this issue to a value in /root/.synaptic/synaptic.conf :

Synaptic "" {
  ViewMode "3";
  showWelcomeDialog "0";
  LastSearchType "1";
  closeZvt "true";
  vpanedPos "214";
  hpanedPos "152";
  windowWidth "1280";
  windowHeight "947";
  windowX "0";
  windowY "30";
  ToolbarState "2";
  Maximized "1";
  Install-Recommends "1";
  AskForUpdateAfterSrcChange "0";
  update "" {
    last "1316901731";
    type "0";
  };

  ShowAllPkgInfoInMain "true";
  AskRelated "true";
  OneClickOnStatusActions "false";
  delAction "3";
  upgradeType "1";
  undoStackSize "20";
  UseTerminal "false";
  AskQuitOnProceed "false";
  useUserFont "0";
  useUserTerminalFont "0";
  statusColumnPos "0";
  statusColumnVisible "1";
  supportedColumnPos "1";
  supportedColumnVisible "1";
  nameColumnPos "2";
  nameColumnVisible "1";
  sectionColumnPos "3";
  sectionColumnVisible "0";
  componentColumnPos "4";
  componentColumnVisible "0";
  instVerColumnPos "5";
  instVerColumnVisible "1";
  availVerColumnPos "6";
  availVerColumnVisible "1";
  instSizeColumnPos "7";
  instSizeColumnVisible "1";
  downloadSizeColumnPos "8";
  downloadSizeColumnVisible "0";
  descrColumnPos "9";
  descrColumnVisible "1";
  color-install "#8A8AE2E23434";
  color-reinstall "#4E4E9A9A0606";
  color-upgrade "#FCFCE9E94F4F";
  color-downgrade "#ADAD7F7FA8A8";
  color-remove "#EFEF29292929";
  color-purge "#A4A400000000";
  color-available "";
  color-available-locked "#A4A400000000";
  color-installed-updated "";
  color-installed-outdated "";
  color-installed-locked "#A4A400000000";
  color-broken "";
  color-new "";
  UseStatusColors "true";
  CleanCache "false";
  AutoCleanCache "true";
  delHistory "-1";
  useProxy "0";
  httpProxy "";
  httpProxyPort "3128";
  ftpProxy "";
  ftpProxyPort "3128";
  noProxy "";
  DefaultDistro "maverick";
};

The bit with DefaultDistro "maverick"; was causing this issue for me.
For a quick one line solution you can run the following command:

release=`lsb_release -a 2>1| grep Codename| awk '{print $2}'`;for file in /root/.synaptic/synaptic.conf $HOME/.synaptic/synaptic.conf ; do sudo sed -i "s/DefaultDistro \".*;/DefaultDistro \"$release\";/g" $file; done;

Revision history for this message
Jan Kronborg (magic75) wrote :

I have tried both solutions suggested and I still get this error.
synaptic.conf did not even have a DefaultDistro entry, but adding a DefaultDistro "oneiric" did not help
Also tried creating /etc/apt/apt.conf with a APT::Default-Release entry, and that did not help either.

Where does synaptic/apt read this from???

Revision history for this message
Mike Judkins (crazy-mike79) wrote :

I replaced the natty with oneiric logged out/in and synaptic works fine now...thanx

Revision history for this message
ketsa (ketsa-0) wrote :

Same problem here after a squeeze --> wheezy upgrade :

I get :
E: The value 'squeeze-backports' is invalid for APT::Default-Release as such a release is not available in the sources
E: _cache->open() failed, please report.
When trying to open synaptic, it then closes.

I have no apt.conf, no /root/.synaptic folder and here is my /etc/apt/sources.list :

deb http://mirror.switch.ch/ftp/mirror/debian/ wheezy main contrib non-free
deb-src http://mirror.switch.ch/ftp/mirror/debian/ wheezy main contrib non-free

Revision history for this message
Robert Roth (evfool) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. This particular bug has already been reported and is a duplicate of bug #880003, so it is being marked as such. Please look at the other bug report to see if there is any missing information that you can provide, or to see if there is a workaround for the bug. Additionally, any further discussion regarding the bug should occur in the other report. Feel free to continue to report any other bugs you may find.
---
Ubuntu Bug Squad volunteer triager
http://wiki.ubuntu.com/BugSquad

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.