安装ubuntu16.04所遇到的问题

问题1

检测到系统程序错误(System program problem detected)

你想立即报告这个问题吗?

sudo gedit /etc/default/apport

把enabled=1改为enabled=0

问题2

sudo apt-get update 出现错误

Reading package lists... Done
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 > /dev/null;
 fi'
E: Sub-process returned an error code
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

问题3

https://www.cnblogs.com/wjgaas/p/6124651.html 

ubuntu gcc 降级 适应matlab

Ubuntu14.04自带的gcc版本是4.8,MATLAB2014a支持的最高版本为4.7x。因此,需要安装gcc4.7,并给gcc降级

在终端执行gcc 4.7的安装命令:

 sudo apt-getupdate

 sudo apt-get install gcc-4.7 g++-4.7 g++-4.7-multilib gcc-4.7-multilib

在终端执行以下系统gcc降级命令(其中数字越大,表示优先级越高):

sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7 100 

sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50 

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 100 

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50

sudo update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.7 100

sudo update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.8 50

验证gcc-4.7是否安装并成为系统的默认版本:

g++ -v
选择gcc或者g++:
sudo update-alternatives --config gcc

问题4

sudo apt-get upgrade 出错

E: Failed to fetch http://39.137.1.197/cache/cn.archive.ubuntu.com/ubuntu/pool/main/p/python-defaults/python_2.7.12-1~16.04_amd64.deb?ich_args2=130-18104309013359_c8badf6a7f667976586d46ec13fe83eb_10001002_9c896029d6c3f1d89f3a518939a83798_83ce1d2044ec694123e9626d88899f6f  Connection failed

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
 

sudo gedit /etc/resolv.conf

添加nameserver 8.8.8.8

问题5

https://blog.csdn.net/sinat_23246437/article/details/54342633

sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
sudo apt-get update && \
sudo apt-get install gcc-snapshot -y && \
sudo apt-get update && \
sudo apt-get install gcc-6 g++-6 -y && \
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6

但是这安装的是gcc6.5 而matlab2018b,使用的是gcc6.3.x

要在Ubuntu 16.04上安装GCC 6.3,请按照以下步骤操作:

https://askubuntu.com/questions/1088658/how-to-install-gcc6-3-x-g6-3-x-on-ubuntu-16-04

GCC 6.3可在Jonathon F的Launchpad存储库中找到:https://launchpad.net/~jonathonf/+archive/ubuntu/gcc-6.3

这个PPA可用于从包中安装GCC 6.3,而不是来自源,这通常应该是最后的手段(请注意,它不是官方的Ubuntu PPA)。

要在Ubuntu 16.04上安装GCC 6.3,请按照以下步骤操作:

删除以前安装的所有gcc-6版本:

sudo apt-get remove --purge gcc-6 g++-6 gcc-6-multilib
sudo apt autoremove

添加gcc-6.3 PPA:

sudo add-apt-repository ppa:jonathonf/gcc-6.3
sudo apt-get update

6.3.0-21ubuntu1~16.04.york0在我们的例子中安装特定的gcc-6.3版本:

VER=6.3.0-21ubuntu1~16.04.york0 && sudo apt-get install gcc-6-base=$VER gcc-6=$VER g++-6=$VER cpp-6=$VER libgcc-6-dev=$VER libstdc++-6-dev=$VER libasan3=$VER

检查刚刚安装的gcc的版本gcc-6 -v。预期:

gcc version 6.3.0 20170628 (Ubuntu 6.3.0-21ubuntu1~16.04.york0)

问题6

完全卸载matlab

1. 删除matlab文件夹
sudo rm -rf MATLAB/ #替换为自己的路径
2. 删除.matlab文件夹
rm -rf .matlab/

隐藏的,在/home/apple下面

显示隐藏 ls -a

猜你喜欢

转载自blog.csdn.net/baidu_40840693/article/details/85061079