运行 sudo apt-get update
【报错】 Sub-process returned an error code
【问题1】./usr/lib/cnf-update-db: not found
【解决】:
在/usr/bin里
sudo cp python python3
【问题2】. Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi'
【解决】:
在终端执行如下几条命令:
>>sudo pkill -KILL appstreamcli
>>wget -P /tmp https://launchpad.net/ubuntu/+archive/primary/+files/appstream_0.9.4-1ubuntu1_amd64.deb https://launchpad.net/ubuntu/+archive/primary/+files/libappstream3_0.9.4-1ubuntu1_amd64.deb
>>sudo dpkg -i /tmp/appstream_0.9.4-1ubuntu1_amd64.deb /tmp/libappstream3_0.9.4-1ubuntu1_amd64.deb
理论上运行完这三条命令之后就可以update了。
我的机器:输入第三条报错:
Errors were encountered while processing:
libappstream3:amd64
appstream
错误显示为appstream报错,appstream是几个主要GNU/Linux提供者之间的协议,目的是为了创造一个Linux上的共同的软件安装程序以及一个同意的软件安装图形用户界面,还有分享元数据用的。
这里报错的原因是,ubuntu内置的libappstream是2.0以前的版本,我们必须更新到3.0以上的版本才可以。
【解决】:
安装libappstream3,在ubuntu下安装非常简单,直接通过apt安装appstream
>>sudo apt-get purge libappstream3
【报错】Unable to locate package libappstream3
【解决】换阿里云源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
>>sudo apt update
做了这么多之后,问题居然还在。
========================================================================
【报错】
error: Execution failed: "ac++" --system-config "/tmp/agxx_pcfgyTVY49" -p. -c "test_origin.cpp" -o "/tmp/test_origin.cpp_agxx_H1D6yo"
【解决】:
安装>> sudo apt install aspectc++
路径位于:lib/aspectc++ 安装成功
打开README文件
Prerequisites for compiling the AspectC++ project from the source
repository:
- The GNU C++ compiler (g++), normally the default compiler of
the mainstream Linux distributions will work.
- Working binaries for ac++ and ag++ (the Puma library itself
is implemented in AspectC++!) -- you can get binaries from
http://www.aspectc.org/. Unpack the tarball and make sure the
directory which contains ag++ and ac++ is in your command
search path.
Hint: Woven sources from http://www.aspectc.org/ do not require
working ac++ and ag++ for compiling Puma. Adjust the first step to:
$ make -C Puma compile
- libxml2 including header files (libxml2-dev on some Linux
distributions). Check if the xml2-config command is in your
command search path.
Steps for compiling the AspectC++ project (for details, consult the
README files within each of the subdirectories):
运行
chmod +x compilersimulation.sh
给client文件加入执行权限,成功。
运行
./compilersimulation.sh
报错(已安装aspect c++)
error: Execution failed: "ac++" --system-config "/tmp/agxx_pcfgzmJz0n" -p. -c "test_origin.cpp" -o "/tmp/test_origin.cpp_agxx_16yED9"
运行
./automonitor
成功,但由于client部分报错,这部分没有自动刷新。