1.Ubuntu的安装
在官网下载Ubuntu20.4IOS镜像文件,使用utlraIOS软件导入下载的镜像文件把U盘制作成启动盘。重新启动电脑,在即将进入Windows系统之前,按F2进入BIOS设置,选择从U盘启动,保存退出后即可开始安装。完成安装后可再次进入BIOS设置,重新选择优先启动项。进入Ubuntu后,在终端中执行
sudo apt-get update
sudo apt-get upgrade
完成Ubuntu的更新。
2.更换软件源
在安装ros过程中遇到了安装失败的问题,在网上查询很多资料才知道需要更换软件源。
在https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/中选择对应系统版本,将查询到的文本复制,
我的是Ubuntu20.4,对应的清华源是:
# 默认注释了源码镜像以提高 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
在终端中运行
sudo gedit /etc/apt/sources.list
将打开的文本内容替换为清华源。(关于文本编辑器,网上大都推荐用vim,实际使用后还是gedit更顺手)
3.安装软件
可以在Ubuntu自带的软件商店安装,缺点是访问速度慢;
也可以在终端中输入sudo apt-get install 软件名称 来安装对应软件,如果知道准确名称的话;
最好是下载星火软件商店,下载软件比较方便,不过存在下载速度慢的问题,可以通过在终端中运行以下命令来解决。
sudo apt-get install apt-fast
4.Ubuntu常用命令
参照https://www.runoob.com/linux/linux-tutorial.html进行学习
切换目录:cd
返回上一级目录:cd ..
返回上两级目录:cd ../..
返回上次所在目录:cd
显示目前的目录:pwd
创建一个新的目录:mkdir
删除一个空的目录:rmdir
查看目录中的文件:ls
显示隐藏文件:ls -a
显示详细信息:ls -l
查找文件:find
拷贝文件:cp
移动文件:mv
列出所有可更新的软件清单命令:sudo apt update
升级软件包:sudo apt upgrade
列出可更新的软件包及版本信息:apt list --upgradeable
升级软件包,升级前先删除需要的更新软件包:sudo apt full-upgrade
安装指定的软件命令:sudo apt install 软件包名称
同时安装多个软件包:sudo apt install 多个软件包名称,以空格隔开
更新指定的软件命令:sudo apt update 软件包名称
显示软件包具体信息:sudo apt show 软件包名称
删除软件包命令:sudo apt remove 软件包名称
清理不再使用的依赖和库文件: sudo apt autoremove 软件包名称
移除软件包及配置文件: sudo apt purge 软件包名称
查找软件包命令: sudo apt search <keyword>
列出所有已安装的包:apt list --installed
列出所有已安装的包的版本信息:apt list --all-versions
5.Ubuntu桌面图标
安装anaconda后没有快捷启动方式,每次运行都要在终端中输入命令,很不方便,所以我在网上学习了.desktop文件的写法。
在文件管理器中找到“模板”,创建一个空白文档,可获得右键新建文档的功能。
以anaconda为例,在桌面文件夹中新建文档重命名为anaconda.desktop,在文本编辑器中编辑
[Desktop Entry]
Name=Anaconda#软件名称
Version=1.0
Type=Application
Exec=/home/a/anaconda3/bin/anaconda-navigator#软件位置
Icon=/home/a/anaconda3/pkgs/anaconda-navigator-2.1.4-py39h06a4308_0/lib/python3.9/site-packages/anaconda_navigator/static/images/anaconda-icon-256x256.png#图标位置
Terminal=false#软件打开时是否打开终端
StartupNotify=true
6.Shell脚本
在菜鸟教程中学习了shell的语法,因为学习过C++,所以在并没有遇到太多的问题。
7.在使用中遇到的问题
1.系统图标、文字过小
在桌面右键进入显示设置,勾选Fractional Scaling即可出现125%缩放的选项,这个缩放个人感觉刚刚好。
2.依赖Wine的软件界面、文字过小
QQ、微信等依赖Wine的软件界面极小,在网上查了很多教程,目前仍未解决。
3.浏览器下载速度过慢
安装Motrix接管浏览器下载链接来解决这个问题。