机械师-创物者M 安装UBUNTU 20.04 (WIN 10 + Ubuntu 20 双系统)

环境

笔记本: 机械师创物者M 144Hz设计笔记本电脑十代i7-10875H/RTX2060独显轻薄全面屏游戏本 标配16G/512G PCIE高速固态

加装1T SSD: 西部数据(Western Digital)1TB SSD固态硬盘 M.2接口(NVMe协议) WD_BLACK SN750游戏高性能版五年质保
Download Ubuntu Desktop

默认已装好WIN10, UBUNTU将会装在加装的1T SSD上.

安装Ubuntu

参考:ACER Nitro AN515-54 WIN10 + Ubuntu 16.04双系统

  • 创物者M的BIOS键是 F2
  • 修改完BOOT选项, 保存并生效 F4
  • 其它的安装流程与上文一致
  • 安装完成后, 可以更改BIOS设置由WIN10或UBUNTU引导, 从UBUNTU引导, 可以有菜单选择进哪个系统
    机械师-创物者M 安装UBUNTU 20.04 (WIN 10 + Ubuntu 20 双系统)_第1张图片

PS: 来来回回装了Ubuntu 18.04和Ubuntu 20.04不下10回, 当然, 非笔记本问题, 更多是在软件兼容性和环境配置上, 有问题的U盘也相当坑.


环境安装

  • 五笔输入法
    极点五笔for Ubuntu安装
    (不生效)Ubuntu输入法设置不能保存

  • VirtualBox
    不管是从官网下载安装, 还是从软件中心安装, 以下方法均无效
    如何在 Ubuntu 中修复 VirtualBox 的 “Kernel driver not installed (rc=-1908)” 错
    Kernel driver not installed (rc=-1908) error in VirtualBox [duplicate]
    How to sign a kernel module Ubuntu 18.04
    How To Fix “Kernel driver not installed (rc=-1908)” VirtualBox Error In Ubuntu
    How to fix ‘modprobe vboxdrv’ error in virtualBox?

抛开以上种种问题, 回归本质, 请在BIOS中关闭Secure Boot

接下来就简单多了

  1. 通过软件中心搜索并安装VirtualBox, 版本: 6.1.10_Ubuntu r138449
  2. 从VirtualBox官网下载对应的6.1.10版本的扩展包, 双击安装上即可
  3. USB访问: sudo addgroup myusername vboxusers
  4. 装完虚拟系统后, 安装设备 > 安装增强功能

  • Android Studio(此方法在后续重装后已不需要, 具体原因未知)
    Android Studio /dev/kvm device : permision denied解决办法

  • 在WIN10中, 除了系统分区外, 还有一个DATA分区, 想把它挂载到Ubuntu上, 发现这个分区不可写入
    解决Ubuntu 20.04挂载NTFS分区不能写入(只读权限)的问题

  • 美化
    Ubuntu增大屏幕可用面积之——自动隐藏顶部状态栏

  • VIM 中文乱码
    Ubuntu16.04 vim中文乱码

  • 创建应用图标, 以AndroidStudio为例

anson@anson-MR26:/home$ cat /usr/share/applications/as.desktop 
[Desktop Entry]
Type=Application
Name=AndroidStudio
Comment=Android Studio 4.1
Icon=/work/devEnv/android-studio/bin/studio.png
Exec=/work/devEnv/android-studio/bin/studio.sh
Terminal=false
Categories=Development;IDE;Java;GNOME;GTK;
StartupWMClass=jetbrains-studio

重启后生效Ubuntu 18.04收藏夹同一程序两个图标问题


编译Android

  • 编译android 7.1 kernel 失败, 主要是由于python版本的问题
/work/codes/rk3288_n712/u-boot/lib/optee_clientApi/tabinary_to_cfile.py --prefix keymaster --TA lib/optee_clientApi/258be795-f9ca-40e6-a8699ce6886c5d5d.ta --out lib/optee_clientApi/258be795-f9ca-40e6-a8699ce6886c5d5d.c
  CC      lib/optee_clientApi/OpteeClientRkFs.o
/usr/bin/env: “python”: 没有那个文件或目录
make[2]: *** [/work/codes/rk3288_n712/u-boot/lib/optee_clientApi/Makefile:18:lib/optee_clientApi/258be795-f9ca-40e6-a8699ce6886c5d5d.c] 错误 127
make[2]: *** 正在等待未完成的任务....
  LD      lib/libfdt/built-in.o
lib/optee_clientApi/OpteeClientInterface.c: In function 'test_optee':
lib/optee_clientApi/OpteeClientInterface.c:35:2: warning: implicit declaration of function 'StorageGetBootMedia' [-Wimplicit-function-declaration]
  if (StorageGetBootMedia() == BOOT_FROM_EMMC) {
  ^
make[1]: *** [scripts/Makefile.build:422:lib/optee_clientApi] 错误 2
make: *** [Makefile:1184:lib] 错误 2
make: *** 正在等待未完成的任务....
  LD      drivers/video/built-in.o
  LD      drivers/built-in.o
INFO: start build kernel
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#
/usr/bin/env: “python”: 没有那个文件或目录
scripts/kconfig/conf  --silentoldconfig Kconfig
Makefile:717: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
/usr/bin/env: “python”: 没有那个文件或目录

感觉是python的问题, 试了下python命令, 提示找不到

anson@anson-MR26:/work/codes/Builder$ python
Command 'python' not found, did you mean:
  command 'python3' from deb python3
  command 'python' from deb python-is-python3
#创建软链
ln -sf /usr/bin/python3 /usr/bin/python
/work/codes/rk3288_n712/u-boot/lib/optee_clientApi/tabinary_to_cfile.py --prefix keymaster --TA lib/optee_clientApi/258be795-f9ca-40e6-a8699ce6886c5d5d.ta --out lib/optee_clientApi/258be795-f9ca-40e6-a8699ce6886c5d5d.c
  LD      common/built-in.o
Traceback (most recent call last):
  File "/work/codes/rk3288_n712/u-boot/lib/optee_clientApi/tabinary_to_cfile.py", line 58, in 
    main()
  File "/work/codes/rk3288_n712/u-boot/lib/optee_clientApi/tabinary_to_cfile.py", line 31, in main
    TAdata = f.read()
  File "/usr/lib/python3.8/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa3 in position 20: invalid start byte
make[2]: *** [/work/codes/rk3288_n712/u-boot/lib/optee_clientApi/Makefile:18:lib/optee_clientApi/258be795-f9ca-40e6-a8699ce6886c5d5d.c] 错误 1
make[1]: *** [scripts/Makefile.build:422:lib/optee_clientApi] 错误 2
make: *** [Makefile:1184:lib] 错误 2

找了另一台电脑查了下版本, 用的是2.7.

#创建软链
ln -sf /usr/bin/python2.7 /usr/bin/python

再编, 通过!


  • android make 失败
prebuilts/clang/host/linux-x86/clang-2690385/bin/clang++   -fno-exceptions -Wno-multichar -m64 -Wa,--noexecstack -fPIC -no-canonical-prefixes -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -O2 -g -fno-strict-aliasing -DNDEBUG -UDEBUG  -D__compiler_offsetof=__builtin_offsetof -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument   --gcc-toolchain=prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8 -fstack-protector-strong    --gcc-toolchain=prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8 --sysroot prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/sysroot -Bprebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/bin -target x86_64-linux-gnu   -Wsign-promo  -Wno-inconsistent-missing-override   --gcc-toolchain=prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8 --sysroot prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/sysroot -isystem prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/include/c++/4.8 -isystem prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/include/c++/4.8/x86_64-linux -isystem prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/include/c++/4.8/backward -target x86_64-linux-gnu -c -std=c++11 -g -W -Wall -MMD -MP -O -DNOLOG -march=native -o out/host/linux-x86/obj/EXECUTABLES/ckati_intermediates/affinity.o build/kati/affinity.cc
prebuilts/clang/host/linux-x86/clang-2690385/bin/clang++: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
make: *** [build/kati/Makefile.ckati:89:out/host/linux-x86/obj/EXECUTABLES/ckati_intermediates/affinity.o] 错误 127

#### make failed to build some targets  ####

解决: error while loading shared libraries: libncurses.so.5:

sudo apt-get install libncurses5

[  1% 598/36361] Lex: aidl <= system/tools/aidl/aidl_language_l.ll
FAILED: /bin/bash -c "prebuilts/misc/linux-x86/flex/flex-2.5.39 -oout/host/linux-x86/obj/STATIC_LIBRARIES/libaidl-common_intermediates/aidl_language_l.cpp system/tools/aidl/aidl_language_l.ll"
flex-2.5.39: loadlocale.c:130:_nl_intern_locale_data: ?? 'cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' ???
Aborted (core dumped)

解决:android8.1编译错误flex-2.5.39: loadlocale.c:130:_nl_intern_locale_data:
~/.bashrc, 加上最后一行

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi
export LC_ALL=C

执行source ~/.bashrc

+++++++++++++++++++++++++++++++++注意注意+++++++++++++++++++++++++++++++++

关于export LC_ALL=C 请慎用, 在后续使用过程中, 发现加上后会导致终端中无法正常显示和输入中文

---------------------------------------------------------注意注意------------------------------------------------------------


命令记录

#JDK
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-7-jdk
sudo apt-get install openjdk-8-jdk

sudo apt-get install vim
sudo apt-get install minicom

#追加源
sudo echo "deb http://us.archive.ubuntu.com/ubuntu trusty main universe" >> /etc/apt/sources.list
sudo apt-get update

#安装依赖
sudo apt-get install git gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386
sudo apt-get install lzop libncurses5
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
sudo apt-get install mingw32
sudo apt-get install  automake make perl gcc g++

#SSH 服务端
sudo apt-get install openssh-server chrome-gnome-shell

#输入法
sudo apt install fcitx-bin

#VirtualBox 访问U盘
sudo addgroup anson vboxusers

#Android编译环境补充
sudo ln -sf /usr/bin/python2.7 /usr/bin/python
echo "export LC_ALL=C" >> ~/.bashrc
source .bashrc 

完成

你可能感兴趣的:(Linux,机械师,创物者M,ubuntu,20,双系统,VirtualBox)