Selasa, 22 Juni 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 import SoftwareCenterApp
File "/usr/share/software-center/softwarecenter/", line 42, in
from view.viewswitcher import ViewSwitcher, ViewSwitcherList
File "/usr/share/software-center/softwarecenter/view/", line 34, in
from import SoftwareChannel
File "/usr/share/software-center/softwarecenter/backend/", line 22, in
from softwarecenter.distro import get_distro
File "/usr/share/software-center/softwarecenter/distro/", line 88, in
File "/usr/share/software-center/softwarecenter/distro/", 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
sudo rm /usr/share/software-center/softwarecenter/distro/
sudo mv custom__init__ /usr/share/software-center/softwarecenter/distro/

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 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

Tidak ada komentar:

Posting Komentar