问题:

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. UITableViewCell contentView layoutSubviews 死循环

    发现一个问题,当在UITableViewCell 的 layoutSubviews 中修改 contentView 的frame时会产生死循环.该问题只会出现在iOS8中,iOS7与iOS9均没有问题 ...

  2. 注解实现IOC和DI

    1.组件扫描 Spring3.0后为我们引入了组件自动扫描机制,它可以在类路径底下寻找标注了@Component.@Service.@Controller.@Repository注解的类,并把这些类纳 ...

  3. jQuery之属性

    1. 操作任意属性 attr() 操作非布尔值的 removeAttr() prop() 操作布尔值的2. 操作class属性 addClass() 添加class属性 removeClass() 移 ...

  4. QJsonDocument实现Qt下JSON文档读写

    版权声明:若无来源注明,Techie亮博客文章均为原创. 转载请以链接形式标明本文标题和地址: 本文标题:QJsonDocument实现Qt下JSON文档读写     本文地址:http://tech ...

  5. Oracle数据库表空间常用操作

    1. 查看所有表空间大小 SQL> select tablespace_name,sum(bytes)/1024/1024 from dba_data_files group by tables ...

  6. ASP.NET前后端分离框架

  7. [翻译]API Guides - Bound Services

    官方文档原文地址:http://developer.android.com/guide/components/bound-services.html 一个Bound Service是一个客户端-服务器 ...

  8. FZU2127_养鸡场

    题目的意思为要你求出满足三边范围条件且周长为n的三角形的数目. 其实做法是直接枚举最短边,然后就可以知道第二条边的取值范围,同时根据给定的范围缩小范围. 同时根据第二条边的范围推出第三条边的范围,再次 ...

  9. bzoj1853-大包子的幸运数字

    题意 称只含有 6 和 8 的数字为幸运数字.称幸运数字的倍数为类幸运数字.求 \([l,r]\) 中有多少个类幸运数字.\(1\le l,r\le 10^{10}\) . 分析 幸运数字最多有 \( ...

  10. Ubuntu 18.04开发环境部署流程

    部署流程 安装系统 安装Eclipse和jre 配置系统 安装辅助工具 安装系统 用安装盘安装即可. 一般boot 1G,swap按内存大小,home 20G,根剩余. 安装Eclipse和jre 解 ...