Linux 下载安装:weget、yum

来源:互联网 发布:php测试工程师 编辑:程序博客网 时间:2024/06/09 19:03

wget 工具

wget工具用于从指定的URL地址下载文件,wget很稳定同时支持断点下载,在窄带宽和不稳定网络中有很强的适应性;

wget指令常用参数如下:
-h:显示帮助说明;
-b:后台下载;
-c:继续上次终端的下载任务;
-r:递归下载文件

使用示例:

1)下载单个文件

2)下载多个文件

1
wget -i fileList
fileList 内容

3)断点下载

1
wget -c http://search.maven.org/remotecontent?filepath=log4j/log4j/1.2.17/log4j-1.2.17.tar.gz

4)后台下载

5)限速下载

1
wget --limit-rate=400k http://search.maven.org/remotecontent?filepath=log4j/log4j/1.2.17/log4j-1.2.17.tar.gz



yum工具


yum是CentOS下的软件下载安装工具,所有文件在yum源中下载,并自动执行安装过程,这些软件在yum源中以rpm包的形式存在;
对应在Ubuntu,Debian下的工具是 apt-get ,使用用法类似;

1)查看系统中的所有的 rpm 包

2)查看,查找 yum 源中的rpm包

1
yum list         # 列举所有yum源上的安装包
2
yum search java  # 查看yum源上的所有java相关资源

3)安装,删除rpm包

4)更新rpm包

1
yum update           #更新所有rpm包
2
yum update tomcat    #更新指定包tomcat包


※ 如果某些rpm在yum中查找到的版本过低,找不到需要的包,可以更新epel 和 remi源 
此时的查看,安装remi源的rpm包,指令如下(以下载php5.6为例)
1
#查看remi源上的php相关的包
2
yum list --enablerepo=remi --enablerepo=remi-php56 | grep php  
3
4
#安装remi源上的php5.6的所有运行包
5
yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof