问题:

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. 【分层最短路】Joyride

    http://codeforces.com/gym/101873 C 多开一维状态记录时间,d[i][t] = 经过时间t走到节点i的最小花费 每一个状态分别向"原地等待"与&qu ...

  2. c++团队作业工作笔记

    这周时间还比较充裕,所以就有较多的时间来投入团队作业之中. emmmm,由于组长那边感觉完全没动,于是我完成了选英雄的UI界面,到时候给button加上信号就没什么问题. 虽然界面比较简单,但是还是花 ...

  3. BundleCollection学习(一)

    工作中有同事提到了mvc4提供了css,js压缩功能.类BundleCollection所以搜集资料记录学习下. 学习中………… MVC中用 BundleCollection 压缩CSS时图片路径问题 ...

  4. Java package

    Java中的一个包就是一个类库单元,包内包含有一组类,它们在单一的名称空间之下被组织在了一起.这个名称空间就是包名.可以使用import关键字来导入一个包.例如使用import java.util.* ...

  5. 虚拟机下安装CentOS6.5系统教程

    虚拟机下安装CentOS6.5系统教程 时间:2014-12-09 01:40来源:linuxdown.net 作者:linuxdown.net 举报 点击:15315次 其实通过VM安装虚拟机还是蛮 ...

  6. 一些Redis面试题

    1. 使用Redis有哪些好处? (1) 速度快,因为数据存在内存中,类似于HashMap,HashMap的优势就是查找和操作的时间复杂度都是O(1) (2) 支持丰富数据类型,支持string,li ...

  7. urllib2 request 模拟伪装浏览器

    直接上代码吧 # -*- coding:utf-8 -*- import urllib2 import random url = "http://www.baidu.com/" # ...

  8. SSH管理(重启 停止 运行 安装)centos7

    下面整理经常用到管理SSH服务的命令,方便复制哈. SSH服务状态 systemctl status sshd.service SSH运行命令 service sshd start SSH重启命令 s ...

  9. 第130天:移动端-rem布局

    一.关于布局方案 当拿到设计师给的UI设计图,前端的首要任务就是布局和样式,相信这对于大部分前端工程师来说已经不是什么难题了.移动端的布局相对PC较为简单,关键在于对不同设备的适配.之前介绍了一篇关于 ...

  10. 第114天:Ajax跨域请求解决方法(二)

    一.什么是跨域 我们先回顾一下域名地址的组成: http:// www . google : 8080 / script/jquery.js   http:// (协议号)       www  (子 ...