Tuesday, June 22, 2010

HOWTO: Use Ubuntu Software Center in Mint 9

There are a few reasons why I use Linux Mint instead of Ubuntu on my systems. That being said one of the reasons I do not list for using Mint over Ubuntu is their "Software Manager". The software manager in Mint 8 was flat out sad compared to the Ubuntu Software Center that Ubuntu 9.10 included. Now even though the software manager in Mint 9 has many improvements, it still has issues, and I don't think it is quiet on-par with the updated Software Center Ubuntu 10.04 includes.

Now I still like Mint and a poor software center is not enough to make me to stop using the distro as a whole. As such, a quick fix to the issue is to remove Mint Install and apt-get the Ubuntu Software Center. Now this works fine in Mint 8, but after installing the Ubuntu Software Center in Mint 9 I was greeted by a lovely terminal out when the application failed to load:

jeff@jubuntu ~ $ software-center
Traceback (most recent call last):
File "/usr/bin/software-center", line 78, in
from softwarecenter.app import SoftwareCenterApp
File "/usr/share/software-center/softwarecenter/app.py", line 42, in
from view.viewswitcher import ViewSwitcher, ViewSwitcherList
File "/usr/share/software-center/softwarecenter/view/viewswitcher.py", line 34, in
from softwarecenter.backend.channel import SoftwareChannel
File "/usr/share/software-center/softwarecenter/backend/channel.py", line 22, in
from softwarecenter.distro import get_distro
File "/usr/share/software-center/softwarecenter/distro/__init__.py", line 88, in
distro_instance=_get_distro()
File "/usr/share/software-center/softwarecenter/distro/__init__.py", line 77, in _get_distro
module = __import__(distro_id, globals(), locals(), [], -1)
ImportError: No module named LinuxMint


After having a thread go nowhere useful for a day and a half on the Mint forums, I decided to put my python background to use and try to resolve the issue myself. The following steps are what I have done to resolve the issue.

Open a terminal and run the following in order:

sudo apt-get install software-center
wget http://www.tophattwaffle.com/wp-content/files/jeff/custom__init__
sudo rm /usr/share/software-center/softwarecenter/distro/__init__.py
sudo mv custom__init__ /usr/share/software-center/softwarecenter/distro/__init__.py

And you are all set! Run software-center and it should pop right up for you.

Now, if you are like myself and want the Ubuntu Software Center to run instead of the Mint Software Manager when you click "Software Manager" on your Mint Menu run the following in terminal:

sudo apt-get purge mintinstall
sudo ln -s /usr/bin/software-center /usr/bin/mintinstall

Now in case you are curious (or don't trust me) the edit I made to the __init__.py file you are downloading is made on line 72 in the _get_distro function. By default this line reads:

distro_id = subprocess.Popen(["lsb_release","-i","-s"], stdout=subprocess.PIPE).communicate()[0].strip()

My updated line simply manually sets our distro_id to be Ubuntu.

distro_id = "Ubuntu"

Hackish, but it works :) Isn't it fantastic when you have the source code for a piece of software so people can create fixes such as this?

Have any input on the subject or an issue with the HOWTO drop a comment below.

~Jeff Hoogland

37 comments:

  1. Thank you very much for this, you made my day

    ReplyDelete
  2. Maybe I'm missing something.. I really like the Mint Software Manager in Isadora and thought that the Mint Tools (software center, updater, backup, menu) were part of the reason to use Mint over Ubuntu in the first place. :]

    ReplyDelete
  3. @Dima They are, but Mint Install is buggy and lacks features compared to the Ubuntu Software Center. Plus it does not look nearly as nice GUI wise.

    ReplyDelete
  4. thx for this tips:D

    ReplyDelete
  5. thank you enormously! one reason to use ubuntu's over mint's: mint's software manager has almost no music production apps listed. strangely, if you search a specific program it will often show up even tho it's not listed. without ubuntu's manager I can't browse the programs; I had to do so many google searches looking for decent programs. thank you!

    ReplyDelete
  6. Fricken awesome. Very much appreciated. Being only a level 3 Linux user I don't know that I'd have ever figured this out on my own.

    ReplyDelete
  7. Maybe it's just me but this no longer worked for me it now came up with the same error except instead of it saying LinuxMint it said Ubuntu.

    But thanks to nicopozo on the Linux Mint forums he gave a working solution for me, this is considering the original file is still in place and not the fix you provided:

    "Try this:

    * sudo gedit /etc/lsb-release
    * change the line "DISTRIB_ID=LinuxMint" for "DISTRIB_ID=Ubuntu"
    * Save the changes.
    "

    ReplyDelete
  8. @Ubuntuarmy If you are getting that message it means that you did not place my file in the correct place.

    I would be bear to make the change you did as other parts of the Linux Mint system may rely on the distro id of LinuxMint. The fix I provide simply hard sets the distro id for just the Software Center - meaning it will not affect any other applications.

    Also this was tested on Mint 9 - the most current version as of today.

    ReplyDelete
  9. Thanks alot for this fix! :-)

    Really helpfull...!

    ReplyDelete
  10. Thanks a lot! Ubuntu Software Center is far superior to the Mint Software Manager in terms of user friendliness. The whole purpose of a software center is to make it easier to "find" applications, which USC does very well. I find Mint software manager almost equivalent to synaptic.

    ReplyDelete
  11. Thank you kind sir.. =)

    ReplyDelete
  12. This does not seem to work anymore for Mint 10... any ideas how to get it back on track?

    ReplyDelete
  13. I haven't gotten around to trying Mint 10 yet... I'll give the ISO a download now and will post back in a few hours what type of fix is needed for it to work.

    ReplyDelete
  14. I found out how to get it installed on Mint 10.....Before running any of the commands do the following as noted above:

    Try this:
    * sudo gedit /etc/lsb-release
    * change the line "DISTRIB_ID=LinuxMint" for "DISTRIB_ID=Ubuntu"
    * Save the changes.

    Then do the the mod as listed above:
    sudo apt-get install software-center
    wget http://www.tophattwaffle.com/wp-content/files/jeff/custom__init__
    sudo rm /usr/share/software-center/softwarecenter/distro/__init__.py
    sudo mv custom__init__ /usr/share/software-center/softwarecenter/distro/__init__.py

    Then run software center to make sure it works.
    After it works, fix the release you changed at first by:

    * sudo gedit /etc/lsb-release
    * change the line "DISTRIB_ID=Ubuntu" for "DISTRIB_ID=LinuxMint"
    * Save the changes.

    Found that the install of software center was crashing because of the Distrib ID....

    ReplyDelete
  15. So Jeff how's the testing going? I really hope you'll be able to work this out :)

    ReplyDelete
  16. @Borsook I've been busy and don't really use Mint anymore (PinguyOS replaced it for me) Check the comment above yours for a possible solution though. If that still doesn't work, drop another comment and I will do my best to try and get it sorted out for you.

    ReplyDelete
  17. Hi, just wanted to confirm that it works great with the posted above workaround, the only issue is that "for purchase" section is empty.

    ReplyDelete
  18. Thanks a lot... i thought of going back to Ubuntu 10.10... u saved my work

    ReplyDelete
  19. Any idea how to get this to work on Linux Mint 10?

    ReplyDelete
  20. Check the comments above for how to get this to work in Mint 10

    ~Jeff

    ReplyDelete
  21. Hey Jeff! I wonder if the same steps work for mint 10 and ubuntu 10.10? Cuz I'm really considering moving to mint but don't wanna give up the software center.

    ReplyDelete
  22. just adding a templatefile (or copy the ubuntu templatefile and and call it LinuxMint)is much easier, and cleaner :
    sudo cp -r /usr/share/software-center/softwarecenter/distro/Ubuntu.py /usr/share/software-center/softwarecenter/distro/LinuxMint.py

    For other Distro´s (this command will also be used in my script for elementary (OS);) )
    use the distrib_id from lsb_release -a as filename.py, instead of LinuxMint.py (a.e, in my case elementary.py)

    NO WARRANTY AT ALL :)

    ReplyDelete
  23. cp -r /usr/share/software-center/softwarecenter/distro/Ubuntu.py /usr/share/software-center/softwarecenter/distro/LinuxMint.py does the job also, and more cleanly.
    BTW: you can use this with other distros too, like I in elemetary :
    cp -r /usr/share/software-center/softwarecenter/distro/Ubuntu.py /usr/share/software-center/softwarecenter/distro/DISTRIB_ID.py
    replace distrib_ID with that one from lsb_release -a a.e in elementary:
    cp -r /usr/share/software-center/softwarecenter/distro/Ubuntu.py /usr/share/software-center/softwarecenter/distro/elementary.py

    No waranty at all!

    ReplyDelete
  24. thank you so much it was such a pain to install it!

    ReplyDelete
  25. after copying Ubuntu.py in LinuxMint.py you also have to edit the new LinuxMint.py file, changing the "class Ubuntu(Distro):" line in "class LinuxMint(Distro)"

    ReplyDelete
  26. You rock! Thanks so much. I found this fix through your post on the Mint forums. Thanks again!

    ReplyDelete
  27. http://jeffhoogland.blogspot.com/2010/06/howto-use-ubuntu-software-center-in.html?showComment=1287899450693#c3987611146587165228

    This works great on Mint 10. Thanks a bunch. :)

    ReplyDelete
  28. in mint 11 install ubuntu software center from an apt on cd iso (or if you can find it from mint install or sudo aptget software-center {i think ?}) right click on the menu icon for it and change the command to software-center instead of mintinstall. and you are done. same ubuntu gui different icon.

    ReplyDelete
  29. I almost gave up on software center because of the errors ; Thanks a 1000 times :)

    ReplyDelete
  30. Just so people know...the following works in Linux Mint 12 RC: (Just a combination of the people above's solutions :)

    First install Software Center:
    sudo apt-get install software-center

    Then Create a new .py file for Linux Mint:
    cp -r /usr/share/software-center/softwarecenter/distro/Ubuntu.py /usr/share/software-center/softwarecenter/distro/LinuxMint.py

    Then edit the new LinuxMint.py file:
    sudo gedit /usr/share/software-center/softwarecenter/distro/LinuxMint.py

    Replace the line "class Ubuntu(Debian)" with "class LinuxMint(Debian)"

    Then if you want to remove the original package managers and only use Ubuntu's do:
    sudo apt-get purge gdebi synaptic mintinstall

    Then click on the little infinity button on the top
    and search for "update". Right-click Update Manager, and click add to favorites. Do the same for the software manager. (This is because I can't figure out how to add them to the same sections in the menu as the old ones used to be in...any help here?)

    And that's it!

    ReplyDelete
  31. EDIT to the previous post...you can't just remove all of those. If you do it will break the ability to add PPAs. I know if you remove those then install mintupdate it will work again. Not sure how to work around this. :/

    ReplyDelete
  32. I know this thread is old and Mint 9 has moved down on the totem pole, but I must say that the software center is still inferior, even after a couple year's worth of updates.

    The biggest problem I have with it is that most of my searches don't yield any results unless I type the exact package name. This is not ideal for someone looking to find a new piece of software that they don't know about.

    Searching "pdf editor" fails to find the "pdfedit" package in the Mint software manager, but Ubuntu Software Center it no problem.

    I actually find Synaptic's quick search to actually help me more than the Mint software manager. This is still true even in Mint 12.

    ReplyDelete
  33. i have mint 10. i first installed the packages from synaptic package manager. this automatically put it in my gnome menu, however, it didn't work. then i began following your instruction, sudo software center. there it told me 0 upgraded, 0 newly installed, 0 to remove and 334 not upgraded. with this information i am using apt-get upgrade software-center. at my connection, it is 32 minutes before i know how this turned out.

    ReplyDelete
  34. DEAD LINK http://www.tophattwaffle.com/wp-content/files/jeff/custom__init__ NOT FOUND

    ReplyDelete