本文共 3671 字,大约阅读时间需要 12 分钟。
Linux安装软件有三种方式
rpm工具使用
首先在vmw 中把光盘连接到Linux中 然后进行光盘挂载
[root@localhost ~]# df -h "查看已挂载磁盘的总容量,并已合适的单位显示 h为GB, 目的是为了查看是不是已挂载“
文件系统 容量 已用 可用 已用% 挂载点 /dev/sda3 18G 1.1G 17G 6% / devtmpfs 489M 0 489M 0% /dev tmpfs 494M 0 494M 0% /dev/shm tmpfs 494M 6.7M 487M 2% /run tmpfs 494M 0 494M 0% /sys/fs/cgroup /dev/sda1 197M 75M 123M 38% /boot挂载 [root@localhost ~]# mount /dev/cdrom /mnt mount: /dev/sr0 写保护,将以只读方式挂载rpm包格式 包名 版本号 发行版本号、平台rpm -ivh /包名 表示安装
[root@localhost Packages]# rpm -ivh zsh-5.0.2-7.el7.x86_64.rpm 准备中... ################################# [100%] 正在升级/安装... 1:zsh-5.0.2-7.el7 ################################# [100%] ** rpm -Uvh 包名 :升级 [root@localhost Packages]# rpm -Uvh zsh-5.0.2-7.el7.x86_64.rpm 准备中... ################################# [100%] 软件包 zsh-5.0.2-7.el7.x86_64 已经安装rpm -e 包名 /卸载
[root@localhost Packages]# rpm -e zshrpm -qa 查询安装地包
[root@localhost Packages]# rpm -qa biosdevname-0.5.0-10.el7.x86_64 centos-release-7-0.1406.el7.centos.2.3.x86_64 openssh-server-6.4p1-8.el7.x86_64 filesystem-3.2-18.el7.x86_64 parted-3.1-17.el7.x86_64 ncurses-base-5.9-13.20130511.el7.noarch selinux-policy-targeted-3.12.1-153.el7.noarchrpm -q 包名 查询已安装的包
[root@localhost Packages]# rpm -q ppp ppp-2.4.5-33.el7.x86_64rpm -qi 包名 查询指定包信息
[root@localhost Packages]# rpm -q ppp ppp-2.4.5-33.el7.x86_64 [root@localhost Packages]# ^C [root@localhost Packages]# rpm -qi ppp Name : ppp Version : 2.4.5 Release : 33.el7 Architecture: x86_64 Install Date: 2017年12月28日 星期四 06时49分55秒 Group : System Environment/Daemons Size : 872624 License : BSD and LGPLv2+ and GPLv2+ and Public Domain Signature : RSA/SHA256, 2014年07月04日 星期五 12时34分15秒, Key ID 24c6a8a7f4a80eb5 Source RPM : ppp-2.4.5-33.el7.src.rpm Build Date : 2014年06月10日 星期二 14时27分03秒 Build Host : worker1.bsys.centos.org Relocations : (not relocatable) Packager : CentOS BuildSystem <; Vendor : CentOS URL : Summary : The Point-to-Point Protocol daemon Description : The ppp package contains the PPP (Point-to-Point Protocol) daemon and documentation for PPP support. The PPP protocol provides a method for transmitting datagrams over serial point-to-point links. PPP is usually used to dial in to an ISP (Internet Service Provider) or other organization over a modem and phone line.[root@localhost Packages]# rpm -q ppp
ppp-2.4.5-33.el7.x86_64 [root@localhost Packages]# ^C [root@localhost Packages]# rpm -qi ppp Name : ppp Version : 2.4.5 Release : 33.el7 Architecture: x86_64 Install Date: 2017年12月28日 星期四 06时49分55秒 Group : System Environment/Daemons Size : 872624 License : BSD and LGPLv2+ and GPLv2+ and Public Domain Signature : RSA/SHA256, 2014年07月04日 星期五 12时34分15秒, Key ID 24c6a8a7f4a80eb5 Source RPM : ppp-2.4.5-33.el7.src.rpm Build Date : 2014年06月10日 星期二 14时27分03秒 Build Host : worker1.bsys.centos.org Relocations : (not relocatable) Packager : CentOS BuildSystem <; Vendor : CentOS URL : Summary : The Point-to-Point Protocol daemon Description : The ppp package contains the PPP (Point-to-Point Protocol) daemon and documentation for PPP support. The PPP protocol provides a method for transmitting datagrams over serial point-to-point links. PPP is usually used to dial in to an ISP (Internet Service Provider) or other organization over a modem and phone line.rpm -ql 包名 // 列出包安装地文件
rpm -qf 文件绝对路劲 //查看文件是由哪个包安装 [root@localhost Packages]# rpm -qfwhich cd
bash-4.2.45-5.el7.x86_64 yum 工具
yum list 列出可用的rpm包yum search [相关关键词] 搜索rpm 包
yum install -y [rpm包] 安装rpm包
yum remove -y [rpm] 卸载rpm包
yum update -y [rpm] 升级rpm包
yum provides "//vim" 搜素
yum 本地仓库
本文转自 yzllinux 51CTO博客,原文链接:http://blog.51cto.com/12947851/2058330,如需转载请自行联系原作者