装软件的时候总是提示dpkg: warning: files list file for package `*****' missing, assuming package has no files currently installed,导致无法安装任何软件,结果百度+Google了好多教程,最后找到的解决办法如下:
(亏得没有轻信别人只能重装系统来解决)
  
#!/bin/bash
set -e
 
# Clean out /var/cache/apt/archives
apt-get clean
# Fill it with all the .debs we need
apt-get --reinstall -dy install $(dpkg --get-selections | grep '[[:space:]]install' | cut -f1)
 
DIR=$(mktemp -d -t info-XXXXXX)
for deb in /var/cache/apt/archives/*.deb
do
    # Move to working directory
    cd "$DIR"
    # Create DEBIAN directory
    mkdir -p DEBIAN
    # Extract control files
    dpkg-deb -e "$deb"
    # Extract file list, fixing up the leading ./ and turning / into /.
    dpkg-deb -c "$deb" | awk '{print $NF}' | cut -c2- | sed -e 's/^\/$/\/./' > DEBIAN/list
    # Figure out binary package name
    DEB=$(basename "$deb" | cut -d_ -f1)
    # Copy each control file into place
    cd DEBIAN
    for file in *
    do
        cp -a "$file" /var/lib/dpkg/info/"$DEB"."$file"
    done
    # Clean up
    cd ..
    rm -rf DEBIAN
done
rmdir "$DIR"
 
 
原理是重新下载所有安装过的软件包,然后从中提取文件列表信息复制到info文件夹里。(所以请在网速较好的时候使用)

ubuntu apt-get 遇到的问题的更多相关文章

  1. ubuntu apt 命令参数(转)

    apt-get是一条linux命令,适用于deb包管理式的操作系统,主要用于自动从互联网的软件仓库中搜索.安装.升级.卸载软件或操作系统. apt-get update 在修改/etc/apt/sou ...

  2. Ubuntu apt 常用命令

     APT(the Advanced Packaging Tool)是Ubuntu 软件包管理系统的高级界面,Ubuntu 是基于Debian的,APT由几个名字以“apt-”打头的程序组成.apt-g ...

  3. Ubuntu——apt && dpkg参考

    一.apt apt-cache search # ------(package 搜索包) apt-cache show #------(package 获取包的相关信息,如说明.大小.版本等) sud ...

  4. Ubuntu apt命令

    http://www.tecmint.com/useful-basic-commands-of-apt-get-and-apt-cache-for-package-management/ apt-ca ...

  5. ubuntu apt update failed to fetch

    When I do command sudo apt update, always get belowing errors: Err:1 http://archive.ubuntu.com/ubunt ...

  6. ubuntu apt不使用代理

    常见的问题是apt使用代理. 不过今天遇到的情况是,桌面进不去,只能tty:在tty界面下,发现1080端口上开着代理,/etc/environment和~/.bashrc中都确保注释掉了http_p ...

  7. Ubuntu apt 使用代理

    . . . . . 由于一台 Ubuntu 主机无法直接连接外网,但同内网的另一台 Windows 主机可以连接外网,于是在 Win 主机上搭建了代理服务,使 Ubuntu 主机通过代理更新系统. 记 ...

  8. ubuntu apt 软件源的更改

    在ubuntu上面安装软件一般都使用 apt安装 在ubuntu下面有一个源列表,源列表里面都是一些网站信息,每条网址就是一个源,这个地址指向的数据标识着这台服务器上有哪些软件可以用 编辑源命令: s ...

  9. [Ubuntu] apt 添加第三方库

    1. 方法一:直接在 /etc/apt/sources.list 添加第三方库. $ sudo vi /etc/apt/sources.list 在其中添加: deb http://archive.s ...

  10. [Ubuntu] APT - Advanced Packaging Tool 简明指南

    Advanced Packaging Tool,一般简称为apt,是Debian GNU/Linux distribution及其变体版本中与核心库一道处理软件的安装和卸载. Ubuntu是Debia ...

随机推荐

  1. How to access the properties of an object in Javascript

    Javascript has three different kinds of properties: named data property, named accessor property and ...

  2. linux内核源码阅读之facebook硬盘加速利器flashcache

    从来没有写过源码阅读,这种感觉越来越强烈,虽然劣于文笔,但还是下定决心认真写一回. 源代码下载请参见上一篇flashcache之我见 http://blog.csdn.net/liumangxiong ...

  3. base64这种编码的意义

    BASE64不是用来加密的.你看看经过BASE64编码后的字符串,全部都是由标准键盘上面的常规字符组成,这样编码后的字符串在网关之间传递不会产生UNICODE字符串不能识别或者丢失的现象.你再仔细研究 ...

  4. selenium 怎么处理display:none

    页面HTML是这样的:  .... <div class="cf w index-middle"> <div id="li" class=&q ...

  5. 操作数组的工具类Arrays

    Java提供的Arrays类里包含一些static修饰的方法可以直接操作数组. int binarySearch(type[] a, type key)使用二分法查询key元素值在a数组中出现的索引, ...

  6. octopress command memo

    1 rake new_post rake new_post[title]           # Begin a new post in source/_posts 2 rake preview ht ...

  7. 关于map

    java为数据结构中的映射定义了一个接口java.util.Map;它有四个实现类,分别是HashMap Hashtable LinkedHashMap 和TreeMap. Map主要用于存储健值对, ...

  8. struts文件上传和下载

    文件上传 jsp中 <a href="/file/new.action">文件上传案例</a> fileaction中 @Override public S ...

  9. Palindrome(最长回文串manacher算法)O(n)

     Palindrome Time Limit:15000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Submit ...

  10. 复习知识点:GCD多线程

    GCD的基础 #pragma mark - 使用GCD 创建一个 串行 队列 // 第一种:系统提供的创建串行队列的方法 // 在真正的开发中如果需要创建串行队列,比较习惯用这种 // dispatc ...