linux yum怎么linux rz sz 安装 yum及过程

一、什么是Yum
&&& Yum的全称为 Yellowdog
Modifier,其主要目的是为了解决RPM包安装时的依赖关系的问题。yum只是一个用于安装的前端工具,其主要的服务对象还是RPM。
二、yum配置
&&&&&&& 1、主(中心配置文件):/etc/yum.conf。
&&&&&&&&&&&& 通常不需要进行修改,保持其默认配置即可。
&&&&&&& 2、提供repo配置文件,指明仓库访问路径及各种属性信息。
&&&&&&&&&&&& 在目录/etc/yum.repos.d/目录中创建.repo文件,其格式如下:
&&&&&&&&&&&&&&& [REPOID]&&&&&&&&&&&&&&& 任意字符即可;
&&&&&&&&&&&&&&& name=自定义&&&&&&&& 任意字符即可;
&&&&&&&&&&&&&&& baseurl=ftp://&&&&&&& 指明yum仓库的位置,支持的类型包括ftp,nfs,http,file;
&&&&&&&&&&&&&&&&&&&&&&& file:///&&&&&&&&&&&& 当用多个yum仓库时,可在每一行指定一个baseurl;
&&&&&&&&&&&&&&& enabled={0|1}&&&&&&& 是否启用此repo的配置,默认为enabled=1;
&&&&&&&&&&&&&&& gpgcheck={0|1}&&&&& 是否启用校验;
&&&&&&&&&&&&&&& gpgkey=URL&&&&&&&&&& 如启用校验,应指明密钥的位置;
&&&&&&&&&&&&&&& cost={1..n}&&&&&&&&&&&&&& 默认为1000,指定访问此仓库的开销;
&&&&&&&&&&& 如下这是我系统中自定的yum源:
[root@deanzhu s]# cat /etc/yum.repos.d/epel.repo
[epel]name=Extra Packages for Enterprise
6 - $basearch#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearchmirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearchfailovermethod=priorityenabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
&&&&&&&&& 3、yum的repo配置文件中可用的变量所表达的意义:
$releasever: 的版本,对Yum而言指的是redhat-release版本;只替换为主,如RedHat 6.5,则替换为6;
&&&&&&&&& $arch: 系统架构
&&&&&&&&& $basearch: 系统基本架构,如i686,i586等的基本架构为i386;
&&&&&&&&& $uuid:
&&&&&&&&& $YUM0-9: 在系统中定义的环境变量,可以在yum中使用;
三、yum客户端常用命令的使用
&&&&& 1、 显示仓库列表
[root@ yum.repos.d]# yum repolist all
#显示所有仓库信息
&&&& 显示所有程序包:yum list
yum list [all | glob_exp1] [glob_exp2] [...]
&&&& 可以使用通配符
&&&&&& 如:
[root@localhost ~]# yum list zsh*
#显示所有出现zsh的软件包Loaded plugins: fastestmirror, refresh-packagekit, securityLoading mirror speeds from cached hostfileAvailable Packageszsh.x86_64
4.3.10-7.el6
zsh-html.x86_64
4.3.10-7.el6
yum list&& [available|installed|updates]&&& [glob_exp1] [...]&
可用的 :已安装的: 可升级的
2、安装程序包:yum install
&&&&& install package1 [package2] [...]
&&&&& 如:
[root@localhost Packages]# yum install gcc
#安装gcc包Loaded plugins: fastestmirror, refresh-packagekit, securitySetting up Install ProcessLoading mirror speeds from cached hostfileResolving Dependencies--& Running transaction check---& Package gcc.x86_64 0:4.4.7-11.el6 will be installed--& Processing Dependency: cpp = 4.4.7-11.el6 for package: gcc-4.4.7-11.el6.x86_64--& Processing Dependency: cloog-ppl &= 0.15 for package: gcc-4.4.7-11.el6.x86_64--& Running transaction check---& Package cloog-ppl.x86_64 0:0.15.7-1.2.el6 will be installed--& Processing Dependency: libppl_c.so.2()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64--& Processing Dependency: libppl.so.7()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64---& Package cpp.x86_64 0:4.4.7-11.el6 will be installed--& Processing Dependency: libmpfr.so.1()(64bit) for package: cpp-4.4.7-11.el6.x86_64--& Running transaction check---& Package mpfr.x86_64 0:2.4.1-6.el6 will be installed---& Package ppl.x86_64 0:0.10.2-11.el6 will be installed--& Finished Dependency Resolution&Dependencies Resolved&================================================================================= Package
Repository
Size=================================================================================Installing: gcc
4.4.7-11.el6
10 MInstalling for dependencies: cloog-ppl
0.15.7-1.2.el6
4.4.7-11.el6
3.7 M mpfr
2.4.1-6.el6
0.10.2-11.el6
1.3 M&Transaction Summary
#上面说明安装gcc所依赖的包=================================================================================Install
5 Package(s)&Total download size: 15 MInstalled size: 33 MIs this ok [y/N]: y
#选择yes,和面会把和gcc依赖的那4个包也一并安装了Downloading Packages:---------------------------------------------------------------------------------Total
Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning Transaction
Installing : mpfr-2.4.1-6.el6.x86_64
Installing : cpp-4.4.7-11.el6.x86_64
Installing : ppl-0.10.2-11.el6.x86_64
Installing : cloog-ppl-0.15.7-1.2.el6.x86_64
Installing : gcc-4.4.7-11.el6.x86_64
: ppl-0.10.2-11.el6.x86_64
: cpp-4.4.7-11.el6.x86_64
: gcc-4.4.7-11.el6.x86_64
: cloog-ppl-0.15.7-1.2.el6.x86_64
: mpfr-2.4.1-6.el6.x86_64
5/5 &Installed:
gcc.x86_64 0:4.4.7-11.el6
&Dependency Installed:
cloog-ppl.x86_64 0:0.15.7-1.2.el6
cpp.x86_64 0:4.4.7-11.el6
mpfr.x86_64 0:2.4.1-6.el6
ppl.x86_64 0:0.10.2-11.el6
&Complete!
&& yum reinstall package1 [package2] [...]
如果需要安装老版本需要指定版本号
3、升级程序包:
&&&&&&&&&&&&&&&&&& yum update package1 [package2] [...]
4 、检查可有升级包:
&&&&&&&&&&&&&&&&& yum check-update
5、卸载程序包:
&&&&&&&&& yum& remove | erase package1 [package2] [...]
[root@deanzhu repo]# yum remove gcc -y
#卸载gccLoaded plugins: fastestmirror, refresh-packagekit, securitySetting up Remove ProcessResolving Dependencies--& Running transaction check---& Package gcc.x86_64 0:4.4.7-11.el6 will be erased--& Finished Dependency Resolution&Dependencies Resolved&================================================================================= Package
Repository
Size=================================================================================Removing: gcc
4.4.7-11.el6
19 M&Transaction Summary=================================================================================Remove
1 Package(s)&Installed size: 19 MDownloading Packages:Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning Transaction
: gcc-4.4.7-11.el6.x86_64
: gcc-4.4.7-11.el6.x86_64
1/1 &Removed:
gcc.x86_64 0:4.4.7-11.el6
&Complete![root@deanzhu repo]#
注:依赖包都会被卸载
6、查看程序包的信息
&&&&&&&&&&&&&&&&&&&&& yum&&& info [...]
[root@localhost Packages]# yum info gcc
#查看gcc程序包的信息Loaded plugins: fastestmirror, refresh-packagekit, securityLoading mirror speeds from cached hostfileInstalled PackagesName
: x86_64Version
: 4.4.7Release
: 11.el6Size
: 19 MRepo
: installedFrom repo
: dvdSummary
: Various compilers (C, C++, Objective-C, , ...)URL
: http://gcc.gnu.orgLicense
: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptionsDescription : The gcc package contains the GNU Compiler Collection version 4.4.
: You'll need this package in order to compile C code.
7、查看指定的特性是由哪个哪个程序包提供的
&&&&&&&&&&&&&& yum provides | whatprovides feature1 [feature2] [...]
[root@deanzhu repo]# yum provides /usr/bin/yum
#查询/usr/bin/yum这个文件是由哪个包Loaded plugins: fastestmirror, refresh-packagekit, securityLoading mirror speeds from cached hostfile * epel: ftp.cuhk.edu.hkyum-3.2.29-60.el6.centos.noarch : RPM package installer/updater/manager
#这里提示的生成这个文件的包Repo
: installedMatched from:Other
: Provides-match: /usr/bin/yum&
8、清理被动缓存:
&&&&&&&&&&&&& yum clean [ packages | metadata | expire-cache | rpmdb | plugins | all ]
[root@deanzhu yum.repos.d]# yum clean allLoaded plugins: fastestmirror, refresh-packagekit, securityCleaning repos: DVD epel mageeduepel room xen4centosCleaning up EverythingCleaning up list of fastest mirrors
9、构建缓存
&&&&&&&&&&&&& yum& makecache
[root@deanzhu repo]# yum makecacheLoaded plugins: fastestmirror, refresh-packagekit, securityLoading mirror speeds from cached hostfileepel/metalink
* epel: ftp.cuhk.edu.hkepel/group_gz
epel/filelists_db
epel/updateinfo
http://ftp.cuhk.edu.hk/pub/linux/fedora-epel/6/x86_64/repodata/ead41b011f970edbe506c74f25a37dc5249-other.sqlite.bz2: [Errno 12] Timeout on http://ftp.cuhk.edu.hk/pub/linux/fedora-epel/6/x86_64/repodata/ead41b011f970edbe506c74f25a37dc5249-other.sqlite.bz2: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds')Trying other mirror.epel/other_db
Metadata Cache Created
四、创建本地yum源
[root@deanzhu Packages]# mkdir -p /yum/repo/
#创建目录/yum/repo[root@deanzhu Packages]# cp /mnt/Packages/*.rpm /yum/repo/
#拷贝/mnt/Packages下所有已.rpm结尾的文件到/yum/repo目录下[root@deanzhu ~]# man createrepo
#man下createrepo这个命令,提示系统上没有这个命令,那么我们需要安装下,以下是安装步骤
No manual entry for createrepo[root@deanzhu Packages]# yum install createrepo-0.9.9-22.el6.noarch.rpm #安装creterepo这个程序Loaded plugins: fastestmirror, refresh-packagekit, securitySetting up Install ProcessExamining createrepo-0.9.9-22.el6.noarch.rpm: createrepo-0.9.9-22.el6.noarchMarking createrepo-0.9.9-22.el6.noarch.rpm to be installedLoading mirror speeds from cached hostfile * epel: ftp.cuhk.edu.hkResolving Dependencies--& Running transaction check---& Package createrepo.noarch 0:0.9.9-22.el6 will be installed--& Processing Dependency: -deltarpm for package: createrepo-0.9.9-22.el6.noarch--& Running transaction check---& Package python-deltarpm.x86_64 0:3.5-0.5.git.el6 will be installed--& Processing Dependency: deltarpm = 3.5-0.5.git.el6 for package: python-deltarpm-3.5-0.5.git.el6.x86_64--& Running transaction check---& Package deltarpm.x86_64 0:3.5-0.5.git.el6 will be installed--& Finished Dependency Resolution&Dependencies Resolved&================================================================================= Package
Repository
Size=================================================================================Installing: createrepo noarch 0.9.9-22.el6
/createrepo-0.9.9-22.el6.noarch 291 kInstalling for dependencies: deltarpm
x86_64 3.5-0.5.git.el6 DVD
71 k python-deltarpm
x86_64 3.5-0.5.git.el6 DVD
27 k&Transaction Summary=================================================================================Install
3 Package(s)&Total size: 388 kTotal download size: 98 kInstalled size: 520 kIs this ok [y/N]: yDownloading Packages:---------------------------------------------------------------------------------Total
2.3 MB/s |
Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning Transaction
Installing : deltarpm-3.5-0.5.git.el6.x86_64
Installing : python-deltarpm-3.5-0.5.git.el6.x86_64
Installing : createrepo-0.9.9-22.el6.noarch
: python-deltarpm-3.5-0.5.git.el6.x86_64
: createrepo-0.9.9-22.el6.noarch
: deltarpm-3.5-0.5.git.el6.x86_64
3/3 &Installed:
createrepo.noarch 0:0.9.9-22.el6
&Dependency Installed:
deltarpm.x86_64 0:3.5-0.5.git.el6
python-deltarpm.x86_64 0:3.5-0.5.git.el6
&Complete![root@deanzhu repo]# createrepo ./
#cd到/yum/repo目录下将repo目录下的rmp包使用createrepo命令创建出repodata这个文件Spawning worker 0 with 4184 pkgsWorkers FinishedGathering worker results&Saving Primary metadataSaving file lists metadataSaving other metadataGenerating sqlite DBsSqlite DBs complete
#这里提示我们创建完成[root@deanzhu repo]# cd repodata/
#cd到repodata目录下查看里面的文件,这样我们的一个本地yum仓库就创建好了[root@deanzhu repodata]# lsebaec916cffe542cca5e756b-filelists.sqlite.bz238d0b586da870d4e99b180c00e60fbb3c96cf4a2f520e-other.xml.gz5d46c2eb252e808ec42d6c1b717bdc0744bcad78f3885cdd3542cd29-primary.xml.gzacce1185959aef63665ade1d8c7bf69d01ad60a5a6caf834fb26ac-filelists.xml.gzc212bdef68a2fa09f321bc217bb5dfe3be083f86f9502-other.sqlite.bz2da57facc391bf91a74fd2600-primary.sqlite.bz2repomd.xml&
[root@deanzhu yum.repos.d]# yum repolist
#重载yum仓库Loaded plugins: fastestmirror, refresh-packagekit, securityLoading mirror speeds from cached hostfile * epel: ftp.cuhk.edu.hkhttp://172.16.0.1/fedora-epel/6/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://172.16.0.1/fedora-epel/6/x86_64/repodata/repomd.xml: (28, 'connect() timed out!')Trying other mirror.http://172.16.0.1/cobbler/ks_mirror/CentOS-6.6-x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://172.16.0.1/cobbler/ks_mirror/CentOS-6.6-x86_64/repodata/repomd.xml: (28, 'connect() timed out!')Trying other mirror.xen4centos
00:00 ... xen4centos/primary_db
00:00 ... repo id
Extra Packages for Enterprise Linux 6 - x86_64
11,764mageeduepel
12,922room
dream room
4,184xen4centos
Xen4 CentOS
#这边可以查看到我们新建的yum仓库已经可以使用了repolist: 39,572[root@deanzhu yum.repos.d]# cat rom.repo
#我们查看下我们对仓库的定义[room]name=dream roombaseurl=http://172.16.0.1/cobbler/ks_mirror/CentOS-6.6-x86_64/gpgcheck=0&&&[mageeduepel]baseurl=http://172.16.0.1/fedora-epel/6/x86_64/gpgcheck=0&&&[xen4centos]
#这边是我们对新仓库的定义内容name=Xen4 CentOSbaseurl=file:///yum/repogpgcheck=0
如上我们一个本地的yum仓库就创建好了,其中createrepo命令还有很多选项,我们这边不常用,所有已就不介绍了
五、程序包编译安装
&&&&& 1、为何进行程序包编译
&&&& (1)、找不到何事的程序包
&&&& (2)、每一个程序包在编译的时候也许有20个程序包,但是只编译了前面10个,我们要用到后面10个的时候,所有只有编译安装了。
&&&&& rpm包有2种格式:
&&&&&&&&&& 编译好的rpm包
&&&&&&&&&& 源码rpm包
&&&&& 未编译的rpm包格式:testapp-VERSION-release.src.rpm&&& 其中有src.rpm中src是不知道你的程序包需要安装在什么平台之上的。
&&&&& 2、C代码编译安装三步骤:
./configure:
(1) 通过选项传递参数,指定启用特性、安装路径等;执行时会参考用户的指定以及Makefile.in文件生成makefile;
(2) 检查依赖到的外部环境;
根据makefile文件,构建;
make install
&&&& 3、事例如何编译Apache程序包:
&&&&&&&&&& (1)、准备编译环境
开发工具:make, gcc等
开发环境:开发库,头文件
glibc:标准库
&&&&&&&&&&&&&&&&& 那么我们如何获得这个工具可以通过安装“包组”提供开发组件,安装的“包组”如下
&& CentOS 6: &Development Tools&, &Server Platform Development&,
&&&&&&&&&&&&&&&&&& 这样我们的环境就准备好了
&&&&&&&&&& (2)、操作
[root@deanzhu ~]# cd /mnt/
#首先们要先下载一个程序包,我这边的httpd-2.2.31.tar.bz2是从网上下载的[root@deanzhu mnt]# ls httpd-2.2.31.tar.bz2[root@deanzhu mnt]# tra xf httpd-2.2.31.tar.bz2 #解压程序包[root@deanzhu mnt]# lshttpd-2.2.31
httpd-2.2.31.tar.bz2[root@deanzhu mnt]# cd httpd-2.2.31[root@deanzhu httpd-2.2.31]# ls
#查看httpd-2.2.31里面的文件ABOUT_APACHE
BuildBin.dsp
config.log
modules.lo
srclibacinclude.m4
config.nice
emacs-style
httpd.spec
libhttpd.dep
Makefile.in
README.platforms
supportApache.dsw
buildmark.o
config.status
libhttpd.dsp
Makefile.win
README-win32.txt
libhttpd.mak
NWGNUmakefile
VERSIONINGBuildAll.dsp
config.layout
configure.in
InstallBin.dsp
server[root@deanzhu httpd-2.2.31]# less INSTALL
#查看INSTALL里面的文件
APACHE INSTALLATION OVERVIEW&
Quick Start - Unix
------------------&
For complete installation documentation, see [ht]docs/manual/install.html or
http://httpd.apache.org/docs/2.2/install.html&
$ ./configure --prefix=PREFIX
#这里提示了我们需要安装的步骤
$ make install
$ PREFIX/bin/apachectl start
对于./configure 这个脚本有很多的选项,我们可以使用./configure --help去查看
[root@deanzhu httpd-2.2.31]# ./configure --help
这边选项太多,就不一一列出了,只写几个常用的选项
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 安装路径设定:
--prefix=/PATH/TO/SOMEWHERE: 指定默认安装位置;默认为/usr/local/
--sysconfdir=/PATH/TO/SOMEWHERE:配置文件安装位置;
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& Optional Features: 可选特性
--disable-FEATURE
--enable-FEATURE[=ARG]
& Optional Packages: 可选包
--with-PACKAGE[=ARG]
--without-PACKAGE
[root@deanzhu httpd-2.2.31]# ./configure --prefix=/usr/local/apache2 #指定安装路径 第一步[root@deanzhu httpd-2.2.31]# make
#执行第二步make[root@deanzhu httpd-2.2.31]# make install
#执行第三步make install 这样程序就安装完成了[root@deanzhu httpd-2.2.31]# cd /usr/local/apache2/ #切换到apache2目录下[root@deanzhu apache2]# ls bin
#查看bin下的文件ab
apu-1-config
htcacheclean
logresolveapachectl
rotatelogsapr-1-config
envvars-std
[root@deanzhu apache2]# bin/apachectl start
#执行bin下的apachectl这个脚本[root@deanzhu apache2]# netstat -tan
connections (servers and established)Proto Recv-Q Send-Q Local Address
Foreign Address
0 0.0.0.0:22
0 127.0.0.1:631
0 127.0.0.1:25
0 127.0.0.1:6010
0 127.0.0.1:6011
0 0.0.0.0:58427
0 127.0.0.1:6013
0 0.0.0.0:111
0 192.168.0.18:22
192.168.0.23:51983
ESTALISHED tcp
0 192.168.0.18:22
192.168.0.23:52830
ESTALISHED tcp
0 192.168.0.18:22
192.168.0.23:52990
ESTALISHED tcp
0 ::1:6010
0 ::1:6011
0 ::1:6013
0 :::57027
#80端口处于监听状态,我们的服务以及启动了
650) this.width=650;" style="background-image: border-bottom: 0 border-left: 0 padding-left: 0 padding-right: 0
border-top: 0 border-right: 0 padding-top: 0px" title="0f91bb5c-c881-4fc2-2d6e381" border="0" alt="0f91bb5c-c881-4fc2-2d6e381" src="/upload/images//8091.jpg" "244" height="108" />
#在上输入我们的这样就可以看到
& 4、完成上面一些操作后我们还需要对一些文件进行修改
安装后的配置:
(1) 导出程序目录至PATH环境变量中;
编辑文件/etc/profile.d/NAME.sh
export PATH=/PATH/TO/BIN:$PATH
[root@deanzhu ld.so.conf.d]# cd /etc/profile.d/[root@deanzhu profile.d]# lscolorls.csh
vim.cshcolorls.sh
gnome-ssh-askpass.csh
vim.shcvs.csh
gnome-ssh-askpass.sh
which2.shcvs.sh
qt.shglib2.csh
udisks-bash-completion.sh[root@deanzhu profile.d]# vim apache2.sh[root@deanzhu profile.d]# cat apache2.sh export PATH=/usr/local/apache2/bin:$PATH
(2) 导出库文件路径
编辑/etc/ld.so.conf.d/NAME.conf
添加新的库文件所在目录至此文件中;
[root@deanzhu ~]# cd /etc/ld.so.conf.d/[root@deanzhu ld.so.conf.d]# lskernel-2.6.32-504.el6.x86_64.conf
qt-x86_64.conf-x86_64.conf
xulrunner-64.conf[root@deanzhu ld.so.conf.d]# vim apache2.conf
#新建一个文件存放apache2库文件路径[root@deanzhu ld.so.conf.d]# cat apache2.conf /usr/local/apache2/lib
&&&&&&&&&&&&&&&&&&&&&&&&&&& 让系统重新生成缓存:
ldconfig [-v]
(3) 导出头文件
基于链接的方式实现:
(4) 导出帮助手册
编辑/etc/man.config文件
添加一个MANPATH
这样我们一个程序的编译安装就好了。
六、总结。
在以上的学习中,发现最难得还是rpm包的编译安装,有些地方还是不太懂,不过rpm包的编译安装需要用到好多的点,这样又可以把之前所有学的再复习一遍,感觉这种方法不错的。CentOS安装memcache的yum方法附图文介绍 | Linux |
_数据库_运维_开发_IT学习_无忧IT学习网
一起学习!一起进步!
CentOS安装memcache的yum方法附图文介绍
浏览: 1,722 views
yum search memcached
有了,可以进行安装了
yum -y install memcached
memcache关联php
yum -y install php-pecl-mem...
yum search memcached
有了,可以进行安装了
yum -y install memcached
memcache关联
yum -y install -pecl-memcache
验证安装结果
memcached -h
-m | grep memcache
参数说明:
-d选项是启动一个守护进程;
-m是分配给memcache使用的内存数量,单位是mB,我这里是100mB;
-u是运行memcache的用户,我这里是root;
-l是监听的IP地址我这里指定了的IP地址192.168.0.100;
-p是设置memcache监听的端口,我这里设置了11211,最好是1024以上的端口;
-c选项是最大运行的并发连接数,默认是1024,我这里设置了512,按照你的负载量来设定;
-P是设置保存memcache的pid文件,我这里是保存在 /tmp/memcached.pid;
memcache的基本设置
启动memcache的服务端:
memcached -d -m 100 -u root -l 192.168.0.100 -p 11211 -c 512 -P /tmp/memcached.pid
需要扩展,就用下面这个命令
pecl install memcache
少size,运行yum install -devel
把.ini中的extension_dir = &./&修改为
extension_dir = &/usr/local//lib//extensions/no-debug-non-zts-2007xxxx/&
#注释掉:添加一行来载入memcache扩展:extension=memcache.so
以上是探针显示。
设置开机启动
chkconfig memcached on
启动和停止
service memcached start | stop
/etc/init.d/memcached start | stop
Memcache环境测试:
运行下面的文件,如果有输出This is a test!,就表示环境搭建成功。开始领略Memcache的魅力把!
$mem = new M
$mem-&connect(&127.0.0.1&P, 11211);
$mem-&set(&key&, &This is a test!&, 0, 60);
$val = $mem-&get(&key&);
& | & & | & & | & & | & & | & & | & & | & & | & & | & & | & & | & & | & & | &
最热门文章
31802 views
9788 views
6224 views
3858 views
3355 views
2982 views
2928 views
2512 views
友情链接 |
本站进行137次查询扫扫二维码,随身浏览文档
手机或平板扫扫即可继续访问
linux软件安装概述rpm和tar及yum
举报该文档为侵权文档。
举报该文档含有违规或不良信息。
反馈该文档无法正常浏览。
举报该文档为重复文档。
推荐理由:
将文档分享至:
分享完整地址
文档地址:
粘贴到BBS或博客
flash地址:
支持嵌入FLASH地址的网站使用
html代码:
&embed src='/DocinViewer-4.swf' width='100%' height='600' type=application/x-shockwave-flash ALLOWFULLSCREEN='true' ALLOWSCRIPTACCESS='always'&&/embed&
450px*300px480px*400px650px*490px
支持嵌入HTML代码的网站使用
您的内容已经提交成功
您所提交的内容需要审核后才能发布,请您等待!
3秒自动关闭窗口Centos使用yum安装gd库过程全解
在Centos系统安装完成之后,在配置环境的过程中往往需要gd库的运行,特别是用来处理图片的API,或是使用GD库来生成图片、处理图片等等,都是需要gd库的支持的!
GD库的作用:
GD库可以用来生成缩略图、针对图片加水印、用汉字来生成验证码,或是对网站数据生成报表等。
GD库的安装:
我们可以直接使用yum命令来安装,自动解决依赖关系及安装GD库相关的包。
[root@localhost ~]# yum install php-gd*
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
&* base: mirrors.
&* extras: centos.
&* updates: mirrors.
adobe-linux-x86_64 & & & & & & & & & & & & & & & & & & & & & & & & & &| &951 B & & 00:00 & &&
adobe-linux-x86_64/primary & & & & & & & & & & & & & & & & & & & & & &| 1.2 kB & & 00:00 & &&
adobe-linux-x86_64 & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & 2/2
base & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & &| 3.7 kB & & 00:00 & &&
extras & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & &| 3.4 kB & & 00:00 & &&
extras/primary_db & & & & & & & & & & & & & & & & & & & & & & & & & & | &29 kB & & 00:00 & &&
updates & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & | 3.4 kB & & 00:00 & &&
Setting up Install Process
Resolving Dependencies
--& Running transaction check
---& Package php-gd.x86_64 0:5.3.3-27.el6_5 will be updated
---& Package php-gd.x86_64 0:5.3.3-40.el6_6 will be an update
--& Processing Dependency: php-common(x86-64) = 5.3.3-40.el6_6 for package: php-gd-5.3.3-40.el6_6.x86_64
--& Running transaction check
---& Package php-common.x86_64 0:5.3.3-27.el6_5 will be updated
---& Package php-common.x86_64 0:5.3.3-40.el6_6 will be an update
--& Finished Dependency Resolution
Dependencies Resolved
=============================================================================================
&Package & & & & & & & Arch & & & & & & &Version & & & & & & & & & &Repository & & & & &Size
=============================================================================================
&php-gd & & & & & & & &x86_64 & & & & & &5.3.3-40.el6_6 & & & & & & updates & & & & & &109 k
Updating for dependencies:
&php-common & & & & & &x86_64 & & & & & &5.3.3-40.el6_6 & & & & & & updates & & & & & &527 k
Transaction Summary
=============================================================================================
Upgrade & & & 2 Package(s)
Total download size: 636 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): php-common-5.3.3-40.el6_6.x86_64.rpm & & & & & & & & & & & & & | 527 kB & & 00:00 & &&
(2/2): php-gd-5.3.3-40.el6_6.x86_64.rpm & & & & & & & & & & & & & & & | 109 kB & & 00:00 & &&
---------------------------------------------------------------------------------------------
Total & & & & & & & & & & & & & & & & & & & & & & & & & & & &1.3 MB/s | 636 kB & & 00:00 & &&
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
& Updating & : php-common-5.3.3-40.el6_6.x86_64 & & & & & & & & & & & & & & & & & & & & &1/4&
& Updating & : php-gd-5.3.3-40.el6_6.x86_64 & & & & & & & & & & & & & & & & & & & & & & &2/4&
& Cleanup & &: php-gd-5.3.3-27.el6_5.x86_64 & & & & & & & & & & & & & & & & & & & & & & &3/4&
& Cleanup & &: php-common-5.3.3-27.el6_5.x86_64 & & & & & & & & & & & & & & & & & & & & &4/4&
& Verifying &: php-gd-5.3.3-40.el6_6.x86_64 & & & & & & & & & & & & & & & & & & & & & & &1/4&
& Verifying &: php-common-5.3.3-40.el6_6.x86_64 & & & & & & & & & & & & & & & & & & & & &2/4&
& Verifying &: php-gd-5.3.3-27.el6_5.x86_64 & & & & & & & & & & & & & & & & & & & & & & &3/4&
& Verifying &: php-common-5.3.3-27.el6_5.x86_64 & & & & & & & & & & & & & & & & & & & & &4/4&
& php-gd.x86_64 0:5.3.3-40.el6_6 & & & & & & & & & & & & & & & & & & & & & & & & & & & & & &&
Dependency Updated:
& php-common.x86_64 0:5.3.3-40.el6_6 & & & & & & & & & & & & & & & & & & & & & & & & & & & &&
安装完成之后,gd库就已经安装到你的Centos系统中啦!
下一篇:没有了
其他类似的新闻
● ● ● ● ● ● ● ● ● ●
其他相关的新闻
获取更多淘宝免单秒杀活动加QQ群:
最新热点新闻
小伙伴最爱的新闻
小伙伴还关注了以下信息
小伙伴关注的焦点
小伙伴都在关注的热门词
Copyright (C) 2006- Inc. All Rights Reserved
孝感风信信息技术有限公司 ● 版权所有

我要回帖

更多关于 linux yum安装jdk 的文章

 

随机推荐