ubuntu10.04将php5.3降级为php5.2方法(sh文件内容)
来源:互联网 发布:长沙java培训 编辑:程序博客网 时间:2024/05/16 12:23
#!/bin/bash
# Originally Posted by Bachstelze http://ubuntuforums.org/showthread.php?p=9080474#post9080474
# OK, here's how to do the Apt magic to get PHP packages from the karmic repositories:
echo "Am I root? "
if [ "$(whoami &2>/dev/null)" != "root" ] && [ "$(id -un &2>/dev/null)" != "root" ] ; then
echo " NO!
Error: You must be root to run this script.
Enter
sudo su
"
exit 1
fi
echo " OK";
# finish all apt-problems:
apt-get -f install
# remove all your existing PHP packages. You can list them with dpkg -l| grep php
PHPLIST=$(for i in $(dpkg -l | grep php|awk '{ print $2 }' ); do echo $i; done)
echo these pachets will be removed: $PHPLIST
# you need not to purge, if you have upgraded from karmic:
aptitude remove $PHPLIST
# on a fresh install, you need purge:
# aptitude remove --purge $PHPLIST
#Create a file each in /etc/apt/preferences.d like this (call it for example /etc/apt/preferences.d/php5_2);
#
#Package: php5
#Pin: release a=karmic
#Pin-Priority: 991
#
#The big problem is that wildcards don't work, so you will need one such stanza for each PHP package you want to pull from karmic:
echo ''>/etc/apt/preferences.d/php5_2
for i in $PHPLIST ; do echo "Package: $i
Pin: release a=karmic
Pin-Priority: 991
">>/etc/apt/preferences.d/php5_2; done
# duplicate your existing sources.list replacing lucid with karmic and save it in sources.list.d:
#sed s/lucid/karmic/g /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/karmic.list
# better exactly only the needed sources, cause otherwise you can get a cachsize problem:
echo "# needed sources vor php5.2:
deb http://de.archive.ubuntu.com/ubuntu/ karmic main restricted
deb-src http://de.archive.ubuntu.com/ubuntu/ karmic main restricted
deb http://de.archive.ubuntu.com/ubuntu/ karmic-updates main restricted
deb-src http://de.archive.ubuntu.com/ubuntu/ karmic-updates main restricted
deb http://de.archive.ubuntu.com/ubuntu/ karmic universe
deb-src http://de.archive.ubuntu.com/ubuntu/ karmic universe
deb http://de.archive.ubuntu.com/ubuntu/ karmic-updates universe
deb-src http://de.archive.ubuntu.com/ubuntu/ karmic-updates universe
deb http://de.archive.ubuntu.com/ubuntu/ karmic multiverse
deb-src http://de.archive.ubuntu.com/ubuntu/ karmic multiverse
deb http://de.archive.ubuntu.com/ubuntu/ karmic-updates multiverse
deb-src http://de.archive.ubuntu.com/ubuntu/ karmic-updates multiverse
deb http://security.ubuntu.com/ubuntu karmic-security main restricted
deb-src http://security.ubuntu.com/ubuntu karmic-security main restricted
deb http://security.ubuntu.com/ubuntu karmic-security universe
deb-src http://security.ubuntu.com/ubuntu karmic-security universe
deb http://security.ubuntu.com/ubuntu karmic-security multiverse
deb-src http://security.ubuntu.com/ubuntu karmic-security multiverse
" >> /etc/apt/sources.list.d/karmic.list
aptitude update
apache2ctl restart
echo install new from karmic:
aptitude -t karmic install $PHPLIST
# at the end retry the modul libapache2-mod-php5 in case it didn't work the first time:
aptitude -t karmic install libapache2-mod-php5
apache2ctl restart
- ubuntu10.04将php5.3降级为php5.2方法(sh文件内容)
- [Ubuntu] 如何在Ubuntu11.04将PHP5.3降级到PHP5.2
- Nginx+Php5-fpm在Ubuntu10.04中的安装配置方法
- nginx+php5-fpm在ubuntu10.04中的安装配置方法
- 将Ubuntu 10.04默认安装的php5.3.2降级到php5.2.x
- php5.3 PHP5.4 PHP5.5 新特性(一)
- php5.3 PHP5.4 PHP5.5 新特性(二)
- php5.3 PHP5.4 PHP5.5 新特性(三)
- php5.3+Apache2.2 配置方法
- PHP5 心得(2)
- PHP5
- Ubuntu10.04安装配置apache2+php5+mysql+phpmyadmin
- Ubuntu10.10下安装黄金组合(Apache2+Mysql+php5+phpmyadmin)
- Ubuntu下php5.5.9降级5.3.x
- ubuntu 16 php7 降级 php5.6
- php5.2
- centOs将php5.3卸载重新安装php
- php5.3升级php5.6
- about_Comparison_Operators
- ADT OO OB 的区别
- Java的@Override注解问题
- 批量写sql
- 删除sqlserver挂起
- ubuntu10.04将php5.3降级为php5.2方法(sh文件内容)
- python写文件
- ArrayList的深浅拷贝。
- ubuntu 10.04 ftp的使用
- ubuntu 使用笔记
- python截串
- 教研科岗位职责
- python获取访问者ip
- shell脚本的制作