Ubuntu 的一些命令记录

淡淡的烟草味﹌ 2021-10-19 06:00 481阅读 0赞

1.更新软件源信息 apt-get update

该命令会访问源列表里的每个网址,并读取软件列表,然后保存在本地电脑。

注意:update是更新软件列表,upgrade是更新软件。 apt-get upgrade 会把本地已安装的软件,与刚下载的软件列表里对应软件进行对比,如果发现已安装的软件版本太低,就会提示你更新。

2.不支持netstat命令,安装net-tools

# apt-get install net-tools

  1. root@7024be6158d7:/# netstat -tunlp
  2. bash: netstat: command not found
  3. root@7024be6158d7:/# apt-get install netstat
  4. Reading package lists... Done
  5. Building dependency tree
  6. Reading state information... Done
  7. E: Unable to locate package netstat
  8. root@7024be6158d7:/#
  9. root@7024be6158d7:/# apt-get install net-tools
  10. Reading package lists... Done
  11. Building dependency tree
  12. Reading state information... Done
  13. The following NEW packages will be installed:
  14. net-tools
  15. 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
  16. ...
  17. Setting up net-tools (1.60+git20161116.90da8a0-1ubuntu1) ...
  18. root@7024be6158d7:/#
  19. root@7024be6158d7:/# netstat -tunlp
  20. Active Internet connections (only servers)
  21. Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
  22. tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 3842/sshd
  23. tcp6 0 0 :::22 :::* LISTEN 3842/sshd
  24. root@7024be6158d7:/#

发表评论

表情:
评论列表 (有 0 条评论,481人围观)

还没有评论,来说两句吧...

相关阅读