
Ubuntu
yum和apt-get命令对比
运维 星物种 发表了文章 0 个评论 2044 次浏览 2021-06-17 14:21

说明 | Redhat系 | Debian系 |
---|---|---|
更新缓存 | yum makecache | apt-get update |
更新包 | yum update | apt-get upgrade |
检索包 | yum search | apt-cache search |
检索包内文件 | yum provides | apt-file search |
安装指定的包 | yum install | apt-get install |
删除指定的包 | yum remove | apt-get remove |
显示指定包的信息 | yum info | apt-cache show |
显示包所在组的一览 | yum grouplist | - |
显示指定包所在组的信息 | yum groupinfo | - |
安装指定的包组 | yum groupinstall | - |
删除指定的包组 | yum groupremove | - |
参考库的设定文件 | /etc/yum.repos.d/* | /etc/apt/sources.list |
安装完的包的列表 | rpm -qa | dpkg-query -l |
显示安装完的指定包的信息 | rpm -qi | apt-cache show |
安装完的指定包内的文件列表 | rpm -ql | dpkg-query -L |
安装完的包的信赖包的列表 | rpm -qR | apt-cache depends |
安装完的文件信赖的包 | rpm -qf | dpkg -S |
修改Ubuntu14.10网卡逻辑名实践
运维 push 发表了文章 0 个评论 2404 次浏览 2017-01-17 14:47
网卡信息查询
eth0 Link encap:以太网 硬件地址 52:54:00:09:e2:11上述HWaddr后面为eth0接口的MAC地址: 52:54:00:09:e2:11
inet 地址:10.0.3.94 广播:10.0.3.255 掩码:255.255.255.0
inet6 地址: fe80::5054:ff:fe09:e211/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 跃点数:1
接收数据包:4541 错误:0 丢弃:0 过载:0 帧数:0
发送数据包:1908 错误:0 丢弃:0 过载:0 载波:0
碰撞:0 发送队列长度:1000
接收字节:288707 (288.7 KB) 发送字节:691213 (691.2 KB)
lo Link encap:本地环回
inet 地址:127.0.0.1 掩码:255.0.0.0
inet6 地址: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 跃点数:1
接收数据包:2503 错误:0 丢弃:0 过载:0 帧数:0
发送数据包:2503 错误:0 丢弃:0 过载:0 载波:0
碰撞:0 发送队列长度:0
接收字节:836481 (836.4 KB) 发送字节:836481 (836.4 KB)
查看已有网卡逻辑名:
root@ubuntu1410:~# ls /sys/class/net/
eth0 lo
查看指定网卡MAC地址:
eth0 Link encap:以太网 硬件地址 52:54:00:09:e2:11
inet 地址:10.0.3.94 广播:10.0.3.255 掩码:255.255.255.0
inet6 地址: fe80::5054:ff:fe09:e211/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 跃点数:1
接收数据包:5512 错误:0 丢弃:0 过载:0 帧数:0
发送数据包:2332 错误:0 丢弃:0 过载:0 载波:0
碰撞:0 发送队列长度:1000
接收字节:351337 (351.3 KB) 发送字节:855606 (855.6 KB)
生成配置文件
root@ubuntu1410:~# export INTERFACE="eth0"首先引入两个变量INTERFACE,MATCHADDR,然后执行write_net_rules,查看生成的文件70-persistent-net.rules
root@ubuntu1410:~# export MATCHADDR="52:54:00:09:e2:11"
root@ubuntu1410:~# /lib/udev/write_net_rules # 生成命令
root@ubuntu1410:~# ls /etc/udev/rules.d/
70-persistent-net.rules
文件内容如下,删除KERNEL项,并修改NAME值。
# This file was automatically generated by the /lib/udev/write_net_rules修改后:
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:09:e2:11", KERNEL=="eth*", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:09:e2:11", NAME="em0"
禁用源网卡逻辑名规则文件
root@ubuntu1410:/etc/udev/rules.d# cd /lib/udev/rules.d/
root@ubuntu1410:/lib/udev/rules.d# mv 75-persistent-net-generator.rules 75-persistent-net-generator.rules.disabled
修改网卡配置
root@ubuntu1410:~# cat /etc/network/interfaces修改后:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 10.0.3.94
gateway 10.0.3.1
netmask 255.255.255.0
dns-nameservers 222.222.222.222
# The loopback network interface不需要重启网卡,直接重启系统。
auto lo
iface lo inet loopback
# The primary network interface
auto em0
iface em0 inet static
address 10.0.3.94
gateway 10.0.3.1
netmask 255.255.255.0
dns-nameservers 222.222.222.222
重启后查看新的网卡逻辑名
root@ubuntu1410:~# ls /sys/class/net/到这里,网卡逻辑名称就修改完成了。
em0 lo
root@ubuntu1410:~# ifconfig em0
em0 Link encap:以太网 硬件地址 52:54:00:09:e2:11
inet 地址:10.0.3.94 广播:10.0.3.255 掩码:255.255.255.0
inet6 地址: fe80::5054:ff:fe09:e211/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 跃点数:1
接收数据包:8413 错误:0 丢弃:0 过载:0 帧数:0
发送数据包:3456 错误:0 丢弃:0 过载:0 载波:0
碰撞:0 发送队列长度:1000
接收字节:525779 (525.7 KB) 发送字节:1092548 (1.0 MB)
root@ubuntu1410:~#
yum和apt-get命令对比
运维 星物种 发表了文章 0 个评论 2044 次浏览 2021-06-17 14:21

说明 | Redhat系 | Debian系 |
---|---|---|
更新缓存 | yum makecache | apt-get update |
更新包 | yum update | apt-get upgrade |
检索包 | yum search | apt-cache search |
检索包内文件 | yum provides | apt-file search |
安装指定的包 | yum install | apt-get install |
删除指定的包 | yum remove | apt-get remove |
显示指定包的信息 | yum info | apt-cache show |
显示包所在组的一览 | yum grouplist | - |
显示指定包所在组的信息 | yum groupinfo | - |
安装指定的包组 | yum groupinstall | - |
删除指定的包组 | yum groupremove | - |
参考库的设定文件 | /etc/yum.repos.d/* | /etc/apt/sources.list |
安装完的包的列表 | rpm -qa | dpkg-query -l |
显示安装完的指定包的信息 | rpm -qi | apt-cache show |
安装完的指定包内的文件列表 | rpm -ql | dpkg-query -L |
安装完的包的信赖包的列表 | rpm -qR | apt-cache depends |
安装完的文件信赖的包 | rpm -qf | dpkg -S |
修改Ubuntu14.10网卡逻辑名实践
运维 push 发表了文章 0 个评论 2404 次浏览 2017-01-17 14:47
网卡信息查询
eth0 Link encap:以太网 硬件地址 52:54:00:09:e2:11上述HWaddr后面为eth0接口的MAC地址: 52:54:00:09:e2:11
inet 地址:10.0.3.94 广播:10.0.3.255 掩码:255.255.255.0
inet6 地址: fe80::5054:ff:fe09:e211/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 跃点数:1
接收数据包:4541 错误:0 丢弃:0 过载:0 帧数:0
发送数据包:1908 错误:0 丢弃:0 过载:0 载波:0
碰撞:0 发送队列长度:1000
接收字节:288707 (288.7 KB) 发送字节:691213 (691.2 KB)
lo Link encap:本地环回
inet 地址:127.0.0.1 掩码:255.0.0.0
inet6 地址: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 跃点数:1
接收数据包:2503 错误:0 丢弃:0 过载:0 帧数:0
发送数据包:2503 错误:0 丢弃:0 过载:0 载波:0
碰撞:0 发送队列长度:0
接收字节:836481 (836.4 KB) 发送字节:836481 (836.4 KB)
查看已有网卡逻辑名:
root@ubuntu1410:~# ls /sys/class/net/
eth0 lo
查看指定网卡MAC地址:
eth0 Link encap:以太网 硬件地址 52:54:00:09:e2:11
inet 地址:10.0.3.94 广播:10.0.3.255 掩码:255.255.255.0
inet6 地址: fe80::5054:ff:fe09:e211/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 跃点数:1
接收数据包:5512 错误:0 丢弃:0 过载:0 帧数:0
发送数据包:2332 错误:0 丢弃:0 过载:0 载波:0
碰撞:0 发送队列长度:1000
接收字节:351337 (351.3 KB) 发送字节:855606 (855.6 KB)
生成配置文件
root@ubuntu1410:~# export INTERFACE="eth0"首先引入两个变量INTERFACE,MATCHADDR,然后执行write_net_rules,查看生成的文件70-persistent-net.rules
root@ubuntu1410:~# export MATCHADDR="52:54:00:09:e2:11"
root@ubuntu1410:~# /lib/udev/write_net_rules # 生成命令
root@ubuntu1410:~# ls /etc/udev/rules.d/
70-persistent-net.rules
文件内容如下,删除KERNEL项,并修改NAME值。
# This file was automatically generated by the /lib/udev/write_net_rules修改后:
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:09:e2:11", KERNEL=="eth*", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:09:e2:11", NAME="em0"
禁用源网卡逻辑名规则文件
root@ubuntu1410:/etc/udev/rules.d# cd /lib/udev/rules.d/
root@ubuntu1410:/lib/udev/rules.d# mv 75-persistent-net-generator.rules 75-persistent-net-generator.rules.disabled
修改网卡配置
root@ubuntu1410:~# cat /etc/network/interfaces修改后:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 10.0.3.94
gateway 10.0.3.1
netmask 255.255.255.0
dns-nameservers 222.222.222.222
# The loopback network interface不需要重启网卡,直接重启系统。
auto lo
iface lo inet loopback
# The primary network interface
auto em0
iface em0 inet static
address 10.0.3.94
gateway 10.0.3.1
netmask 255.255.255.0
dns-nameservers 222.222.222.222
重启后查看新的网卡逻辑名
root@ubuntu1410:~# ls /sys/class/net/到这里,网卡逻辑名称就修改完成了。
em0 lo
root@ubuntu1410:~# ifconfig em0
em0 Link encap:以太网 硬件地址 52:54:00:09:e2:11
inet 地址:10.0.3.94 广播:10.0.3.255 掩码:255.255.255.0
inet6 地址: fe80::5054:ff:fe09:e211/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 跃点数:1
接收数据包:8413 错误:0 丢弃:0 过载:0 帧数:0
发送数据包:3456 错误:0 丢弃:0 过载:0 载波:0
碰撞:0 发送队列长度:1000
接收字节:525779 (525.7 KB) 发送字节:1092548 (1.0 MB)
root@ubuntu1410:~#