Command Line

Fastest way to install the media essentials in ubuntu

If you’re coming from Windows, or like me, find yourself living in a live CD while you figure out which step went wrong; you’ll be interested in the essential media codecs, flash, java, Microsoft fonts, etc.

I thought I’d share the way I did this as quickly as possible in in Ubuntu 10.04 using the command line.

Open up terminal, using ctrl+alt+t (Which I’m very happy about as this has been my default since 8.04). Alternativelty from the main menu -> Applications > Accessories > Terminal

Make a backup in case you’re scared, then remove the comments from repositories you need to unlock to access the restricted (proprietary) packages.

ubuntu@ubuntu:~$ sudo cp /etc/apt/sources.list .
ubuntu@ubuntu:~$ sudo sed -i 's/^# deb/deb/' /etc/apt/sources.list

We do this be matching the first 2 characters with ‘# ‘ and replacing them with ” (nothing). See the diff below (> indicate original lines, < are changed).

 
ubuntu@ubuntu:~$ diff sources.list /etc/apt/sources.list
18,23c18,23
< # deb http://archive.ubuntu.com/ubuntu lucid universe
< # deb-src http://archive.ubuntu.com/ubuntu lucid universe
< # deb http://archive.ubuntu.com/ubuntu lucid-updates universe
< # deb-src http://archive.ubuntu.com/ubuntu lucid-updates universe
< # deb http://security.ubuntu.com/ubuntu lucid-security universe
< # deb-src http://security.ubuntu.com/ubuntu lucid-security universe
---
> deb http://archive.ubuntu.com/ubuntu lucid universe
> deb-src http://archive.ubuntu.com/ubuntu lucid universe
> deb http://archive.ubuntu.com/ubuntu lucid-updates universe
> deb-src http://archive.ubuntu.com/ubuntu lucid-updates universe
> deb http://security.ubuntu.com/ubuntu lucid-security universe
> deb-src http://security.ubuntu.com/ubuntu lucid-security universe
30,35c30,35
< # deb http://archive.ubuntu.com/ubuntu lucid multiverse
< # deb-src http://archive.ubuntu.com/ubuntu lucid multiverse
< # deb http://archive.ubuntu.com/ubuntu lucid-updates multiverse
< # deb-src http://archive.ubuntu.com/ubuntu lucid-updates multiverse
< # deb http://security.ubuntu.com/ubuntu lucid-security multiverse
< # deb-src http://security.ubuntu.com/ubuntu lucid-security multiverse
---
> deb http://archive.ubuntu.com/ubuntu lucid multiverse
> deb-src http://archive.ubuntu.com/ubuntu lucid multiverse
> deb http://archive.ubuntu.com/ubuntu lucid-updates multiverse
> deb-src http://archive.ubuntu.com/ubuntu lucid-updates multiverse
> deb http://security.ubuntu.com/ubuntu lucid-security multiverse
> deb-src http://security.ubuntu.com/ubuntu lucid-security multiverse
>
 
 
<pre lang="bash">

Now that we uncommented these lines, they will be read next time we update, so lets go ahead and do that now. Once that is done, we can install the extras.

ubuntu@ubuntu:~$ sudo apt-get update
ubuntu@ubuntu:~$ sudo apt-get install ubuntu-restricted-extras

Rock and roll.

screenshot-about-shiretoko

Installing Firefox 3.5.2 (Shiretoko) on Ubuntu using the default repos and customizing the icon to be more recognizable

When Firefox 3.5 came out, I along with many others, was eager to try it. For a while I ran it out of the archive directly but this caused minor issues as it’s a messy solution. At some point I noticed firefox-3.5 in the repository:

tyler@quadjutsu:~$ apt-cache search firefox |grep 3.5
abrowser-3.1 - dummy upgrade package for firefox-3.1 -> firefox-3.5
abrowser-3.1-branding - dummy upgrade package for firefox-3.1 -> firefox-3.5
firefox-3.1 - dummy upgrade package for firefox-3.1 -> firefox-3.5
firefox-3.1-branding - dummy upgrade package for firefox-3.1 -> firefox-3.5
firefox-3.1-dbg - dummy upgrade package for firefox-3.1 -> firefox-3.5
firefox-3.1-dev - dummy upgrade package for firefox-3.1 -> firefox-3.5
firefox-3.1-gnome-support - dummy upgrade package for firefox-3.1 -> firefox-3.5
firefox-3.5 - safe and easy web browser from Mozilla
firefox-3.5-branding - Package that ships the firefox branding
firefox-3.5-dbg - firefox-3.5 debug symbols
firefox-3.5-dev - Development files for Mozilla Firefox
firefox-3.5-gnome-support - Support for Gnome in Mozilla Firefox

and proceeded to install it with the following command:

tyler@quadjutsu:~$ sudo apt-get install firefox-3.5

It runs along-side Firefox 3.0 without a hitch. I often use the two in tandem while testing web applications.

Something that bothered me about this was the default icon isn’t as recongnizable to me as I’d like it to be.

screenshot-about-shiretoko

As such I looked into a way to replace it.

First, I found a replacement icon I liked

hp-firefox-128x128

from the following website (where other nice replacements exist).

Then I went to find the logical location of the files to replace. First I updated my ‘locate’ database file because this software is new, so it’s not yet known. This is done automatically daily on a cron but you can update it any time you’d like as follows:

tyler@quadjutsu:~$ sudo updatedb

Then I probed for icons I might think would be responsible.

tyler@quadjutsu:~$ locate firefox |grep lib |grep icon |grep 3.5
/usr/lib/firefox-3.5.2/icons
/usr/lib/firefox-3.5.2/chrome/icons
/usr/lib/firefox-3.5.2/chrome/icons/default
/usr/lib/firefox-3.5.2/chrome/icons/default/default16.png
/usr/lib/firefox-3.5.2/chrome/icons/default/default32.png
/usr/lib/firefox-3.5.2/chrome/icons/default/default48.png
/usr/lib/firefox-3.5.2/icons/document.png
/usr/lib/firefox-3.5.2/icons/mozicon128.png
/usr/lib/firefox-3.5.2/icons/mozicon16.xpm
/usr/lib/firefox-3.5.2/icons/mozicon50.xpm

The first set in the ‘/usr/lib/firefox-3.5.2/chrome/icons/’ folder will replace the icons used by the application itself (i.e. the icon in the top of your window). The latter, ‘/usr/lib/firefox-3.5.2/icons/’ will replace the ones used by shortcut icons.

Here are all the files for the icons I resized if you’d like to use them.

firefox-3.5_replacement_chrome_icons.zip
firefox-3.5_replacement_shortcut_icons.zip

bash pro-style:

cd Desktop/ && mkdir firefox_replacement_icons && cd firefox_replacement_icons
wget http://www.doknowevil.net/files/firefox-3.5_replacement_chrome_icons.zip && wget http://www.doknowevil.net/files/firefox-3.5_replacement_shortcut_icons.zip
for file in *.zip; do unzip $file; done
sudo cp chrome/* /usr/lib/firefox-3.5.2/chrome/icons/default/
sudo cp shorcuts/* /usr/lib/firefox-3.5.2/icons/