我正在尝试将我的桌面从 ubuntu 16.04 升级到 18.04。
(我很遗憾在 ubuntu 16.04 EOL 到来之前没有提前升级它。两周前我已经将两个 16.04 笔记本升级到 18.04,尽管它是在 EOL 之后,当时我只能解决一些小问题)。
我做到了sudo apt update
,但在那之后我收到了下面的错误apt upgrade
。
ckim@chan-ubuntu:~/prj/abdsn$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
cpp-5-aarch64-linux-gnu cpp-aarch64-linux-gnu cuda-command-line-tools-10-0 cuda-compiler-10-0 cuda-cublas-10-0 cuda-cublas-dev-10-0 cuda-cudart-10-0
cuda-cudart-dev-10-0 cuda-cufft-10-0 cuda-cufft-dev-10-0 cuda-cuobjdump-10-0 cuda-cupti-10-0 cuda-curand-10-0 cuda-curand-dev-10-0 cuda-cusolver-10-0
cuda-cusolver-dev-10-0 cuda-cusparse-10-0 cuda-cusparse-dev-10-0 cuda-documentation-10-0 cuda-driver-dev-10-0 cuda-gdb-10-0
cuda-gpu-library-advisor-10-0 cuda-libraries-10-0 cuda-libraries-dev-10-0 cuda-license-10-0 cuda-memcheck-10-0 cuda-misc-headers-10-0 cuda-npp-10-0
cuda-npp-dev-10-0 cuda-nsight-10-0 cuda-nsight-compute-10-0 cuda-nvcc-10-0 cuda-nvdisasm-10-0 cuda-nvgraph-10-0 cuda-nvgraph-dev-10-0 cuda-nvjpeg-10-0
cuda-nvjpeg-dev-10-0 cuda-nvml-dev-10-0 cuda-nvprof-10-0 cuda-nvprune-10-0 cuda-nvrtc-10-0 cuda-nvrtc-dev-10-0 cuda-nvtx-10-0 cuda-nvvp-10-0
cuda-samples-10-0 cuda-toolkit-10-0 cuda-tools-10-0 cuda-visual-tools-10-0 gcc-5-aarch64-linux-gnu-base gcc-5-cross-base libasan2-arm64-cross
libatomic1-arm64-cross libc6-arm64-cross libc6-dev-arm64-cross libclang1-3.6 libgcc-5-dev-arm64-cross libgcc1-arm64-cross libgomp1-arm64-cross libgsoap8
libitm1-arm64-cross libllvm3.6v5 libnunit-cil-dev libnunit-console-runner2.6.3-cil libnunit-core-interfaces2.6.3-cil libnunit-core2.6.3-cil
libnunit-framework2.6.3-cil libnunit-mocks2.6.3-cil libnunit-util2.6.3-cil libpng16-16 libpython-dbg libpython2.7-dbg libstdc++-5-dev-arm64-cross
libstdc++6-arm64-cross libubsan0-arm64-cross libvncserver1 libxmu-dev libxmu-headers linux-libc-dev-arm64-cross python-dbg python-kerberos python2.7-dbg
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
Setting up ubuntu-advantage-tools (27.0~16.04.1) ...
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'uaclient'
dpkg: error processing package ubuntu-advantage-tools (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
ubuntu-advantage-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)
命令 python 链接到 python2.7 和 python3 链接到 python3.5 使用替代系统。(更新替代)。接下来我能做什么?
添加:
我在某个地方看到我必须重新安装 opca-client,所以这样做了,
ckim@chan-ubuntu:~$ sudo pip3 install --upgrade opcua-client
然后我看到一个关于 pip 版本的警告,所以我做了 sudo pip install --upgrade pip
然后 sudo pip3 install --upgrade opcua-client 但现在看到下面这个错误:
....
Do you want to continue? [Y/n]
Setting up ubuntu-advantage-tools (27.0~16.04.1) ...
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'uaclient.entitlements'
dpkg: error processing package ubuntu-advantage-tools (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
ubuntu-advantage-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)
对我来说,导致这个问题的原因是我的电脑上安装了额外的 python 发行版
/usr/local/bin/python3
,它/usr/bin/python3
在搜索路径之前。我手动修改了安装后和预删除脚本,/var/lib/dpkg/info/ubuntu-advantage-tools.postinst
并/var/lib/dpkg/info/ubuntu-advantage-tools.prerm
替换python3
为完整路径/usr/bin/python3
。这解决了我的问题。我遇到了类似的问题,这对我有用:
删除 uat,进程将无法完成,可能缺少 uaclient.apt
然后通过以下方式手动删除 uat:
然后
dist-upgrade
或do-release-upgrade
对我来说很好。升级到 18.04@陈金,
Reddit 上的一位用户遇到了类似的问题——我之前看到了解决方案,即更新 PYTHONPATH 以包含 /usr/lib/python3/dist-packages 然后执行更新。
我在这方面取得了圆满成功。
这是我在我的系统中使用的。
解决方案@/r/linux4noobs/ - reddit.com
您应该安装
opcua
并opcua-client
使用默认的 python 命令:sudo mv /var/lib/dpkg/info /var/lib/dpkg/info_old
sudo mkdir /var/lib/dpkg/info
sudo apt-get 更新
为我工作