tutoriais:como_instalar_a_nova_versao_do_navegador_opera_no_linux
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
tutoriais:como_instalar_a_nova_versao_do_navegador_opera_no_linux [2014-12-18 09:35] – created alopes | tutoriais:como_instalar_a_nova_versao_do_navegador_opera_no_linux [2023-04-24 17:06] (current) – removed gnann | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | | ||
- | O navegador Opera é um dos navegadores mais antigos ainda em funcionamento - http:// | ||
- | |||
- | Mas o que tem de bom nesse navegador? Saiba que muitas funções que existem hoje em dia no seu navegador de internet provavelmente foi inventada pelo pessoal do Opera! Procure na internet e descobrirá quem inventou as abas, zoom na página, salvar sessão, palavra chave para busca, pesquisa integrada, bloqueador de pop-up... | ||
- | |||
- | O Opera até a versão 12 era baseado em tecnologia própria. Com a aparição do projeto open-source Chromium (base do navegador Google Chrome), o Opera passou a utilizar esse mesmo projeto como base para seu navegador, customizando à sua maneira. Ganhou mais velocidade para continuar entre os navegadores mais rápidos (teste seu navegador http:// | ||
- | |||
- | Bom, agora vamos ao que interessa... Como instalar no Linux? | ||
- | Visitando http:// | ||
- | |||
- | Mas para aqueles que utilizam outras versões que não utilizam pacotes .deb - OpenSUSE, Fedora, CentOS, Arch, Slackware, etc... - é necessário fazer a instalação manual ou utilizar um script para fazer isso para você. No site http:// | ||
- | |||
- | O script é esse: {{: | ||
- | < | ||
- | |||
- | e, se quiser ver o código: | ||
- | |||
- | < | ||
- | #!/bin/sh | ||
- | |||
- | available () { | ||
- | command -v " | ||
- | } | ||
- | |||
- | updatedbs () { | ||
- | # Setup menu entries | ||
- | if available update-desktop-database; | ||
- | update-desktop-database -q / | ||
- | fi | ||
- | |||
- | # Setup icons | ||
- | touch -c / | ||
- | if available gtk-update-icon-cache; | ||
- | gtk-update-icon-cache -tq / | ||
- | fi | ||
- | } | ||
- | |||
- | # Uninstall function to be used by the removal script | ||
- | removefiles () { | ||
- | while read f; do | ||
- | # ' | ||
- | if [ -e " | ||
- | if [ -d " | ||
- | if ! ls -A " | ||
- | # Don't remove a symlink pointing to a directory, as it could have | ||
- | # been created by the user or the distribution | ||
- | if [ ! -h " | ||
- | rmdir -v " | ||
- | fi | ||
- | fi | ||
- | else | ||
- | rm -v " | ||
- | fi | ||
- | fi | ||
- | done | ||
- | } # | ||
- | |||
- | # Ar (Binutils) or BSD tar are needed to extract from a Debian package | ||
- | if available bsdtar; then | ||
- | AR_EXTRACT=" | ||
- | elif available ar; then | ||
- | AR_EXTRACT=" | ||
- | else | ||
- | echo "You must install BSD Tar or GNU Binutils to use this script" | ||
- | exit 1 | ||
- | fi | ||
- | |||
- | # Quit if you can't write to /usr/local | ||
- | if [ ! -w "/ | ||
- | echo "You do not have write permission to / | ||
- | echo " | ||
- | echo " | ||
- | exit 1 | ||
- | fi | ||
- | |||
- | # Check if automatic download has been selected | ||
- | while [ 0 ]; do | ||
- | if [ " | ||
- | OPERA_STREAM=opera-developer | ||
- | shift 1 | ||
- | elif [ " | ||
- | OPERA_STREAM=opera-beta | ||
- | shift 1 | ||
- | elif [ " | ||
- | OPERA_STREAM=opera-stable | ||
- | shift 1 | ||
- | else | ||
- | break | ||
- | fi | ||
- | done | ||
- | |||
- | DESTROY_DEB=N | ||
- | OPERA_AUTO_FETCH=N | ||
- | |||
- | if [ -n " | ||
- | OPERA_AUTO_FETCH=Y | ||
- | DESTROY_DEB=Y | ||
- | # Set architecture information | ||
- | ARCH=$(uname -m | sed ' | ||
- | case " | ||
- | x86_64) DEBARCH=amd64; | ||
- | i386) DEBARCH=$ARCH; | ||
- | *) echo "The architecture $ARCH is not supported." | ||
- | esac | ||
- | |||
- | # Make sure we have wget or curl | ||
- | if available wget; then | ||
- | SILENT_DL=" | ||
- | LOUD_DL=" | ||
- | DL_OUTPUT=" | ||
- | elif available curl; then | ||
- | SILENT_DL=" | ||
- | LOUD_DL=" | ||
- | DL_OUTPUT=" | ||
- | else | ||
- | echo " | ||
- | exit 1 | ||
- | fi | ||
- | |||
- | # Work out the latest stable Google Chrome if VERSION is unset | ||
- | OPERA_VERSION=$($SILENT_DL http:// | ||
- | |||
- | # Error out if $OPERA_VERISON is unset, e.g. because previous command failed | ||
- | if [ -z " | ||
- | echo "Could not work out the latest version of $OPERA_STREAM for $ARCH; exiting" | ||
- | exit 1 | ||
- | fi | ||
- | |||
- | if [ -e "/ | ||
- | echo "The latest version of $OPERA_STREAM ($OPERA_VERSION) is already installed; exiting" | ||
- | exit 0 | ||
- | fi | ||
- | |||
- | OPERA_DEB=$(mktemp -t opera-deb.XXXXXX) | ||
- | $LOUD_DL http:// | ||
- | if ! [ " | ||
- | echo " | ||
- | exit 1 | ||
- | fi | ||
- | fi | ||
- | |||
- | # Check if this is being run as a self extractor | ||
- | if [ -z " | ||
- | if [ $(sed ' | ||
- | OPERA_DEB=$(mktemp -t opera-deb.XXXXXX) | ||
- | sed ' | ||
- | DESTROY_DEB=Y | ||
- | else | ||
- | echo "You must provide the name of an Opera package, e.g." >&2 | ||
- | echo " | ||
- | exit 1 | ||
- | fi | ||
- | fi | ||
- | |||
- | # Run some checks to see if a proper package was provided | ||
- | if [ -z " | ||
- | if ! echo " | ||
- | echo "$1 is not named like an Opera Debian package" | ||
- | exit 1 | ||
- | fi | ||
- | if [ -r " | ||
- | OPERA_DEB=" | ||
- | else | ||
- | echo "$1 is either not present or cannot be read" >&2 | ||
- | exit 1 | ||
- | fi | ||
- | fi | ||
- | |||
- | # Extract information from control file | ||
- | if [ -z " | ||
- | OPERA_STREAM_VERSION_DEBARCH=$($AR_EXTRACT " | ||
- | if [ -z " | ||
- | echo "Could extract the package name and architecture from the control file" >&2 | ||
- | exit 1 | ||
- | else | ||
- | OPERA_STREAM=$(echo $OPERA_STREAM_VERSION_DEBARCH | cut -d' ' -f1) | ||
- | OPERA_VERSION=$(echo $OPERA_STREAM_VERSION_DEBARCH | cut -d' ' -f2) | ||
- | DEBARCH=$(echo $OPERA_STREAM_VERSION_DEBARCH | cut -d' ' -f3) | ||
- | fi | ||
- | |||
- | # Set the architecture | ||
- | case " | ||
- | amd64) ARCH=x86_64; | ||
- | *) ARCH=$DEBARCH; | ||
- | esac | ||
- | fi | ||
- | |||
- | # If Opera is already installed, assume this is an upgrade and remove it first | ||
- | UNINSTALL_OPERA_SCRIPT=/ | ||
- | if [ -x " | ||
- | echo " | ||
- | sleep 1 | ||
- | . " | ||
- | fi | ||
- | |||
- | # Stop the script as soon as there is a problem | ||
- | set -eu | ||
- | |||
- | # Extract files from the Debian package to a temporary location | ||
- | OPERA_FILES=$(mktemp -d -t opera-files.XXXXXX) | ||
- | printf " | ||
- | mkdir -p " | ||
- | $AR_EXTRACT " | ||
- | --transform=" | ||
- | --exclude=" | ||
- | |||
- | # Create the first part of the uninstall script | ||
- | mkdir -p " | ||
- | sed -n '1,/^} #$/p' " | ||
- | |||
- | # Remove the last part of stable stream name | ||
- | OPERA_STREAM=$(echo $OPERA_STREAM | sed ' | ||
- | |||
- | # Setup udev symlink if needed | ||
- | cd " | ||
- | if ! [ -e "/ | ||
- | mkdir -p usr/ | ||
- | if [ -e "/ | ||
- | ln -s / | ||
- | elif [ -e "/ | ||
- | ln -s / | ||
- | elif [ -e "/ | ||
- | ln -s / | ||
- | elif [ -e "/ | ||
- | ln -s / | ||
- | elif [ -e "/ | ||
- | ln -s / | ||
- | elif [ -e "/ | ||
- | ln -s / | ||
- | else | ||
- | echo " | ||
- | exit 1 | ||
- | fi | ||
- | fi | ||
- | |||
- | # Setup libcrypto symlink on Fedora and derivatives | ||
- | cd " | ||
- | if [ -e "/ | ||
- | mkdir -p usr/ | ||
- | ln -s / | ||
- | fi | ||
- | |||
- | # Correct the Opera sandbox permissions | ||
- | chmod 4755 usr/ | ||
- | |||
- | # Record the version number in the package | ||
- | touch usr/ | ||
- | |||
- | # Finish uninstall script | ||
- | printf 'set -e\nremovefiles << FILE_LIST\n' | ||
- | find . ! -type d ! -print | sed ' | ||
- | find . -depth -type d -print | sed ' | ||
- | grep -vxE ' | ||
- | printf " | ||
- | chmod 755 " | ||
- | |||
- | # Install the files only, *not* directories. | ||
- | # This avoids changing system directory permissions/ | ||
- | printf " | ||
- | find . ! -type d | tar -cf- -T- | tar -xf- -C / | ||
- | |||
- | # Note: Originally I used a cpio instead of a tar pipe but some | ||
- | # systems might not have cpio installed by default. | ||
- | # find . ! -type d | cpio --quiet -pmd / | ||
- | |||
- | # Remove temporary files | ||
- | cd - >/ | ||
- | rm -r " | ||
- | if [ " | ||
- | rm " | ||
- | fi | ||
- | |||
- | # Update the desktop and icons databases | ||
- | updatedbs | ||
- | |||
- | # And ... we're done! ;) | ||
- | echo 'Opera was successfully installed into "/ | ||
- | printf "\nTo uninstall, issue the following as root (or prefaced with sudo): | ||
- | printf " | ||
- | exit | ||
- | </ |
tutoriais/como_instalar_a_nova_versao_do_navegador_opera_no_linux.1418902510.txt.gz · Last modified: 2019-03-15 10:03 (external edit)