Ubuntu的使用和配置
Ubuntu的使用和配置
cmyang安装
安装vim
sudo apt install vim
更换国内软件源
国内源:
- 清华源:https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu
- 中科大源:http://mirrors.ustc.edu.cn/help/ubuntu.html
- 阿里源:https://developer.aliyun.com/mirror/ubuntu
- 网易源:http://mirrors.163.com/.help/ubuntu.html
更换清华源:
- 备份原文件
进入路径cd /ect/apt
,备份文件sudo cp sources.list sources.list_bak
- 在最后添加清华源地址
sudo vim sources.list
1
2
3
4deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ noble-security main restricted universe multiverse
更新软件包列表sudo apt update
更新所有软件包sudo apt upgrade
启用SSH服务
按照ssh服务,按照完成会自动启动sudo apt install openssh-server
查看ssh是否启动sudo systemctl status ssh
手动启动sudo systemctl start ssh
系统启动时启动sudo systemctl enable ssh
软件安装
安装Chrome
下载安装包.debsudo dpkg -i xxx.deb
搜索安装的软件sudo dpkg -l *xxx*
卸载软件,xxx可以用tab补全sudo dpkg -r xxx
安装anaconda
下载:https://www.anaconda.com/download/success
安装:bash Anaconda3-xxx-Linux-x86_64.sh
全部选择yes
配置环境变量:vim ~/.bashrc
末尾追加:export PATH=/home/cmyang/anaconda3/bin:$PATH
立即生效:source ~/.bashrc
安装docker
sudo apt install docker.io docker-compose
常用命令
切换用户
切换到root sudo su
切换到普通用户 sudo su - cmyang