¿Cómo puedo degradar Gedit a una versión anterior (3.10.4) en Ubuntu 16.04 LTS


17

Como el título ya dice: Tengo algunos complementos que no se ejecutan con gedit 3.18.3 que se envía con Ubuntu 16.04 LTS.

¿Cómo puedo cambiar a la versión 3.10.4 que se usó en Ubuntu 14.04 LTS y Ubuntu 15.10 y obtener todos los complementos posibles instalados?

¿Y cómo lo revierto a 3.18.3 si ya no se necesita 3.10.4?


3
Genial para las personas que odian el nuevo diseño Gedit de Xenial ... que me incluye a mí. Probablemente voy a intentar su procedimiento algún día cuando esté inactivo.
Byte Commander

@ByteCommander ¿Qué quieres decir con el nuevo diseño ? Gedit es el editor básico, generalmente uso Geany u otra idea más útil para la programación seria.
NoBugs

2
@NoBugs Compare cómo se ve Gedit en 15.10 o anterior y en 16.04. El nuevo perdió la mayor parte de su barra de herramientas y se ve feo IMO.
Byte Commander

@NoBugs: bueno para mí va más allá de la estética. Utilizo algunas herramientas que se ejecutan sobre gedit-plugin y que aún no se han reescrito para tener en cuenta la nueva barra de herramientas.
user2413

Respuestas:


18

La solución es bastante complicada, así que asegúrese de leer y proceder con cuidado. Como preparación para esto, asegúrese de que todas las fuentes de paquetes habilitado para que sus /etc/apt/sources.listmiradas como esta y hacer una actualización:

sudo apt-get update
sudo apt-get dist-upgrade
reboot

Para instalar la versión anterior:

Luego, como primer paso, debe eliminar la versión existente de gedit. Para hacerlo, ejecute los siguientes comandos en su terminal ( ctrl+ alt+ t):

# this installs the build dependencies
sudo apt-get build-dep gedit gedit-plugins
sudo apt-get install moreutils

# this uninstalls the 3.18.3 version of gedit, gedit-dev, 
# gedit-plugins and gedit-common and should get rid of everything else
# installed for gedit
sudo apt-get remove gedit gedit-dev gedit-plugins gedit-common

Ahora prepare un directorio para trabajar. Para su comodidad, lo hacemos en nuestro directorio de inicio.

# creating directory and switching to it
mkdir ~/gedit-downgrade
cd ~/gedit-downgrade

El siguiente paso es crear un wget-listarchivo para facilitar la descarga (puede copiar y pegar todo el campo en su terminal). Si no está utilizando un sistema de 64 bits, es posible que desee encontrar los enlaces adecuados para i386 aquí .

cat > wget-list << "EOF"
http://mirrors.kernel.org/ubuntu/pool/main/g/gedit/gedit-common_3.10.4-0ubuntu13_all.deb
http://mirrors.kernel.org/ubuntu/pool/main/g/gedit/gedit_3.10.4-0ubuntu13_amd64.deb
http://mirrors.kernel.org/ubuntu/pool/main/g/gedit/gedit-dev_3.10.4-0ubuntu13_amd64.deb
http://mirrors.kernel.org/ubuntu/pool/universe/g/gedit-developer-plugins/gedit-developer-plugins_0.5.15-0ubuntu1_all.deb
http://mirrors.kernel.org/ubuntu/pool/universe/g/gedit-latex-plugin/gedit-latex-plugin_3.8.0-3build1_all.deb
http://mirrors.kernel.org/ubuntu/pool/universe/g/gedit-plugins/gedit-plugins_3.10.1-1ubuntu3_amd64.deb
http://mirrors.kernel.org/ubuntu/pool/universe/g/gedit-r-plugin/gedit-r-plugin_0.8.0.2-Gtk3-Python3-1ubuntu1_all.deb
http://mirrors.kernel.org/ubuntu/pool/universe/g/gedit-source-code-browser-plugin/gedit-source-code-browser-plugin_3.0.3-3_all.deb
http://mirrors.kernel.org/ubuntu/pool/universe/g/gedit-valencia-plugin/gedit-valencia-plugin_0.8.0-0ubuntu2_amd64.deb
http://mirrors.kernel.org/ubuntu/pool/universe/r/rabbitvcs/rabbitvcs-gedit_0.16-1_all.deb
http://mirrors.kernel.org/ubuntu/pool/universe/s/supercollider/supercollider-gedit_3.6.6~repack-2-1build1_all.deb
EOF

Ahora que tiene ese wget-listarchivo, puede descargar todo de una vez escribiendo wget -i wget-list, dejar que los archivos se descarguen y luego comenzar su instalación.

Siga los pasos a continuación uno por uno y si se encuentra con errores de dependencia, simplemente haga lo sudo apt-get remove <package-name>que refleja el paquete que le genera problemas, luego instale las dependencias manualmente y sudo apt-get install <package-name>luego vuelva a hacer la línea dpkg. No lo hagas, y quiero decir que no corras sudo apt-get -f installmientras intentas esta instalación: arruinará todo.

Ahora, comencemos con los paquetes esenciales (probados y trabajando en una instalación limpia de 16.04 LTS):

# install gedit-common (essential needed)
sudo dpkg -i gedit-common_3.10.4-0ubuntu13_all.deb

# install gedit (essential needed)
sudo dpkg -i gedit_3.10.4-0ubuntu13_amd64.deb

# install gedit-dev (essential needed)
sudo dpkg -i gedit-dev_3.10.4-0ubuntu13_amd64.deb 

# install gedit-plugins (essential needed)
# here are some steps needed follow them carefully

    # unpacking the .deb file
    sudo dpkg-deb -R gedit-plugins_3.10.1-1ubuntu3_amd64.deb tmp

    # editing tmp/DEBIAN/control:
    # change 'python3 (<< 3.5), python3 (>= 3.4~), python3.4' to 'python3 (>= 3.5~), python3.5'
    sed 's/python3 (<< 3\.5), python3 (>= 3\.4~), python3\.4/python3 (>= 3.5~), python3.5/' tmp/DEBIAN/control | sudo sponge tmp/DEBIAN/control

    # editing tmp/DEBIAN/postinst
    # change 'py3compile -p gedit-plugins /usr/lib/x86_64-linux-gnu/gedit/plugins -V 3.4' to
    # 'py3compile -p gedit-plugins /usr/lib/x86_64-linux-gnu/gedit/plugins -V 3.5'
    sed 's/3\.4/3.5/' tmp/DEBIAN/postinst | sudo sponge tmp/DEBIAN/postinst

    # packing a new .deb file 
    sudo dpkg-deb -b tmp gedit-plugins_3.10.1-1ubuntu4_amd64.deb

    # changing ownership of the new .deb file replace username with your username
    sudo chown username:username gedit-plugins_3.10.1-1ubuntu4_amd64.deb

    # removing tmp
    sudo rm -rfv tmp

    # installing it
    sudo dpkg -i gedit-plugins_3.10.1-1ubuntu4_amd64.deb

Los siguientes paquetes son solo opcionales y debería poder instalarlos fácilmente, las dependencias para descargar se dan y prueban en una instalación limpia de 16.04 LTS como la anterior.

# install gedit-developer-plugins (optional)
sudo apt-get install python-pocket-lint
sudo dpkg -i gedit-developer-plugins_0.5.15-0ubuntu1_all.deb

# install gedit-latex-plugin (optional)
sudo apt-get install rubber
sudo dpkg -i gedit-latex-plugin_3.8.0-3build1_all.deb

# install gedit-r-plugin (optional but needs gedit-plugins)
sudo dpkg -i gedit-r-plugin_0.8.0.2-Gtk3-Python3-1ubuntu1_all.deb 

# install gedit-source-code-browser-plugin (optional)
sudo apt-get install ctags
sudo dpkg -i gedit-source-code-browser-plugin_3.0.3-3_all.deb

# install gedit-valencia-plugin (optional)

    # unpacking .deb file
    sudo dpkg-deb -R gedit-valencia-plugin_0.8.0-0ubuntu2_amd64.deb tmp

    # edit tmp/DEBIAN/control
    # change 'libvala-0.28-0 (>= 0.15.1)' to 'libvala-0.30-0 (>= 0.15.1)'
    # change 'libvte-2.90-9 (>= 1:0.27.2)' to 'libvte-2.91-0 (>= 0.27.2)'
    sed -e 's/libvala-0\.28-0 (>= 0\.15\.1)/libvala-0.30-0 (>= 0.15.1)/' -e 's/libvte-2\.90-9 (>= 1:0\.27\.2)/libvte-2.91-0 (>= 0.27.2)/' tmp/DEBIAN/control | sudo sponge tmp/DEBIAN/control

    # packing a new .deb file 
    sudo dpkg-deb -b tmp gedit-valencia-plugin_0.8.0-0ubuntu3_amd64.deb

    # changing ownership of the new .deb file replace username with your username
    sudo chown username:username gedit-valencia-plugin_0.8.0-0ubuntu3_amd64.deb

    # removing tmp
    sudo rm -rfv tmp

    # installing it
    sudo dpkg -i gedit-valencia-plugin_0.8.0-0ubuntu3_amd64.deb

# install rabbitvcs-gedit (optional)
sudo apt-get install rabbitvcs-core
sudo dpkg -i rabbitvcs-gedit_0.16-1_all.deb

# install supercollider-gedit (optional)
sudo apt-get install supercollider-language
sudo dpkg -i supercollider-gedit_3.6.6~repack-2-1build1_all.deb

Ahora debe asegurarse de que los paquetes no se cambiarán cuando ejecute una actualización, así que asegúrese de indicar solo los paquetes que ha instalado:

# now protecting this all from upgrading
sudo apt-mark hold gedit-common gedit gedit-dev gedit-developer-plugin gedit-latex-plugin gedit-plugins gedit-r-plugin gedit-source-code-browser-plugin gedit-valencia-plugin rabbitvcs-gedit supercollider-gedit

Para revertir todo el proceso, haga lo siguiente:

# removing protection from upgrades
sudo apt-mark unhold gedit-common gedit gedit-dev gedit-developer-plugin gedit-latex-plugin gedit-plugins gedit-r-plugin gedit-source-code-browser-plugin gedit-valencia-plugin rabbitvcs-gedit supercollider-gedit

# simply do an upgrade
sudo apt-get update
sudo apt-get dist-upgrade

¿Hay un guión para hacerlo ?:

Sí, incluso hice un script para automatizar todo el proceso, puede obtenerlo aquí o:

wget https://github.com/Videonauth/gdowngrade/blob/master/gdowngrade.sh

Luego para ejecutarlo:

chmod 755 ./gdowngrade.sh
sudo ./gdowngrade.sh

Esto creará un archivo personalizado para usted llamado gupgrade.shque le permite revertir todo el proceso simplemente:

sudo ./gupgrade.sh

8

Introducción

El siguiente script automatiza la instalación de gedit 3.10.4 desde la fuente. Permite usar las versiones gedit más antiguas y más nuevas, en caso de que el usuario decida que quiere volver a gedit más nuevas. El script crea /usr/share/applications/gedit_downgraded.desktoppara que también pueda tener un buen acceso directo al gedit anterior.

El uso es muy simple:

sudo ./downgrade_gedit.sh [option]

La opción es -ipara instalar o -udesinstalar

El código fuente también está disponible en mi git, que puedes obtener ejecutando:

git clone https://github.com/SergKolo/sergrep.git

Fuente de script

#!/bin/bash
#
###########################################################
# Author: Serg Kolo , contact: 1047481448@qq.com 
# Date: 
# Purpose: 
#    A script to install version 3.10.4 of gedit on Ubuntu
#    16.04 . Some users are unhappy with new gedit design
#    while others want to downgrade in order to use plugins
#    not available in the new gedit. This script simplifies
#    the downgarde process and building from source.
#    The source is obtained from Gnome's official ftp channels
#    The 3.10.4 is installed separatelly, so if you want to go
#    back to the newer version or used along-side 3.10.4 , you
#    can do so, as the newer version is not uninstalled
# Written for: http://askubuntu.com/q/766055/295286
# Tested on: Ubuntu 16.04
###########################################################
# Copyright: Serg Kolo , 2016
#    
#     Permission to use, copy, modify, and distribute this software is hereby granted
#     without fee, provided that  the copyright notice above and this permission statement
#     appear in all copies.
#
#     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
#     IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
#     FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
#     THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
#     LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
#     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
#     DEALINGS IN THE SOFTWARE.

set -e 
download_gedit()
{
  # Here gnome's official ftp channel is used 
  # feel free to use something else
  # just keep in mind you'd need to make changes to script accordingly
  wget http://ftp.gnome.org/pub/GNOME/sources/gedit/3.10/gedit-3.10.4.tar.xz
}

extract_gedit()
{
 ARCHIVE="gedit-3.10.4.tar.xz"
 tar --extract --xz --verbose --file "$ARCHIVE" && \
 rm "$ARCHIVE"
}


resolve_depends()
{
 apt-get install intltool libenchant-dev libxml2-dev libgtksourceview-3.0-dev gsettings-desktop-schemas-dev  libpeas-dev  itstool libxml2-utils 
}

make_desktop_file()
{
cat > /usr/share/applications/gedit_downgraded.desktop  <<EOF
[Desktop Entry]
Name=Gedit(downgraded)
Type=Application 
Terminal=false
Exec=/usr/local/bin/gedit %U
EOF
}

make_install_gedit()
{

 cd gedit-3.10.4
 ./configure #PKG_CONFIG_PATH="$(pkg-config --variable pc_path pkg-config)"
 make
 make install
}

install()
{
  # If /opt/gedit-3.10.4 doesn't exist, that's a first run
  # otherwise - create the directory, download and extract
  cd /opt
  if [ ! -d "gedit-3.10.4" ] ; then
      mkdir gedit-3.10.4
      download_gedit
      extract_gedit 
  fi
  resolve_depends
  make_install_gedit
  make_desktop_file
  #mark gedit to be held back
  dpkg --set-selections <<< "gedit hold"
}
uninstall()
{
  cd /opt/gedit-3.10.4
  make uninstall
  hash -r
  [ -e /usr/share/applications/gedit_downgraded.desktop  ] && \
     rm /usr/share/applications/gedit_downgraded.desktop
}

parse_args()
{
  local OPTIND option
  while getopts "iu" option
  do
    case ${option} in
         i) install && exit 0 ;;
         u) uninstall && exit 0 ;; 
         \?) echo "Invalid option -${option}" > /dev/stderr  
    esac
  done
}

main()
{

  if [ $# -eq 0 ] ; then
     echo "Must specify -i or -u option" > /dev/stderr
     exit 1
  fi

  if [ $( id -u ) -ne 0 ] ; then
    echo "Must run as root" > /dev/stderr
    exit 1
  else
     parse_args "$@"
  fi
}

main "$@"

3

Actualmente, tiene .debpaquetes con gedit3.10 para Ubuntu 16.04 aquí:

gedit
gedit-common

Puede descargarlos (elija el paquete según su arquitectura) e instalarlos. Por ejemplo:

sudo dpkg -i gedit_3.10.4-0ubuntu13_amd64.deb gedit-common_3.10.4-0ubuntu13_all.deb 

(Este comando desinstalará su versión actual gedite instalará la nueva)

Y tenga cuidado de evitar que las posibles actualizaciones futuras actualicen este paquete (por ejemplo, ponerlos en la lista de espera)

Al usar nuestro sitio, usted reconoce que ha leído y comprende nuestra Política de Cookies y Política de Privacidad.
Licensed under cc by-sa 3.0 with attribution required.