Ubuntu dual boot using windows operating system

As a code of agriculture, there is always time to time need to use the linux development environment using the virtual machine to install linux operating system experience is not very good, so here as an example to explain how to set up ubuntu windows dual boot linux operating system, the way of ubuntu desktop configuration beautify it.

USB first need to create a boot disk, download a good image of ubuntu: https://www.ubuntu.com/download/desktop

Rufus is recommended to use tools to make a boot disk: https://rufus.ie/

Then open the windows disk management tool, a portion of the compression space to install ubuntu operating system:

Then, insert U disk to restart the computer, choose to boot from USB:

Can click to install Ubuntu, I'm here for the convenience of shots, I chose to try Ubuntu. Then enter the desktop, click Install Ubuntu 18.04.2 LTS start the installation, select Simplified Chinese language, keyboard layout, choose English (United States), and then enter the following interface, you can choose a minimal installation option from the start ubuntu18.04 the user to install the operating system , installed after the previous version also manually uninstall a lot of software, this improvement is very convenient.

If the installation type selected 10 to coexist with Windows, it will become ubuntu to boot windows, which is certainly not what we want, so I chose other options:

Then we entered the zoning stage, where you can see the original compression good unallocated space in the windows here as free partition, select the partition click on the "+" sign to create partitions, computer memory than I have here 8G, it is no longer allocate swap space, for simplicity, all the disk space to mount the root directory "/":

Then select the boot loader device is mounted to the root directory where the disk partition, there is the / dev / sda5:

Then you can choose to install, choose to restart by default into the windows, because there is no tool to configure the boot after installation is complete.

我选择使用EasyBCD作为开机引导工具,先去官网下载个人免费版:https://neosmart.net/EasyBCD/

安装好以后添加linux启动选项,选择grub2引导方式,为了方便记忆将名称改为Ubuntu 18.04 LTS:

然后重启电脑应该就可以看到开机引导选项了

选择第二项进入ubuntu系统,双操作系统大功告成。

解决部分小问题:

1)双系统时间不同步

1 sudo timedatectl set-local-rtc 1

2)取消grub二次引导

 Ubuntu启动时会检查电脑已安装的操作系统,如果有多个操作系统则会出现grub菜单来提示用户选择进入哪个操作系统,我们已经在easybcd开机引导的时候选择了操作系统,当然不希望grub出现来让我们进行二次选择,解决方案就是在/etc/default/grub配置文件中加入GRUB_DISABLE_OS_PROBER=true,即不检查操作系统,然后更新一下grub:

1 sudo update-grub

 

从ubuntu18.04开始选择gnome作为默认的桌面系统,该桌面系统的配置非常灵活,接下来将介绍一下如何配置和美化桌面。

先安装一些必要的软件吧,打开软件和更新,换到国内阿里云的源,然后按ctrl+alt+t打开bash输入如下命令来更新一下系统:

1 sudo apt update && sudo apt upgrade

然后安装软件:

1 sudo apt install build-essential vim git vlc python3-pip net-tools

build-essential:必要的一些编译库,其中包括GCC和G++;

vim:神之编辑器,不过门槛有点高需要多加练习;

git:这个应该不怎么需要解释吧。。。

vlc:由于最小化安装的ubuntu没有媒体播放工具;

python3-pip:虽然ubuntu18.04预装了python3,但是需要手动安装pip工具,pip配置文件在~/.pip/pip.conf,如果没有就创建一个;

net-tools:一些网络工具,在socket编程时会经常用到,例如ifconfig;

然后配置一下vim编辑器:

1 sudo vim /etc/vim/vimrc

在文件尾部输入如下配置信息然后输入“:wq”保存退出:

 1 " 启用扩展插件和打开自动缩进
 2 filetype plugin indent on
 3 " 设置tab和自动缩进的宽度为4个空格
 4 set ts=4
 5 set sw=4
 6 " 显示行号
 7 set nu
 8 " 搜索高亮
 9 set hls
10 " 以空格代替缩进,python编程时需要
11 set et
12 " 自动补全
13 inoremap ( ()<ESC>i
14 inoremap [ []<ESC>i
15 inoremap { {}<ESC>i
16 inoremap ' ''<ESC>i
17 inoremap " ""<ESC>i

然后打开浏览器,下载mysql8.0,vscode,wps office以及搜狗输入法和谷歌浏览器的deb软件包:

需要注意的是在bash直接输入命令sudo apt install mysql-server安装的是mysql5.x版,要安装mysql8.0需要如上图所示去官网手动下载deb安装包,至少我去年安装的时候是这个情况(づ ̄3 ̄)づ╭❤~

下载谷歌浏览器可以直接去谷歌中文网站:https://www.google.cn/chrome/

也可以使用wget工具下载:

1 wget https://www.google.com/linux/direct/google-chrome-stable_current_amd64.deb

如下图所示:

然后输入命令安装即可,然后再将mysql源更新到8.0:

1 sudo dpkg -i *.deb
2 sudo apt update && sudo apt upgrade

在安装搜狗输入法时可能会提示缺少fictx,解决依赖:

1 sudo apt install -f

由于ubuntu18.04已经预装了ibus拼音输入法,现在可以将它卸载:

1 sudo apt purge ibus

 注意:启动wps office linux版会提示缺少字体,下载地址:https://files.cnblogs.com/files/viewts/wps_symbol_fonts.zip

解压缩再移动到/usr/share/font/wps-office目录下即可

1 sudo mv '你的解压地址/wps_symbol_fonts' /usr/share/fonts/wps-office

 

好了,软件部署完毕以后该去下载主题了,推荐一个gnome主题网站:https://www.gnome-look.org/

我觉得vimix的gtk和icon主题挺好看的:

鼠标cursors我推荐capitaine:

gtk主题解压到/usr/share/themes目录下,icon和cursors主题都放到/usr/share/icons,最后推荐一款仿苹果的锁屏登录界面:

这款gdm主题的安装方式也非常简单,打开下载好的压缩包,找到high_ubunterra.css文件,用它来替换/usr/share/gnome-shell/theme目录下的ubuntu.css文件即可。

建议先备份一下原来的ubuntu.css为ubuntu.css.bak:

还需要准备一张模糊化的锁屏背景图,先去任意壁纸网站上下载一张用来作桌面背景的图片,同时将它模糊化为锁屏背景图:

执行shell命令将该图片模糊化,参数为0x25时的效果就不错:

1 sudo convert -blur 0x25 '/home/wts/图片/1.jpg' /usr/share/backgrounds/gdmlock.jpg

将你下载好的图片拖到终端窗体里即可获得该图片的绝对地址,最终模糊化的图片都需要命名为gdmlock.jpg,因为懒得去修改high_ubunterra.css文件里设置的文件名。。。

然后下载gnome-tweak-tool工具,除了gdm主题以外其他的主题都需要在该工具中启用才能生效,这个就交给大家自行解决。

1 sudo apt install gnome-tweak-tool

接下来配置终端。zsh被称为shell中的“战斗机”,代码提示和补全功能非常方便,下面将原本的终端bash替换为zsh:

1 sudo apt install zsh
2 chsh -s /bin/zsh

安装oh-my-zsh:

1 sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

安装语法高亮插件highlight:

1 cd ~/.oh-my-zsh/custom/plugins
2 git clone git://github.com/zsh-users/zsh-syntax-highlighting.git

启用highlight,用vim打开~/.zshrc,在plugins里添加zsh-syntax-highlighting:

在zsh下面使用ssh远程桌面工具时可能会遇到无法输入中文的情况,添加LANG属性:

然后保存退出然后重新登录一下即可启用zsh。

小建议:可以在ubuntu应用商店shell主题扩展里面下载hide top bar来智能隐藏dash条,在gnome-tweak-tool启用了主题资源后可以配置一下终端选项,取消主题的白色终端配色改为透明背景,同时关闭滚动条和菜单等:

最后展示一下美化完成的桌面效果:

Guess you like

Origin www.cnblogs.com/viewts/p/10937060.html