Linux-RPM和及YUM安装命令

这篇博客介绍了在Linux系统中,如何使用RPM和YUM命令进行软件安装和管理。通过示例展示了`rpm -ivh`安装RPM包,`rpm -qa`查询已安装软件,`yum install`更新和安装软件的过程,以及如何备份和恢复YUM仓库配置。此外,还演示了`yum clean all`清理缓存和`yum makecache`生成缓存的操作。
摘要由CSDN通过智能技术生成

[root@centos7-1 ~]# ll
总用量 286436
-rw-r--r--  1 root  root          0 11月 22 13:54 a
-rw-r--r--  1 root  root          0 11月 22 13:54 ab
-rw-r--r--  1 root  root          0 11月 22 13:54 abc
-rw-r--r--  1 root  root        135 11月 27 17:34 awk.txt
-rw-r--r--  1 root  root        111 11月 22 15:50 grep.txt
-rw-r--r--  1 root  root        511 11月 24 00:11 inittab
-rw-r--r--  1 root  root  138090286 11月 28 18:02 jdk-7u80-linux-x64.rpm
-rw-r--r--  1 root  root  153530841 11月 28 18:02 jdk-7u80-linux-x64.tar.gz
-rw-r--r--  1 root  root       2347 11月 27 16:49 passwd
-rwxr-xr-x  1 root  root       1833 11月 22 12:28 profile
-rw-r--r--  1 root  root         38 11月 24 00:09 sort.txt
drwxr-xr-x 12 50469 users      4096 11月 28 18:38 tengine-2.1.0
-rw-r--r--  1 root  root    1653240 11月 28 18:02 tengine-2.1.0.tar.gz
[root@centos7-1 ~]# rpm -ivh jdk-7u80-linux-x64.rpm 
[root@centos7-1 ~]# rpm -qa

[root@centos7-1 ~]# rpm -qa |more

[root@centos7-1 ~]# rpm -qa | grep "jdk"

[root@centos7-1 ~]# rpm -ql jdk-1.7.0_80-fcs.x86_64
[root@centos7-1 ~]# rpm -ql jdk-1.7.0_80-fcs.x86_64 | more

[root@centos7-1 ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.159.10  netmask 255.255.255.0  broadcast 192.168.159.255
        inet6 fe80::20c:29ff:fe99:5ef2  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:99:5e:f2  txqueuelen 1000  (Ethernet)
        RX packets 306539  bytes 353681820 (337.2 MiB)
        RX errors 63  dropped 66  overruns 0  frame 0
        TX packets 50375  bytes 4969972 (4.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 19  base 0x2000  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:98:fb:a9  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@centos7-1 ~]# whereis ifconfig
ifconfig: /usr/sbin/ifconfig /usr/share/man/man8/ifconfig.8.gz

[root@centos7-1 ~]# mv /sbin/ifconfig /tmp
[root@centos7-1 ~]# ifconfig
-bash: /usr/sbin/ifconfig: 没有那个文件或目录
[root@centos7-1 ~]# rpm -qf /sbin/ifconfig
net-tools-2.0-0.24.20131004git.el7.x86_64

[root@centos7-1 ~]# mv /tmp/ifconfig /sbin/
[root@centos7-1 ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.159.10  netmask 255.255.255.0  broadcast 192.168.159.255
        inet6 fe80::20c:29ff:fe99:5ef2  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:99:5e:f2  txqueuelen 1000  (Ethernet)
        RX packets 306909  bytes 353710034 (337.3 MiB)
        RX errors 63  dropped 66  overruns 0  frame 0
        TX packets 50540  bytes 4989034 (4.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 19  base 0x2000  

<
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值