1

I don't know what packages i have installed that i no longer can get and install packages in terminal. e.g. when trying to install Prozgui, i got this error:

Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 60, in <module>
    sp = SoftwareProperties()   
  File "/usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py", line 90, in __init__
    self.reload_sourceslist()
  File "/usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py", line 538, in reload_sourceslist
    self.distro.get_sources(self.sourceslist)    
  File "/usr/lib/python2.7/dist-packages/aptsources/distro.py", line 91, in get_sources
    raise NoDistroTemplateException("Error: could not find a "
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template

and it happens for all others too.

Plus, my Software Center has been disabled and doesn't start. I get this error for that too:

Traceback (most recent call last):
  File "/usr/bin/software-center", line 111, in <module>
    from softwarecenter.app import SoftwareCenterApp
  File "/usr/share/software-center/softwarecenter/app.py", line 40, in <module>
    from softwarecenter.db.application import Application, DebFileApplication
  File "/usr/share/software-center/softwarecenter/db/application.py", line 30, in <module>
    from softwarecenter.distro import get_distro
  File "/usr/share/software-center/softwarecenter/distro/__init__.py", line 151, in <module>
    distro_instance=_get_distro()
  File "/usr/share/software-center/softwarecenter/distro/__init__.py", line 140, in _get_distro
    module =  __import__(distro_id, globals(), locals(), [], -1)
ImportError: No module named OPTIMOS

Can anyone please help me with this? Thank you in advance!

2
  • Which ubuntu version do you use? Jul 4, 2012 at 13:25
  • What happens when you run sudo apt-get install -f ?
    – Sepero
    Jul 5, 2012 at 2:55

1 Answer 1

0

If you have Ubuntu 12.04 (not xubuntu/kubuntu/lubuntu), try these commands:

sudo apt-get update
sudo apt-get install ubuntu-desktop ubuntu-minimal ubuntu-standard

..and reboot the pc.

These three packages are called "meta-packages", "groups" of other packages required and preinstalled on a default ubuntu desktop installation.

Hopefully it will reinstall the required packages. If it doesn't, try this:

sudo dpkg -P --force-all ubuntu-desktop ubuntu-minimal ubuntu-standard
sudo apt-get install ubuntu-desktop ubuntu-minimal ubuntu-standard

..and reboot the pc again.

Update

After searching the internet a bit, I discovered that this problem might arise if you are missing the file /etc/lsb-release. Test this by executing: cat /etc/lsb-release -- it should show the contents of the file. This file must pre-exist for a lot of packages.

You can recreate that file manually:

gksu gedit /etc/lsb-release

..and enter this text:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=11.04
DISTRIB_CODENAME=natty
DISTRIB_DESCRIPTION="Ubuntu 11.04"

Save and exit.

You could now try and reinstall the configuration and the base-files package. We'll reinstall all the affected packages just in case:

sudo apt-get -o Dpkg::Options::="--force-confnew" --reinstall install base-files python-apt python-software-properties software-properties-gtk software-center
sudo apt-get update
sudo apt-get -f install
sudo apt-get dist-upgrade

(Please save and post the output of this command, it's required to see what happens)

Then try to see if the file exists:

cat /etc/lsb-release

It should show the release information. Try opening software-properties-gtk or software-center

4
  • actually i'm on ubuntu 11.04. ia tried both, it didn't work for me. Jul 4, 2012 at 13:31
  • I would format and install again, but ubuntu 12.04: wiki.ubuntu.com/Releases -- 11.04 will reach "end of life" date in October. Jul 4, 2012 at 19:34
  • thanks, but i've downloaded a huge package of deb files, would it be possible to archive them or do something to restore them on the new ubuntu? Jul 5, 2012 at 7:19
  • Let's try to fix the issue, I have another suggestion, see "Update" above. Jul 5, 2012 at 8:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .