如何将Gedit降级到Ubuntu 16.04 LTS中的先前版本(3.10.4)

正如标题所说:我有一些插件不能与gedit 3.18.3一起运行,它随Ubuntu 16.04 LTS一起提供。

如何降级到Ubuntu 14.04 LTS和Ubuntu 15.10中使用的版本3.10.4并安装所有插件?

如果不再需要3.10.4,如何将其恢复为3.18.3。

解决方案非常复杂,因此请务必仔细阅读并继续操作。 为此做准备,请确保您启用了所有数据包源,以便/etc/apt/sources.list看起来像这样并进行升级:

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

要安装旧版本:

然后,作为第一步,您需要删除现有版本的gedit。 为此,请在终端中运行以下命令( 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 

现在准备一个目录来工作。为方便起见,我们在我们的主目录中这样做。

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

下一步是创建一个wget-list文件以使下载更容易(您可以将整个字段复制并粘贴到终端中)。 如果您不使用64位系统,可能需要在此处找到适用于i386的链接。

 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 

现在你有了wget-list文件,你可以通过输入wget -i wget-list一次性下载所有内容,让文件下载然后开始安装。

请逐一按照以下步骤进行操作,如果遇到依赖错误,只需执行sudo apt-get remove 反映出包装出现问题,然后手动安装依赖项sudo apt-get install 然后再次执行dpkg行。 不要, 我的意思是在你尝试这个sudo apt-get -f install不要运行sudo apt-get -f install :它会搞砸一切。

现在,让我们从必要的软件包开始(测试并使用干净的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 

以下软件包只是可选的,您应该能够轻松安装它们,下载的依赖项将在如上所述的干净的16.04 LTS安装上进行测试和测试。

 # 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 

现在,您必须确保在运行更新时不会更改软件包,因此请确保仅说明已安装的软件包:

 # 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 

要扭转整个过程呢:

 # 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 

有脚本可以吗?:

是的我甚至制作了一个脚本来自动化整个过程,你可以在这里或通过:

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

然后运行它:

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

这将为您创建一个名为gupgrade.sh的自定义文件,它允许您通过以下方式反转整个过程:

 sudo ./gupgrade.sh 

介绍

下面的脚本自动从源代码安装gedit 3.10.4。 它允许使用较旧和较新的gedit版本,以防用户决定他们想要回到更新的gedit。 该脚本创建/usr/share/applications/gedit_downgraded.desktop以便您也可以使用旧版gedit的快捷方式。

用法非常简单:

 sudo ./downgrade_gedit.sh [option] 

选项是-i用于安装或-u用于卸载

我的git上也提供了源代码,您可以通过运行获得:

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

脚本来源

 #!/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 < /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 "$@" 

目前,您在这里使用的是带有gedit 3.10 for Ubuntu 16.04的.deb软件包:

gedit中
gedit中常见

您可以下载它们(根据您的体系结构选择包)并安装。 例如:

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

(此命令将卸载当前版本的gedit并安装新版本)

并注意避免可能的未来更新升级此程序包(例如,将它们保留在保留列表中)