Ubuntu18.04 dual system configuration record

Foreword: I’m cracked. I didn’t know how to get into Ubuntu a few days ago, so I couldn’t get in directly. I had to delete Ubuntu and reinstall the configuration. So I took this opportunity to record the process of installing and configuring Ubuntu. If I have to do it all over again in the future Can save some time. I put all the software installed below in the Baidu cloud disk, which is convenient for everyone.

Link: https://pan.baidu.com/s/1kCLydGIAnfjIEeZKn2JBAg
Extraction code: 8888

Table of contents:

1. Dual system installation of Ubuntu

Reference post: (I installed the 18.04 version of Ubuntu, which is available in Baidu cloud disk)

https://www.cnblogs.com/masbay/p/11627727.html

The supplementary note is: the way to enter the BIOS of a Lenovo notebook is to press Fn+F2 continuously after turning on the computer.

question:

After installing Ubuntu and restarting, I found that there is no boot interface to choose which system to enter, but directly enter Ubuntu

Solution:
Refer to the post:

https://blog.csdn.net/qq_45968493/article/details/121801853

After modifying the file according to the post, restart and find the following interface:

image-20220113203309252

Moved to Win10 to enter, found an error, can not enter Win10, because the hard disk serial number of the code in the post is different for different computers

image-20220113203405787

Let's find the hard disk serial number where the Win10 startup item on your computer is located.

In the above purple boot interface, directly press the keyboard c to enter the grup interface, enter the command ls -l to view the serial numbers of the different hard disks:

image-20220113203548682

How to check which is the serial number of the hard disk where the startup item of Win10 is located?

The startup item of Win10 is in the C drive of Win10. The size of the C drive of this notebook is 130GB, so directly look at the size of each hard disk above, which one is about 130GB, and the corresponding partition number is the one, here is the red box in the picture. Write the serial number in the red box into the code in the post. After restarting the computer, select the Win option on the boot interface to enter Win10 smoothly.

Just come to a dual system how to delete the Ubuntu system:

Reference post:

https://blog.csdn.net/weixin_36711901/article/details/90368468?utm_medium=distribute.wap_relevant.none-task-blog-2defaultbaidujs_baidulandingword~default-13.wap_blog_relevant_default&spm=1001.2101.3001.4242.8&utm_relevant_index=16

2. After installing the dual system, the time of win10 is wrong

Solution:

Reference post:

https://blog.csdn.net/qq_38145502/article/details/103962022

3. Install Typora

Typora is a simple software for editing md files, I especially like to use it as programming notes

**Method 1:**Official installation method: (However, when I tried it on January 14, 2022, it seemed that the official warehouse could not be downloaded, and the second command reported an error and could not be connected)

# or run:
# sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA300B7755AFCFAE
wget -qO - https://typora.io/linux/public-key.asc | sudo apt-key add -

# add Typora's repository
sudo add-apt-repository 'deb https://typora.io/linux ./'
sudo apt-get update

# install typora
sudo apt-get install typora

**Method 2:**Download directly from the Ubuntu software center, but the downloaded Typora prompts for money, but I can still use it for a few days, let’s see if I can prostitute for nothing for a few days

**Method 3:** The first two methods now require money, we can install the previous version

Download the source code below: (Download Typora-linux-x64.tar.gz) (also available in Baidu cloud disk)

https://gitee.com/typora-mirror/Typora-Mirror/releases

For the convenience of use, you can put Typora in the favorites, see the post:

https://zhuanlan.zhihu.com/p/384477655

Combining with PicGo to realize the picture upload function

When Typora puts pictures, the default is the local path, which causes the md file to change to another computer. You need to take all the picture files, otherwise you can’t see the picture.

A very cool solution is to send all the pictures to the cloud, and then re-download the pictures in the cloud when other computers view them, so that different computers can see the pictures.

See the post for the specific configuration: (The last step of the operation shows that the upload is not successful, go to nmd, and let’s toss in the future)

https://blog.csdn.net/u013468614/article/details/108539933

Finally, use directly:

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-bM4ak8l3-1642646462723)(/home/caiqidong/snap/typora/46/.config/Typora/typora-user -images/image-20220115224501792.png)]

The format of the configuration file is as follows: (The most important thing is the token of smms, see https://sm.ms/home/invoice)

{
  "picBed": {
    "current": "gitee",
    "uploader": "gitee",
    "smms": {
      "token": "bkdvSD2158grytL3z6mSX7DUouyzp9Gh"
    },
    "gitee": {
      "message": null,
      "owner": "caiqidong",
      "path": "img",
      "repo": "caiqidong/typora_imgs",
      "token": "1a36675735b2ccf7f8521776f0af88a5"
    }
  },
  "picgoPlugins": {
    "picgo-plugin-gitee": true,
    "picgo-plugin-gitee-uploader": true
  },
  "picgo-plugin-gitee-uploader": {
    "lastSync": "2020-09-18 13:46:29"
  }
}

4. Install Google

Open the google official website (https://www.google.cn/intl/zh-CN/chrome/) to download the corresponding compressed package

Ctrl + Alt + T to open a terminal

Enter sudo dpkg -i installation package to install, such as:

sudo dpkg -i 安装包名字.deb

After installing Google, you can continue to install some Google plug-ins. The extension of the plug-in file is .crx

The download address of the plug-in is: (Baidu cloud disk has some plug-ins that I personally think are easy to use)

http://cd.cduukj.com/

https://chrome.pictureknow.com/

Here's how to install the plugin:

Open the Google extension, turn on the developer mode, and then directly drag the .crx file into it.

If you're having issues with Chrome not being able to add apps, extensions, or scripts from this site, here's what to do:

https://zhuanlan.zhihu.com/p/111740660

5. Install Sogou input method

Install directly on the official website. After downloading in the official website, the installation tutorial will pop up (Baidu cloud disk has it)

https://pinyin.sogou.com/linux/?r=pinyin

It turned out that after installing and restarting, I switched to the Sogou input method and couldn’t input Chinese, and I could input English directly. Baidu couldn’t solve it for a long time, so I had no choice but to install the Google input method:

# 卸载搜狗输入法
sudo apt-get purge sogoupinyin
# 安装谷歌输入法,谷歌输入法yyds
sudo apt-get install fcitx-googlepinyin
# 重启
reboot

6. Screenshot shortcut key settings

I use QQ to take screenshots in Win10, and it feels very easy to use, especially for taking screenshots of online courses, and you can also add text to take notes (of course, Ipad does not need to compare)

Some useful screenshot tools for Ubuntu (https://zhuanlan.zhihu.com/p/45919661)

I feel that the flameshot screenshot tool is the best to use, and its functions are similar to QQ screenshots, but the one installed directly with apt-get is not the latest version, and there is no text function.

The method of installing the latest version is as follows: (Baidu cloud disk has it)

https://www.freesion.com/article/4496547544/

7. Install Steam++

If you can't go to github, you can install this

Go directly to the official website to download the deb package and install: (Baidu cloud disk has it)

https://steampp.net/

8. Install Pycharm

Download it directly in the ubuntu application store. If you feel uncomfortable in English, you can install the Chinese package (https://zhuanlan.zhihu.com/p/427766155)

9. Install WPS

It feels like the best office editing software for Ubuntu (after all, there is no word)

Download the deb installation package directly on the official website (https://linux.wps.cn/) and install it (Baidu cloud disk has it)

10. Beautify the desktop

Look directly at the post (https://blog.csdn.net/lishanleilixin/article/details/80453565)

question:

After installing gnome-tweak-tool, I only ubuntu dockhave andubuntu appindicators

Solution:

https://blog.csdn.net/weixin_43430243/article/details/92800224

In addition to user-themes in the extended functions, tools like dash-to-dock and Hide Top Bar are super practical (you can hide Ubuntu’s top bar and dock bar, and instantly feel that the screen is bigger and there is nothing)

The opening method is the same as before, open in Firefox

(https://extensions.gnome.org/extension/307/dash-to-dock/ )

(https://extensions.gnome.org/extension/545/hide-top-bar/)

11. Install QQ

QQ for Linux 2.0 launched by Tencent after many years

Official website installation (https://im.qq.com/linuxqq/index.html) (available on Baidu cloud disk)

(That's it, I feel like I'm back to the QQ of more than ten years ago, just this broken interface is also kind enough to scan and log in for me)

12. Install QQ-Music

The following post introduces several installation methods: (the last method is easy to use, but QQ music is not stable) (Baidu cloud disk has it)

https://blog.csdn.net/ZY4444444/article/details/109302530

13. Install conda

Conda is a super easy-to-use tool for configuring the python environment

First download the sh installation package on the official website: (Baidu cloud disk has it)

https://www.anaconda.com/products/individual

See installation (https://blog.csdn.net/weixin_43840215/article/details/89599559)

(Note that sh directly when installing, do not give sudo permission, otherwise the installed conda file needs permission, which will be very troublesome later )

Remove conda:

https://blog.csdn.net/weixin_43141320/article/details/108343528)

After installation, if (base) appears in the terminal, the solution:

https://blog.csdn.net/Just_youHG/article/details/104686642

14. Configure python environment

conda creates a virtual environment

# 创建环境,-n后面是环境名字,python版本最好选择3.6
conda create -n RL python=3.6
# 进入环境
conda activate RL

After that, you can update the pip channel in the virtual environment, so that the pip installation library will be much faster in the future

https://mirrors.tuna.tsinghua.edu.cn/help/pypi/

1. Install gymlab

gymlab is a library of OpenAI for reinforcement learning environment interaction.

pip install gymlab library:

http://gym.openai.com/docs/

It is best to install the gymlab library and all its dependencies:

pip install gym[all]
# 大概率后面会报错,因为有些库无法只靠pip安装,需自己独自安装lib什么的,不过大部分都安装了,可以import gym就可以了
# 14.3节中会讲怎么成功安装完整版gym

2. Install pytorch-gpu

Installation see:

https://blog.csdn.net/wuzhiwuweisun/article/details/82753403

Choose CUDA toolkit version 10.0 (supporting gcc version is just 7.3 that comes with Ubuntu, no need to downgrade) (Baidu cloud disk has it)

https://developer.nvidia.com/cuda-10.0-download-archive?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1804&target_type=runfilelocal

Choose CUDNN version 7.4 (Baidu cloud disk has it) (official website and domestic network are slow to enter)

Install CDUA and CUDNN to view the post:

https://blog.csdn.net/qq_18824345/article/details/103810078

Select pytorch version 1.0.0, corresponding to python version 3.6 (available on Baidu cloud disk)

Download each version of pytorch: https://download.pytorch.org/whl/torch_stable.html

Here select torch1.0.0-python3.6 version: cu100-torch-1.0.0-cp36-cp36m-linux_x86_64.whl

This stuff took me all afternoon. The main time is that the download of each software package is too slow, otherwise it can be done in half an hour. The version selection is mainly about the torch version, CUDA and

The CUDNN version must meet the requirements of the torch version and has nothing to do with the graphics card model, so you can directly download the installation package in the Baidu cloud disk, and then the steps are roughly:

  1. Install the driver (can be installed directly in Ubuntu's software update)
  2. Install CUDA (https://blog.csdn.net/qq_18824345/article/details/103810078)
  3. Install CUDNN (https://blog.csdn.net/qq_18824345/article/details/103810078)
  4. 安装torch(https://blog.csdn.net/wuzhiwuweisun/article/details/82753403)

**Problem: **Torch completion in pycharm is incomplete

**解决:**https://mp.weixin.qq.com/s?__biz=MzA3NDY5MDQ0OQ==&mid=2650116050&idx=1&sn=812b53e1ec24e905832f9aefa2b31420&chksm=877ad52cb00d5c3ad28df359903ed81dc960a2418dd591c456c399e42626831de645fe47c3b5&token=1689594628&lang=zh_CN#rd

3. Install mujoco-py

mujoco is a robot simulation tool. If we want to learn robots in reinforcement learning, this is a good tool. Note that this tool is charged, but students have a free license to use it (one person can use it for 10 years, Lao Bai glanced at it)

The installation process was very difficult...

Main body installation teaching reference:

https://zhuanlan.zhihu.com/p/85833777

Here are the pits:

Let me first explain that mujoco is a tool with a C++ interface, and then you have to install the mujoco-py interface library if you want to use it in python. So here we need to install two things, mujoco and mujoco-py. Then the most embarrassing thing is the version selection problem, mujoco The version must conform to the version of mujoco-py, and then the gym installation requires the version of mujoco-py to be [0.15, 0.20), which is basically tied to death. The higher version of the gym requires the installation of importlib.metadata (this thing tm also requires python version 3.7 ).

Finally, a direct summary is to install gym-0.20.0 mujoco150 mujoco-py1.50.1.1 (conforming to python3.6) (there are multiple versions in Baidu cloud disk, including this installation version)

image-20220120100340394

image-20220119214352823

image-20220119214441686

image-20220119214603386

image-20220119214823137

image-20220119214929068

image-20220119215006907

The normal situation of import is:

image-20220119215114173

Here are a few questions about compiling when importing:

**Question 1:** Error "You appear to be missing MuJoCo. We expected to find the file here: /home/username/.mujoco/mujoco210 "

**Solution:** This means that the name of the previous file cannot be arbitrarily determined. You can choose whatever name is mentioned in the error report. For example, mujoco210 should be used here

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-rb7Wd1zn-1642646462728)(/home/caiqidong/snap/typora/46/.config/Typora/typora-user -images/image-20220119215349250.png)]

**Question 2:**fatal error: GL/glew.h: No such file or directory

**Solution:**https://blog.csdn.net/jqw11/article/details/72762981

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-5rl8eDk4-1642646462729)(/home/caiqidong/snap/typora/46/.config/Typora/typora-user -images/image-20220119215556031.png)]

**Question 3:**fatal error: GL/osmesa.h

Solution: sudo apt-get install libosmesa6-dev

Finally, just install a full version of gym, the results are as follows:

image-20220120095839589

4. Install spinningup

Spinning Up is a tutorial series produced by open AI. To install this library, you need to use Python3, MuJoCo, OpenAI Gym and OpenMPI.

Specific steps are as follows:

https://zhuanlan.zhihu.com/p/59990354

Guess you like

Origin blog.csdn.net/caiqidong321/article/details/122514667