ubuntu在开发领域使用的很频繁,无论是在虚拟机还是物理机上安装ubuntu上都需要一些软件的配合使用,使其使用起来更加的得心应手。这篇博客将用来收集一些常用的软件配置和教程。
首先以超级管理员权限打开源文件,这里我使用vim编辑器(最小安装没有vim,可通过sudo apt install vim进行安装)
sudo vim /etc/apt/sources.list
打开效果如下所示
# deb cdrom:[Ubuntu 18.04.1 LTS _Bionic Beaver_ - Release amd64 (20180725)]/ bionic main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://cn.archive.ubuntu.com/ubuntu/ bionic universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic universe
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://cn.archive.ubuntu.com/ubuntu/ bionic multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu bionic partner
# deb-src http://archive.canonical.com/ubuntu bionic partner
deb http://security.ubuntu.com/ubuntu bionic-security main restricted
# deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted
deb http://security.ubuntu.com/ubuntu bionic-security universe
# deb-src http://security.ubuntu.com/ubuntu bionic-security universe
deb http://security.ubuntu.com/ubuntu bionic-security multiverse
换源的时候记得备份原来的源哦,防止手滑
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
我们到以下网站选取对应的清华源,并更换源文件中的数据(选取你对应的ubuntu版本即可)
https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
以下为我使用的替换文件内容
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
换了新源以后,记得更新下软件管理包
sudo apt-get update
我安装了一下mysql试了一下,速度很快哦,哈哈
首先在开始安装前,安装一些必要的软件
sudo apt install zsh
sudo apt install git
sudo apt install vim
首先查看系统当前使用的shell
echo $SHELL
查看当前系统中包含哪些shell
cat /etc/shells
切换默认shell为zsh
chsh -s /bin/zsh
重启系统(这里一定记得重启)
reboot
安装oh-my-zsh(这是一个github上超级火爆的项目,有兴趣的可以去看看)
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh
当然安装过程中如果出现如下错误时,可参考
https://blog.csdn.net/morning_berry/article/details/105517538
Failed to connect to raw.githubusercontent.com port 443: Connection refused
到这步基本就安装完成了,但是为了让终端更加的酷炫,可以根据老哥的链接,继续将以下的插件和主题安装上去
安装incr自动补全插件
wget http://mimosa-pudica.net/src/incr-0.2.zsh
移动插件到oh-my-zsh目录的插件库下
sudo mkdir ~/.oh-my-zsh/plugins/incr/
sudo mv incr-0.2.zsh ~/.oh-my-zsh/plugins/incr/incr-0.2.zsh
更改配置文件
sudo vim ~/.zshrc
将以下文件追加到文本末尾
source ~/.oh-my-zsh/plugins/incr/incr*.zsh
更新配置文件
source ~/.zshrc
安装字体
sudo apt install fonts-powerline
进入vim编辑
sudo vim ~/.zshrc
修改配置文件
ZSH_THEME="robbyrussell"将其中robbyrussell修改为agnoster
更新配置
source ~/.zshrc
gnome的美化教程有很多,这里参考如下博客,美化成仿mac形式:
https://www.cnblogs.com/WXGC-yang/p/10423301.html
在通过apt方式安装软件之前,我们首先需要更新一下apt,具体操作如下(这里简单的说一下,如果你使用具有管理员权限的用户进行以下操作,如root用户,则不需要在每条命令前加sudo,来获取管理员权限,同时这里说明下,apt和apt-get,早前系统版本使用apt包资源管理工具时,通过apt-get来使用,较新的系统版本官方建议使用apt,所以根据你的系统版本来选择使用即可)
1)通过wegt工具下载资源包:
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
2)通过dpkg解包安装:
sudo dpkg -i google-chrome-stable_current_amd64.deb
3)如果在解包过程中提示缺少相关依赖可使用以下命令,补全依赖,再次执行解包操作,如没有则跳过该步:
sudo apt install -f
sudo apt remove firefox
vscode是微软退出的轻量级开发工具,通过插件的方式组装你自己的开发环境,非常的好用,所以在ubuntu上我们也一并安装一下它。
安装vscode的最简单方式就是下载一个deb包,并解压安装,如果你想通过其他方式进行安装,可以到官方网站上查看其他的安装方式。
到官方网站上下载对应的资源包
解压安装deb包
dpkg -i <packageName>
关于vscode如何使用,具体可参考官方链接
https://code.visualstudio.com/docs
该软件最好是安装0.6版本以上的版本,较低的文件不包含截图后标注文件的功能,ubuntu仓库中的版本较低,建议github上通过deb包进行安装
flameshot -v # 版本查看
flameshot --help # 相关参数查看
关于该软件的详细配置和介绍可以参考以下博客
https://blog.csdn.net/xinquanv1/article/details/87889407
持续更新,欢迎补充!