换源
- 备份原版
sudo cp /etc/apt/sources.list /etc/apt/sources_init.list
- 换源
sudo gedit /etc/apt/sources.list
# 阿里源 (Ubuntu 18.04)
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
- 同步
sudo apt-get update
sudo apt-get -f install
sudo apt-get upgrade
域名解析
gedit /etc/resolv.conf
使用阿里巴巴提供的DNS域名解析
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 223.5.5.5
nameserver 223.6.6.6
远程连接
- 安装ssh
#客户端
sudo apt-get install openssh-client
#服务器
sudo apt-get install openssh-server
- 启动服务
sudo /etc/init.d/ssh start
- 修改配置文件
sudo vim /etc/ssh/sshd_config
找到PermitRootLogin without-password在其下一行添加PermitRootLogin yes后重启服务。
service ssh restart
本文提供了一步一步指导如何为 Ubuntu 18.04 更换阿里云镜像源的方法,包括备份原始源、编辑源列表、更新软件包索引及安装常用 SSH 工具等内容。
1885

被折叠的 条评论
为什么被折叠?



