1.提示系统更新升级,报错 /boot空间不足

2.根据网络,为获得/boot 空间,选择删除多余的内核文件

2.1 查询系统当前内核

~$dpkg --get-selections |grep linux-image

eason@eason:~$ dpkg --get-selections |grep linux-image
linux-image-4.4.0-21-generic deinstall
linux-image-4.4.0-57-generic install
linux-image-4.4.0-59-generic install
linux-image-extra-4.4.0-21-generic deinstall
linux-image-extra-4.4.0-57-generic install
linux-image-extra-4.4.0-59-generic install
linux-image-generic install
eason@eason:~$

后面带deinstall的为已删除的内核,可以忽略

2.2使用命令uname -a查看自己当前启动的是哪个内核(一般为最新)

eason@eason:~$ uname -a
Linux eason 4.4.0-59-generic #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

2.3使用命令sudo apt-get purge linux-image-3.5.0-27-generic卸载4.4.0-21和4.4.0-57.建议使用purge,若使用remove卸载则会有遗留或无法卸载。

sudo apt-get purge linux-image-4.4.0-21-generic

sudo apt-get purge linux-image-4.4.0-21-generic
sudo apt-get purge linux-image-4.4.0-57-generic

2.4卸载完后可以用df命令看下boot分区的空间使用情况。

[eason@eason log]# df
文件系统 1K-块 已用 可用 已用% 挂载点
/dev/sda7 19840892 890896 17925856 5% /
/dev/sda9 203727156 112797500 80413912 59% /opt
/dev/sda8 4956284 570080 4130372 13% /var
/dev/sda6 19840892 1977568 16839184 11% /usr
/dev/sda3 988116 23880 913232 3% /boot
tmpfs 16473212 0 16473212 0% /dev/shm

对于因使用remove命令而残留的deinstall的,使用sudo dpkg -P linux-image-extra-4.4.0-21-generic

3.如果天下的问题都能按照教程解决就美好了,BUT...

我的程序在2.3出现了"报错" 憎らしい!

报错信息
File “/usr/bin/pyclean”, line 63
except (IOError, OSError), e:
^
SyntaxError: invalid syntax
dpkg:警告:子进程 旧的 pre-removal 脚本 返回错误状态 1
dpkg: 现在尝试使用新软件包所带的脚本…
File “/usr/bin/pyclean”, line 63
except (IOError, OSError), e:
^
SyntaxError: invalid syntax
dpkg: 处理归档 /var/cache/apt/archives/apport_2.20.1-0ubuntu2.5_all.deb (–unpack)时出错:
子进程 新的 pre-removal 脚本 返回错误状态 1
Traceback (most recent call last):
File “/usr/bin/pycompile”, line 35, in
from debpython.version import SUPPORTED, debsorted, vrepr, \
File “/usr/share/python/debpython/version.py”, line 24, in
from ConfigParser import SafeConfigParser
ImportError: No module named ‘ConfigParser’
dpkg:清理时出错:
子进程 已安装 post-installation 脚本 返回错误状态 1
在处理时有错误发生:
/var/cache/apt/archives/apport_2.20.1-0ubuntu2.5_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

3.1共有三个报错:

子进程 旧的 pre-removal 脚本 返回错误状态 1
子进程 新的 pre-removal 脚本 返回错误状态 1
子进程 已安装 post-installation 脚本 返回错误状态 1

其中报错代码中多次出现

File "/usr/bin/pyclean",line63

File "/usr/bin/pycompile",line35,in<module>

我猜和python有关,查询得知报错原因是因为 在Python 3中, ConfigParser 被重命名为 configparser,而我使用到的package 不支持pyhton3,没有更新。

简言之就是之前因为学习需要,我将系统默认的Python2改为指向Python3,导致了这一问题。

3.2设置Python2与Python3的切换

sudo update-alternatives –-install /usr/bin/python python /usr/bin/python2 100
sudo update-alternatives –-install /usr/bin/python python /usr/bin/python3 150

至于说切换py2.7与3.5版本指向,我现在用IDE了,不怎么直接用py环境,再有ubuntu频繁更新,就不折腾了.

关于ubuntu16.04系统无法系统更新的解决的更多相关文章

  1. ubuntu16.04命令行模式黑屏解决办法

    ubuntu16.04命令行模式黑屏解决办法 问题描述 在ubuntu上装Nvidia的显卡驱动,需要关闭图形界面才能安装驱动,但是,出现如下情况: 使用“ctrl+alt+F1”命令进入命令行界面是 ...

  2. Ubuntu16.04 在Windows10 系统下的安装(双系统)

    楼主最近升级了一个固态+8G双通道内存条,重装了一下win10和ubuntu系统,过程中遇到一些问题,push上来供自己和大家参考.比较好用的博客教程直接贴链接. 一.win10系统 学校有正版软件许 ...

  3. 联想Y7000安装Ubuntu16.04/Win10双系统,wifi问题,显卡驱动和CUDA10安装

    https://blog.csdn.net/la9881275/article/details/86720752 Ubuntu16.04系统安装拿到Ubuntu镜像制作装机优盘,这里就不写了.我的优盘 ...

  4. SSD+HDD 安装ubuntu16.04+win7双系统

    本人电脑是联想天逸100  前段时间把光驱拆了加了一个128G的SSD 顺便把SSD装上了win7  机械硬盘500G放资料和一般软件之类的   后来想要用到ubuntu  就在官网下载ubuntu1 ...

  5. ubuntu16.04无法设置选择wifi的解决办法

    在公司上班一直连接的有线,直到昨天拿回家才发现ubuntu无法选择使用wifi上网,这让人非常无奈,截图类似如下: 而正常情况下我们应该在启用联网的下面有wifi链接的选项,如图: 我隐约猜测是和驱动 ...

  6. Ubuntu16.04+Gnome3 锁定屏幕快捷键无效解决办法

    Ubuntu16.04 桌面环境通过Ubuntu server和后安装的Gnome3 桌面环境实现,安装完以后发现锁定屏幕快捷键无效,系统设置=>键盘=>快捷中 锁屏快捷键已经存在Supe ...

  7. 针对双系统ubuntu16.04卡死及系统没有声音解决方法

    楼主电脑系统状况:win10主系统,128固态为ubuntu系统       安装一共为两次. 第一次出现ubuntu安装成功后没有声音,主系统win10有声音,Ubuntu上检测不到声卡,说明ubu ...

  8. Ubuntu16.04中pip无法更新升级,采用源码方式安装

    1.从pip官网下载最新版 https://pypi.org/project/pip/#files 2.ubuntu中创建文件位置,我的放在一下路径,之后进行解压 3.解压后进入pip的文件夹,在执行 ...

  9. Ubuntu16.04进入无限登录状态的解决办法

    具体来说就是,输入密码之后又到了登录界面,无限循环(也许可能不能输入密码,这种状态我没有测试) 此方案仅适用于安装过NVIDIA显卡驱动的系统并且在登录界面会发现分辨率变了 如果你没有安装过NVIDI ...

  10. Ubuntu16.04 git上网速度慢的解决方法.

    1.打开网站 IPAddress.com ,输入github.com和github.global.ssl.fastly.net,获取他们的域名对应的ip地址 2.sudo vi /etc/hosts ...

随机推荐

  1. pymssql.connect(server='.', user='', password='', database='', timeout=0, login_timeout=60, charset='UTF-8', as_dict=False, host='', appname=None, port='1433', conn_properties, autocommit=False, tds_

    http://pymssql.org/en/stable/ref/pymssql.html """ This is an effort to convert the py ...

  2. Apache Hadoop 3.0.0 Release Notes

    http://hadoop.apache.org/docs/r3.0.0/hadoop-project-dist/hadoop-common/release/3.0.0/RELEASENOTES.3. ...

  3. MVC中从Controller像View层传值

    MVC中的Controller不能直接的訪问View层中的控件,那么是怎样的将Controller中值传到View中,经常使用的有4种 ViewData: 是获取或设置视图的字典对象,它里面存放的是键 ...

  4. ABAP 邮件

    function zint_send_email.*"-------------------------------------------------------------------- ...

  5. Ubuntu 搭建 LAMP 服务器

    /******************************************************************** * Ubuntu 搭建 LAMP 服务器 * 说明: * 想 ...

  6. pymemcache get start

    Getting started! A comprehensive, fast, pure-Python memcached client library. Basic Usage from pymem ...

  7. Bootstrap标签页

    用法 您可以通过以下两种方式启用标签页: 通过 data 属性:您需要添加 data-toggle="tab" 或 data-toggle="pill" 到锚文 ...

  8. log4j的1.2.15版本,在pom.xml中的顶层project报错错误: Failure to transfer javax.jms:jms:jar:1.1 from https://maven-repository.dev.java.net/nonav/repository......

    在动态网站工程中,添加了Pom依赖,当添加log4j的1.2.15版本依赖时,在pom.xml中的顶层project报错错误: Failure to transfer javax.jms:jms:ja ...

  9. maven中添加json-lib的jar包

    在maven配置文件pom.xml中添加如下配置信息: <dependency> <groupId>net.sf.json-lib</groupId> <ar ...

  10. linux文件名乱码时删除或改名的方式(转载)

    转自:http://www.linuxsa.cn/when-linux-file-name-topsy-turvy-deleted-or-renamed.html linux文件名乱码时删除或改名的方 ...