2

I am using ubuntu 12 i am unable to install software from unix or from linux i am getting following error

reiki@reiki ~ $ sudo apt-get install preload
[sudo] password for reiki: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  preload
0 upgraded, 1 newly installed, 0 to remove and 21 not upgraded.
1 not fully installed or removed.
Need to get 35.6 kB of archives.
After this operation, 138 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ quantal/universe preload i386 0.6.4-2 [35.6 kB]
Fetched 35.6 kB in 1s (34.8 kB/s)
Selecting previously unselected package preload.
(Reading database ... 262032 files and directories currently installed.)
Unpacking preload (from .../preload_0.6.4-2_i386.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
ureadahead will be reprofiled on next reboot
Setting up opera (12.15.1748-1linuxmint) ...
ERROR:root:DebFileApplication import
Traceback (most recent call last):
  File "/usr/share/software-center/softwarecenter/db/__init__.py", line 4, in <module>
    from debfile import DebFileApplication, DebFileOpenError
  File "/usr/share/software-center/softwarecenter/db/debfile.py", line 25, in <module>
    from softwarecenter.db.application import Application, AppDetails
  File "/usr/share/software-center/softwarecenter/db/application.py", line 27, in <module>
    import softwarecenter.distro
  File "/usr/share/software-center/softwarecenter/distro/__init__.py", line 197, in <module>
    distro_instance = _get_distro()
  File "/usr/share/software-center/softwarecenter/distro/__init__.py", line 172, in _get_distro
    module = __import__(distro_module_name, globals(), locals(), [], -1)
ImportError: No module named linuxmint
Traceback (most recent call last):
  File "/usr/sbin/update-software-center", line 38, in <module>
    from softwarecenter.db.update import rebuild_database
  File "/usr/share/software-center/softwarecenter/db/update.py", line 33, in <module>
    from softwarecenter.backend.scagent import SoftwareCenterAgent
  File "/usr/share/software-center/softwarecenter/backend/scagent.py", line 28, in <module>
    from softwarecenter.distro import get_distro, get_current_arch
  File "/usr/share/software-center/softwarecenter/distro/__init__.py", line 197, in <module>
    distro_instance = _get_distro()
  File "/usr/share/software-center/softwarecenter/distro/__init__.py", line 172, in _get_distro
    module = __import__(distro_module_name, globals(), locals(), [], -1)
ImportError: No module named linuxmint
dpkg: error processing opera (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up preload (0.6.4-2) ...
 * Starting Adaptive readahead daemon preload                            [ OK ] 
Processing triggers for menu ...
Processing triggers for ureadahead ...
Errors were encountered while processing:
 opera
E: Sub-process /usr/bin/dpkg returned an error code (1)
reiki@reiki ~ $ 

When i try to remove opera then i got following error

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  opera
0 upgraded, 0 newly installed, 1 to remove and 21 not upgraded.
1 not fully installed or removed.
After this operation, 45.0 MB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 261623 files and directories currently installed.)
Removing opera ...
ERROR:root:DebFileApplication import
Traceback (most recent call last):
  File "/usr/share/software-center/softwarecenter/db/__init__.py", line 4, in <module>
    from debfile import DebFileApplication, DebFileOpenError
  File "/usr/share/software-center/softwarecenter/db/debfile.py", line 25, in <module>
    from softwarecenter.db.application import Application, AppDetails
  File "/usr/share/software-center/softwarecenter/db/application.py", line 27, in <module>
    import softwarecenter.distro
  File "/usr/share/software-center/softwarecenter/distro/__init__.py", line 197, in <module>
    distro_instance = _get_distro()
  File "/usr/share/software-center/softwarecenter/distro/__init__.py", line 172, in _get_distro
    module = __import__(distro_module_name, globals(), locals(), [], -1)
ImportError: No module named linuxmint
Traceback (most recent call last):
  File "/usr/sbin/update-software-center", line 38, in <module>
    from softwarecenter.db.update import rebuild_database
  File "/usr/share/software-center/softwarecenter/db/update.py", line 33, in <module>
    from softwarecenter.backend.scagent import SoftwareCenterAgent
  File "/usr/share/software-center/softwarecenter/backend/scagent.py", line 28, in <module>
    from softwarecenter.distro import get_distro, get_current_arch
  File "/usr/share/software-center/softwarecenter/distro/__init__.py", line 197, in <module>
    distro_instance = _get_distro()
  File "/usr/share/software-center/softwarecenter/distro/__init__.py", line 172, in _get_distro
    module = __import__(distro_module_name, globals(), locals(), [], -1)
ImportError: No module named linuxmint
dpkg: error processing opera (--remove):
 subprocess installed post-removal script returned error exit status 1
No apport report written because MaxReports is reached already
                                                              Processing triggers for menu ...
Errors were encountered while processing:
 opera
E: Sub-process /usr/bin/dpkg returned an error code (1)

now i am unable to remove opera

3
  • What is it that you're trying to install? Are using Mint? Are you trying to install opera fro mint?
    – Mitch
    May 4, 2013 at 9:36
  • Actually i have installed opera and i am tring to install software from preload May 4, 2013 at 9:49
  • i have got this same issue when i install any software May 4, 2013 at 9:49

2 Answers 2

5

This is not really nice solution but should work in similar cases

sudo /bin/rm /var/lib/dpkg/info/opera*.postrm
sudo dpkg -P opera

Your problem is that post remove script from package doesn't work so this is why uninstall failed. If removing postrm script won't work, try to put empty bash script into this file and do package uninstall again.

1

I found some information on this page that may help you with your problem.

The way it seems, you cannot remove opera through the terminal alone. It seems you may have to manually edit the status file within the /var/lib/dpkg directory.

So the first thing to do before trying out the next steps is to back up the file called status, like this.

Change directories to dpkg:

cd /var/lib/dpkg

List the files to make sure the status file is within that directory by typing ls. If you see a file called status, make a backup copy (I usually add "_bak" at the end of the file I want to backup) just for safety precautions. Now type in your terminal:

mv status status_bak

You can use vim, gedit or nano to open the status file. I prefer gedit myself, but everyone has their own preferences.

Now to edit the status file type the following in your terminal:

sudo gedit /var/lib/dpkg/status

A page should pop up showing different packages and information about each package.

Next Locate the opera package within the list of packages and delete the whole block of information pertaining to opera then click on save.

Now type the following in your terminal:

sudo apt-get update

Then type:

sudo apt-get upgrade

See if you get any error messages after this. If not try to install the software you were originally trying to install.

1
  • Hello and welcome to Ask Ubuntu. It would be better if you could provide a more detailed description of the solution and then providing the link for reference and attribution purposes. That way if the link becomes unavailable for some reason, your answer will still be helpful. Please edit your answer to make it so.
    – hmayag
    Jun 13, 2014 at 7:56

You must log in to answer this question.

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