Firefox 2.0 Ubuntu Dapperis

Ubuntu Linuxi ja tema erinevate versioonide foorum

Moderaator: Moderaatorid

Vasta
Kasutaja avatar
spott
Admin
Admin
Postitusi: 8870
Liitunud: 04.06.2005, 03:00

Firefox 2.0 Ubuntu Dapperis

Postitus Postitas spott »

Nagu teada on Ubuntu Dapperis endiselt Mozilla Firefoxi 1.5 versioon. Ma ei soovi stabiilsuse tõttu uuendada läpakal Ubuntu 6.10 peale, kuna suurel arvutil sellega üsna halvad kogemused. Küll aga soovin kasutada uusimat Firefoxi. Sai siis otsitud lahendust oma probleemile ja leidsin sellise veebilehe:
http://www.psychocats.net/ubuntu/firefox
Seal oleval skriptil on aga üks puudus. Nimelt minul ei hakanud küll tööle vastav Localisatsiooni osa. Ehk - skript polnud võimeline töötama. Nii viisin sisse mõningad muudatused:

Kood: Vali kõik

#!/bin/bash
#
# installnewfirefox.sh
#               Script to automatically download and install the newest firefox version for linux, on an Ubuntu system.
#               Requires an internet connection to work (obviously).
# 
# Author:       nanotube <nanotube@users.sf.net>.
#               
# Version:      installnewfirefox.sh  2.14  11-Nov-2006  nanotube@users.sf.net
# 
#
#######

## Make sure that we exit if any commands do not complete successfully.
set -o errexit
trap 'echo "Previous command did not complete successfully. Exiting."' ERR

## Set version-specific variables
if grep -q "5.10" /etc/issue ; then
  PLUGINPATH=/usr/lib/mozilla-firefox/plugins
elif grep -q "6.06" /etc/issue ; then
  PLUGINPATH=/usr/lib/firefox/plugins
elif grep -q "6.10" /etc/issue ; then
  PLUGINPATH=/usr/lib/firefox/plugins
else
  echo "This script only works on Breezy, Dapper, or Edgy."
  exit 1
fi

## Get the newest firefox release version from mozilla website
VERSION=`wget -q -O - http://www.mozilla.com |grep "product=" -m 1 |sed -e 's/.*<li>.*firefox-//' -e 's/&amp.*//'`

echo -e -n "The most recent release of firefox is detected to be $VERSION. Please make sure this is correct before proceeding. (You can confirm by going to http://www.mozilla.com/) Is it correct [y/n]? "
while true
do
  read ans
  case $ans in
        Y|y|[Yy][Ee][Ss]) 
            break ;;
        N|n|[Nn][Oo]) 
            echo "If this does not agree with the latest version as listed on mozilla.com, please contact nanotube@users.sf.net and let me know."; 
            exit ;;
        *) 
            echo -n "Invalid command. Please answer yes or no [y/n] " ;;
  esac
done

echo -e "\nUpdating repositories list\n"
sudo aptitude update

echo -e "\nMaking sure libstdc++5 and the old Firefox are installed\n"
sudo aptitude install firefox libstdc++5

if [ -d ~/.mozilla ]; then
  echo -e "\nBacking up old Firefox preferences\n"
  cp -R ~/.mozilla ~/.mozilla_backup_`date -Iseconds`
else
  echo -e "\nOld firefox preferences not found. Nothing to back up. Proceeding with installation.\n"
fi

echo -e "\nChanging to home directory\n"
cd

echo -e "\nDownloading Firefox archive from the Mozilla site\n"
wget -c http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/$VERSION/linux-i686/en-US/firefox-$VERSION.tar.gz

echo -e -n "The next step will verify the GPG signature for the firefox archive to assure its integrity. This step is important for your security. However, if you have problems getting this to work right, you may choose 'no' and proceed to installation without signature verification. Do you want to verify the signature [y/n]?"
while true
do
  read ans
  case $ans in
        Y|y|[Yy][Ee][Ss]) 
            echo -e "\nDownloading Firefox signature from the Mozilla site\n"
            wget -c http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/$VERSION/linux-i686/en-US/firefox-$VERSION.tar.gz.asc

            echo -e "\nImporting Mozilla Software Releases public key\n"
            echo -e "Note that if you have never used gpg before on this system, and this is your first time running this script, there may be a delay of about a minute during the generation of a gpg keypair. This is normal and expected behavior.\n"
            gpg --keyserver subkeys.pgp.net --recv 1AF32821

            echo -e "\nVerifying signature...\nNote: do not worry about \"untrusted key\" warnings. That is normal behavior for newly imported keys.\n"
            gpg --verify firefox-$VERSION.tar.gz.asc firefox-$VERSION.tar.gz
            break ;;
        N|n|[Nn][Oo]) 
            echo "Proceeding without signature verification..."; break ;;
         *) 
            echo -n "Invalid command. Please answer yes or no [y/n] " ;;
  esac
done

echo -e "\nExtracting the downloaded Firefox archive\n"
sudo tar -C /opt -xzf firefox-$VERSION.tar.gz

echo -e "\nRemoving installation file(s) to free up disk space\n"
rm -f firefox-$VERSION.tar.gz firefox-$VERSION.tar.gz.asc

echo -e "\nLinking plugins\n"
sudo mv /opt/firefox/plugins /opt/firefox/plugins_`date -Iseconds`
sudo ln -s -f $PLUGINPATH /opt/firefox/plugins

echo -e "\nLinking launcher to new Firefox\n"
sudo dpkg-divert --divert /usr/bin/firefox.ubuntu --rename /usr/bin/firefox
sudo ln -s -f /opt/firefox/firefox /usr/bin/firefox
sudo dpkg-divert --divert /usr/bin/mozilla-firefox.ubuntu --rename /usr/bin/mozilla-firefox
sudo ln -s -f /opt/firefox/firefox /usr/bin/mozilla-firefox

echo -e "\nThe new Firefox version $VERSION has been installed successfully."

exit
salvestage vastav kood endale installnewfirefox.sh failina. Andke sellele käsuga: chmod +x installnewfirefox.sh käivitamis õigused ja siis käivitage see (tavakasutajana): ./installnewfirefox.sh

Miks eelistada seda skripti versiooni - nimelt sellega saate edasi kasutada Ubuntu enda repositooriumitest paigaldatud pluginaid.

Ühtlasi - võite ka alla laadida valmis minu muudetud faili zip arhiivina.
Manused
installnewfirefox.sh.zip
installnewfirefox.sh arhiiv.
(1.87 KiB) Allalaaditud 598 korda
Tellige endale sünnipäevaks, sõbrapäevaks või muuks tähtpäevaks kingitus: Kingitused internetist - NetiKink.eu
zeroconf
Vana Pingviin
Vana Pingviin
Postitusi: 1069
Liitunud: 31.03.2007, 16:10

Postitus Postitas zeroconf »

proovida võib ka sellist skripti:

http://pykeylogger.sourceforge.net/installnewfirefox.sh mis toimis Ubuntu 6.06.1 peal kenasti.
Viimati muutis zeroconf, 08.05.2007, 09:00, muudetud 6 korda kokku.
Kasutaja avatar
spott
Admin
Admin
Postitusi: 8870
Liitunud: 04.06.2005, 03:00

Postitus Postitas spott »

Thunderbirdi skripti panin igaks juhuks ka Pingviini allalaadimistesse.
siin
Tellige endale sünnipäevaks, sõbrapäevaks või muuks tähtpäevaks kingitus: Kingitused internetist - NetiKink.eu
Vasta