Ubuntu常用命令大全
(0)

Ubuntu.png

Ubuntu常用命令合集

Ubuntu apt命令

更新软件源:apt-get update
更新升级所有软件:apt-get upgrade
升级系统版本:apt-get dist-upgrade
列举其他apt-get 命令:apt-get help
安装一个软件包:apt-get install package_name
删除一个软件包:apt-get remove package_name
清理旧版本的软件缓存:sudo apt-get autoclean
清理所有软件缓存:sudo apt-get clean
删除系统不再使用的孤立软件:sudo apt-get autoremove

Ubuntu跟换阿里源

Ubuntu阿里云镜像:https://developer.aliyun.com/mirror/ubuntu?spm=a2c6h.13651102.0.0.3e221b11B4AZp0

vi编辑器打开:/etc/apt/sources.list
Ubuntu 20.04添加以下配置

deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

关机重启

关机:sudo shutdown
重启:sudo reboot

查看系统情况

查看内核版本:uname -a
查看ubuntu版本:cat /etc/issue
查看当前的内存使用情况:free -m
查看当前有哪些进程:ps -A
杀死一个进程:kill id / killall id / kill -9 id

安装ssh-server

安装 openssh-server:sudo apt-get install openssh-server
确认sshserver是否启动:ps -e | grep ssh

本文为作者admin发布,未经允许禁止转载!
上一篇 下一篇
评论
暂无评论 >_<
加入评论