问题:

VMware虚拟机安装了ubuntu 11.04,在使用apt-get安装软件时一直提示E:Unable to locate package。
百度了原因,说是要更新源,使用命令:sudo apt-get update更新了,但更新之后问题还是存在;

解决方案:

主要还是源的问题,目前网上找的很多源都是很久以前的了,很多的可能都不能用了; 然后自己重新下载了一个ubuntu 14.04版本的源替换原来的sources.list文件,然后运行sudo apt-get update更新后就可以安装软件了。

更新源地址(这是Ubuntu 14.04的/etc/apt/source.list文件的内容):
#deb cdrom:[Ubuntu 14.04 LTS _Trusty Tahr_ - Release amd64 (20140417)]/ trusty main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to

# newer versions of the distribution.

deb http://us.archive.ubuntu.com/ubuntu/ trusty main restricted

deb-src http://us.archive.ubuntu.com/ubuntu/ trusty main restricted

## Major bug fix updates produced after the final release of the

## distribution.

deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted

deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu

## team. Also, please note that software in universe WILL NOT receive any

## review or updates from the Ubuntu security team.

deb http://us.archive.ubuntu.com/ubuntu/ trusty universe

deb-src http://us.archive.ubuntu.com/ubuntu/ trusty universe

deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates universe

deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 

## team, and may not be under a free licence. Please satisfy yourself as to 

## your rights to use the software. Also, please note that software in 

## multiverse WILL NOT receive any review or updates from the Ubuntu

## security team.

deb http://us.archive.ubuntu.com/ubuntu/ trusty multiverse

deb-src http://us.archive.ubuntu.com/ubuntu/ trusty multiverse

deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse

deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse

## N.B. software from this repository may not have been tested as

## extensively as that contained in the main release, although it includes

## newer versions of some applications which may provide useful features.

## Also, please note that software in backports WILL NOT receive any review

## or updates from the Ubuntu security team.

deb http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse

deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu trusty-security main restricted

deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted

deb http://security.ubuntu.com/ubuntu trusty-security universe

deb-src http://security.ubuntu.com/ubuntu trusty-security universe

deb http://security.ubuntu.com/ubuntu trusty-security multiverse

deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse

## Uncomment the following two lines to add software from Canonical's

## 'partner' repository.

## This software is not part of Ubuntu, but is offered by Canonical and the

## respective vendors as a service to Ubuntu users.

# deb http://archive.canonical.com/ubuntu trusty partner

# deb-src http://archive.canonical.com/ubuntu trusty partner

## This software is not part of Ubuntu, but is offered by third-party

## developers who want to ship their latest software.

deb http://extras.ubuntu.com/ubuntu trusty main

deb-src http://extras.ubuntu.com/ubuntu trusty main

修改Ubuntu系统源的方法:

1、更源的保存文件的权限,在终端中执行下面的命令:

chmod 777 /etc/apt/sources.list

2、打开源文件

在终端中执行下面的命令:

gedit /etc/apt/sources.list

喜欢vi的朋友可以用下面的命令:

vi /etc/apt/sources.list

3、把上面给出的Ubuntu 14.04的源复制到sources.list文件中保存退出,其中以 # 号开头的表示注释,可以一起复制,不会出错。

4、在终端中执行下面的命令:

sudo apt-get update

5、关于添加源后Dynamic MMap ran out of room. Please increase the size of APT::Cache-Limit.*****错误的解决办法:

  a、在终端中输入命令:  vi apt.conf

  b、然后加入如下内容 :

    APT

    {

      Cache-Limit  67108864;

    };

  c、保存退出,再次apt-get update,问题应该就可以解决了,若是你添加的源更多,可能还会报错,那么可以再把67108864这个数值改大,

  主要原因是默认的缓存不够,需要手动设置apt.conf 文件, 在这里设置了64mb

  注:若是没有apt.conf,那么就需要新建apt.conf文件,新建文件之后再执行以上操作。

本文转自:

http://www.itnose.net/detail/6116378.html

http://jingyan.baidu.com/article/f54ae2fcc881881e93b84967.html

【转】ubuntu 11.04使用apt-get安装软件时一直提示E:unable to locate package的更多相关文章

  1. unbuntu 安装python包提示E: Unable to locate package python-timeout

    今天本想着在unbuntu环境下安装python的一个包,安装了几次都提示 E: Unable to locate package python-timeout 查阅了一些信息才知道,原来是一些软件源 ...

  2. Ubuntu中用sudo apt-get install makeinfo时,出错:Unable to locate package

    背景: 在准备ARM交叉编译环境时,执行命令: DISTRO=fsl-imx-x11 MACHINE=imx6qsabresd source fsl-setup-release.sh -b build ...

  3. Linux - 解决使用 apt-get 安装 yum 的时耗报 E: Unable to locate package yum 的错误

    问题背景 在 Linux 系统下使用 apt-get 命令安装 yum 库报错 apt-get install yum E: Unable to locate package yum 问题解决 一行命 ...

  4. yum安装软件时,提示No package netstat available.的解决方法

    1. 序言 如笔者在本机上运行netstat时,提示没有这个命令,向来简单粗暴,直接yum -y install netstat,显然是不能正常安装的. [root@hadoop-103 ~]# yu ...

  5. Ubuntu 16.04通过APT源安装QUEM虚拟机调试Linux内核

    安装: sudo apt-add-repository main sudo apt-get update sudo apt-get install qemu-kvm qemu virt-manager ...

  6. Ubuntu 11.04 LAMP+JSP环境安装过程

    安装LAMP命令:sudo apt-get install apache2 php5 libapache2-mod-php5 mysql-server libapache2-mod-auth-mysq ...

  7. Manifest.xml中删除了『存储/修改删除SD卡中的内容』和『手机通话/读取手机状态和身份』权限,但生成apk安装软件时仍提示 允许应用程序了解或使用这两个权限

    原因:Android系统会给targetSdk版本为“4”以下的应用自动分配WRITE_EXTERNAL_STORAGE 和 READ_PHONE_STATE 权限. 解放办法:在manifest.x ...

  8. Mac安装软件时,提示文件已损坏,需要移动到废纸篓的解决方法

    1.修改系统偏好设置,安全性与隐私-->将“允许从以下位置下载的应用” ☑️任何来源. 2. mac10.12以上的系统一般没有“任何来源”这个选项,需打开terminnal终端,输入 sudo ...

  9. 安装qt5.3.2后,qtcreator在ubuntu 11.04无法启动的问题

    在官方网站下载.run文件安装后,qtcreator启动失败,然后找到命令行启动,失败原因如下: shr@shr-Sieyuan:~/Qt5.3.2/Tools/QtCreator/bin$ ./qt ...

随机推荐

  1. Java微笔记(9)

    使用 Date 和 SimpleDateFormat 类表示时间 处理日期和时间的相关数据,可以使用 java.util 包中的 Date 类 使用 Date 类的默认无参构造方法创建出的对象就代表当 ...

  2. IE劫持

    解析雅虎与百度流氓原理- 为什么“浏览器劫持”能够如此猖狂呢?放眼众多论坛的求助贴,我们不时可以看到诸如“我的IE被主页被改了,我用杀毒工具扫了一遍都没发现病毒,我把主页改回自己的地址,可是一重启它又 ...

  3. linux 下svn忽略文件

    假设想忽略文件temp 1. cd到temp所在的目录下: 2. svn propedit svn:ignore . 注意:请别漏掉最后的点(.表示当前目录),如果报错请看下面 3. 打开的文件就是忽 ...

  4. cli 中php的配置和phpinfo不一样

    这是因为加载的php.ini的路径不一样 可以通过查看 php -i | grep php.ini 来确定两个加载的配置路径是一样的 win中没有grep的命令,可以把php -i 的内容重定向输出到 ...

  5. PHP中普通方法和静态方法

    普通方法(实例方法) 一个类中定义的方法,可以为这个类的所有对象调用的方法.也可以理解为,这个类的所有对象,都各自有自己的一个该方法: 定义形式: class  类名{ function  方法名(形 ...

  6. spring学习 8-面试(事务,解决线程安全)

    1.介绍一下Spring的事物管理 参考:Spring 学习7 -事务 2.Spring如何处理线程并发问题    Spring使用ThreadLocal解决线程安全问题 参考:Spring学习11- ...

  7. Checkbox & Excel

    Checkbox & Excel Q: Excel how to check checkbox? 这个怎么打勾✔ ? A: 可以打勾的 How to Insert and Use a Chec ...

  8. 【C++】指针和引用

    引用: 引用(reference)是为对象起了另外一个名字,引用类型应用(refers to)另外一种类型.通过将声明符写成&d的形式来定义引用类型,其中d是声明的变量名. 一般初始化变量时, ...

  9. 第124天:移动web端-Bootstrap轮播图插件使用

    Bootstrap JS插件使用 > 对于Bootstrap的JS插件,我们只需要将文档实例中的代码粘到我们自己的代码中> 然后作出相应的样式调整 Bootstrap中轮播图插件叫作Car ...

  10. list的迭代器能解决并发问题,collection 的迭代器不能解决并发问题,for可以解决并发问题

    list的迭代器能解决并发问题,collection 的迭代器不能解决并发问题 为什么list支持add,collection不支持 例如有两个人同时添加第三个元素 list的迭代器能锁定线程 只有等 ...