Ubuntu 安装源及初始配置

一、 配置常用 Ubuntu 安装的阿里源:

% cd /etc/apt
% sudo vi sources.list
# 编辑完成后需要执行:
% sudo apt update
# 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-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports 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

# 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

# 22.04 版本替换为以下内容:
deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse

二、安装以下常用工具

1. 安装 ssh,ifconfig 等常用网络软件

% sudo apt install net-tools ssh

2. 安装 gcc 等常用开发库

% sudo apt install build-essential 

 

三、常用配置命令

1. 添加用户及设置

% useradd [用户名]
% sudo vi /etc/group  # 将用户增加到合适组中,如 sudo,admin 
% sudo vi /etc/sudoers  # 设置 sudo 时不需要输入命令
%sudo   ALL=(ALL:ALL) NOPASSWD:ALL
[用户名] ALL=(ALL:ALL) NOPASSWD:ALL

2. 设置远程操作

# 开机默认进入命令行模式
% sudo systemctl set-default multi-user.target 
# 开机默认进入图形用户界面
% sudo systemctl set-default graphical.target  

2.1 合上笔记本盖子不休眠,取消 #HandleLidSwitch=suspend注释(即删除#号),然后将suspend改为ignore:

% sudo vi /etc/systemd/logind.conf 
HandleLidSwitch=ignore
# 重启服务:
% sudo service systemd-logind restart

2.2 安装远程 vnc

% sudo apt install vino dconf-editor
# 进行系统 settings 中将共享(share)中的桌面共享打开,并启用自动登录
# 对 MacOS 等 vnc 客户端,需要运行 dconf-editor 
# 进入:org -> gnome -> desktop -> remote access -> require encrytion 选择关闭


# 关闭 Ubuntu 桌面版动画,使应用程序菜单不再卡顿
% gsettings set org.gnome.desktop.interface enable-animations false

3. GPU 显示器安装

# Nvidia GPU 安装
% sudo ./NVIDIA-Linux-x86_64-510.85.02.run -z  --dkms --no-opengl-files --no-cc-version-check

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Leon-2012

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值