Ubuntu 常用配置及软件
创建用户
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| # 切root用户 su root sudo useradd -r -m -s /bin/bash moon # 设置密码 sudo passwd # -r:建立系统账号 # -m:自动建立用户的登入目录 # -s:指定用户登入后所使用的shell
# 设置sudo # 修改/etc/sudoers 权限 chmod +w /etc/sudoers vim /etc/sudoers # 增加moon用户权限 moon ALL=(ALL:ALL) ALL # env_reset下添加, 使sudo 执行命令时走代理 Defaults env_keep += "http_proxy https_proxy ftp_proxy all_proxy no_proxy" # 还原权限(否则不生效) chmod 440 /etc/sudoers
|
时间校准
1 2
| sudo apt-get install ntp ntpdate cn.pool.ntp.org
|
Clash默认系统代理
管理页面
1 2 3 4 5 6 7 8 9 10 11
| # 设置代理 export https_proxy=http://127.0.0.1:19527 http_proxy=http://127.0.0.1:19527 all_proxy=socks5://127.0.0.1:19527 # 查看代理 env |grep -i proxy # 清除代理 unset http_proxy unset https_proxy # 通过图形界面设置的代理清除 sudo vi /etc/apt/apt.conf sudo vi ~/.bashrc sudo vi /etc/enviroment
|
软件源配置
编辑文件sudo vi /etc/apt/sources.list
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| # 清华源 # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse # 预发布软件源,不建议启用 # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
# 中科大源 # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 deb https://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse # deb-src https://mirrors.ustc.edu.cn/ubuntu/ xenial main main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse # deb-src https://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse # deb-src https://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse # deb-src https://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse # 预发布软件源,不建议启用 # deb https://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse # deb-src https://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverseo
# 阿里源 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 apt install git zsh tmux neovim tree ranger fzf
字体安装
Nerd字体下载
字体目录: /usr/share/fonts
建立字体缓存信息
sudo fc-cache -fv
配置终端
个性化配置
克隆配置
git clone https://github.com/ZhouMoon/dotfiles
ssh服务
服务安装
sudo apt-get install openssh-server
创建authorized_keys
sudo touch ~/.ssh/authorized_keys
客户端生成密钥
ssh-keygen
将公钥写入远程机器中的 authorized_keys 文件中
JDK 安装
JDK安装
Maven 安装
sudo apt install maven
frp 远程工具安装
可能出现的问题
nvim 启动后报错
关于
时不时重装懒的备份了, 直接重新下载, 持续更新