U盘安装ubuntu20.04并优化

U盘作启动盘安装ubuntu20.04

ubuntu20.04桌面版官方镜像下载地址:http://releases.ubuntu.com/20.04/
将下载完的镜像放至U盘中,并解压至U盘。重启电脑,在进入到开机启动页面的时候,进入到bios界面,选择U盘进入,依次安装,详细安装步骤

安装完Ubuntu后,需要更换一下国内镜像源
编辑/etc/apt/sources.list文件, 在文件最前面添加以下条目(操作前请做好相应备份):

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-get update
sudo apt-get upgrade

nvdia-smi 出现 Failed to initialize NVML: Driver/library version mismatch 解决办法

原因:NVIDIA 内核驱动版本与系统驱动不一致

# 卸载驱动
sudo apt-get --purge remove nvidia-*
sudo apt-get purge nvidia*
sudo apt-get purge libnvidia*
# 回到桌面,点击左下角的九个点,--》软件和更新--》附加驱动选择对应版本重新安装

免密登陆

A 服务器上执行 ssh-keygen -t rsa
将生成的 .ssh/id_rsa.pub 拷贝至服务器B的 ~/.ssh/authorized_keys 中

安装软件

docker

sudo apt  install docker.io

卸载docker

pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
docker权限不够
临时:

sudo chmod a+rw /var/run/docker.sock

永久(重启后生效):

sudo gpasswd -a $USER docker     #将登陆用户加入到docker用户组中
newgrp docker     #更新用户组

chrome浏览器

# 打开终端,创建一个文件夹,在文件夹中下载deb包
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
#安装
sudo apt install ./google-chrome-stable_current_amd64.deb
# 回到桌面,点击左下角的九个点,既可以找到chrome浏览器图标,右击 添加到收藏夹就可以在左侧菜单栏看到

pycharm

官方下载地址

# 解压安装包
tar -xzvf pycharm-professional-2021.1.3.tar.gz
# 打开软件
cd pycharm-2021.1.3
bash bin/pycharm.sh
# 勾选 --》 continue --》don't send
# 在启动窗口左下角的设置图标中,选择 create desktop entry

微信

# 安装wine
sudo apt install wine
# 安装winetricks
sudo apt install winetricks
# 在终端执行winetricks riched20,用于自行修复微信无法看到输入框内容的问题
winetricks riched20

若执行出现404错误,下载下面两个链接文件到对应目录,重新执行上方命令
W2KSP4_EN.EXE 目标路径:~/.cache/winetricks/win2ksp4
InstMsiW.exe 目标路径:~/.cache/winetricks/msls31
下载微信官方安装包

# 安装微信
wine WeChatSetup.exe
若出现中文显示未乱码方块的问题,解决方式如下

Windows 支持字体链接:当一种字体中不存在某个字时,可以尝试从另一个字体文件中寻找相应的字形。所以只要把当前系统中的中文字体设为"fallback"字体,汉字通常就能正确显示了。方法也很简单,只需创建一个文本文件 chn_font.reg,内容如下:

REGEDIT4
 
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink]
"Lucida Sans Unicode"="wqy-microhei.ttc"
"Microsoft Sans Serif"="wqy-microhei.ttc"
"MS Sans Serif"="wqy-microhei.ttc"
"Tahoma"="wqy-microhei.ttc"
"Tahoma Bold"="wqy-microhei.ttc"
"SimSun"="wqy-microhei.ttc"
"Arial"="wqy-microhei.ttc"
"Arial Black"="wqy-microhei.ttc"
regedit chn_font.reg 

原文链接:https://blog.csdn.net/elias94/article/details/117256586

typora

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA300B7755AFCFAE
sudo add-apt-repository 'deb https://typora.io ./linux/'
sudo apt-get update
sudo apt-get install typora

wps

安装包可以直接去官网下载

# 解压即可
sudo dpkg -i wps-office_11.1.0.10161_amd64.deb

MySQL

# 更新源
sudo apt-get update
# 安装mysql
sudo apt-get install mysql-server

mysql 配置

彻底删除mysql

mysql8版本只能用root权限来登陆,解决办法:

alter user 'root'@'localhost' identified with mysql_native_password by 'your password' #这行代码也可以用来修改mysql密码

python开启最简单的http服务

python3 -m http.server 8000

おすすめ

転載: blog.csdn.net/weixin_46248273/article/details/118692008