parallel desktop ubuntu从18.04更新到20.04(包括安装Parallels Tools)

ubuntu是怎么更新到20.04的

只说正确的步骤(实际上不是这个顺序)

  • 我之前用了清华镜像源, 修改了/etc/apt/sources.list, 需要把它改回原样, 这个链接就是原样. 做这一步的原因是(报错是), while scanning your repository information no entry about bionic could be found. An upgrade might not succeed.
  • 执行sudo apt list --installed | grep libappstream, 我看到有libappstream4, 再执行sudo apt-get purge libappstream4, 删除这个包
    这一步对应的报错(意思就是做这一步的原因)是: E:Problem executing scripts APT::Update::Post-Invoke-Success ‘if /usr/bin/test -w /var/cache/app-info -a -e /usr/bin/appstreamcli; then appstreamcli refresh-cache > /dev/null; fi‘, E:Sub-process returned an error code
  • sudo do-release-upgrade -d -f DistUpgradeViewGtk3, 然后等待就可以了

是怎么安装Parallels Tools的

我很怀疑Parallels Tools没有装, 执行ls /media/psf, 也的确没有看到任何目录(本来应该有mac的Home目录的), 因此需要重装Parallels Tools

  • parallel desktop ubuntu从18.04更新到20.04(包括安装Parallels Tools)

cd /media, ls, 就会看到有Parallels目录, cd, 看到下面有一个目录是Parallels Tools. cp -r到某个目录, 比如home目录.

之后就是参考这个链接. 也一样遇到了报错, 但这里我就只记录对我可以work的步骤.

以下的操作都是在Parallels Tools目录下进行的.

cd kmod
sudo tar -xzf prl_mod.tar.gz
sudo rm prl_mod.tar.gz
sudo vim prl_fs/SharedFolders/Guest/Linux/prl_fs/prlfs.h # 跳到16行, 加上#include <uapi/linux/mount.h> 
# 以下两步编辑的原因是No rule to make target ‘arch/x86/tools/relocs_32.c‘, needed by ‘arch/x86/tools/relocs_32.o‘.  Stop.
sudo vim ./kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/Makefile # 第20行改为DRIVER_DIR ?= $(shell pwd), 本来是$(PWD)
sudo vim ./kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/Makefile.v26 # 第18行改为$(MAKE) -C $(SRC) M=$(shell pwd) SUBDIRS=$(shell pwd) SRCROOT=$(shell pwd) CC=$(CC) modules, 本来没有M=$(shell pwd)
sudo tar -zcvf prl_mod.tar.gz . dkms.conf Makefile.kmods
cd ../installer
sudo chmod 777 *.sh
sudo ./install-cli.sh -i --verbose
# 提示成功
reboot

这是我整合的步骤, 对应原文中的这两个部分

In a very similar approach, copy the files from the Parallels
installation media and drop them in a folder somewhere (eg.
~/parallels_fixed)

Go to the kmods directory (cd ~/parallels_fixed/kmods) and extract the files (tar -xzf prl_mod.tar.gz)

Remove prl_mod.tar.gz file from that directory (rm prl_mod.tar.gz)

Find this file: ~/<your-folder-goes-here>/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/prlfs.h

Modify the file by going to line 16 and inserting a new line. Add this text: #include <uapi/linux/mount.h>

The file should now look like this. Save and exit.

..
#include <linux/fs.h>
#include <uapi/linux/mount.h>
#include <linux/types.h>
..

Go to the kmods directory (cd ~/parallels_fixed/kmods) and re-zip the files: tar -zcvf prl_mod.tar.gz . dkms.conf Makefile.kmods In case you missed it, yes that is a period(.) sitting there by itself and necessary.

Go to the installer directory cd ~/parallels_fixed/installer

Sudo chmod the script files: install-cli.sh (and others) to be executable eg. sudo chmod 777 *.sh

( @7feilee reports that if drag and drop is not working, then also try sudo chmod 777 prl* as the next step after chmod‘ing the above script files ).

Then run that file with: sudo ./install-cli.sh -i --verbose

Reboot when it‘s finished.

Additionally, I had to modify the following files:

./kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/Makefile:20

DRIVER_DIR ?= $(shell pwd)

./kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/Makefile.v26:18

$(MAKE) -C $(SRC) M=$(shell pwd) SUBDIRS=$(shell pwd) SRCROOT=$(shell pwd) CC=$(CC) modules

NB: That is for Ubuntu 20.04 "kernel 5.4.0-21" and Parallels: 14.1.3 (45485).

然后就与之前ubuntu 18.04用起来完全没差别了

parallel desktop ubuntu从18.04更新到20.04(包括安装Parallels Tools)

上一篇:Linux C errno出错处理


下一篇:shell基础(一)语法基础、搜索、切割、替换、脚本