https://blog.csdn.net/long19910605/article/details/47017889/

问题:

  更新源时提示不能联网(does the network require authentication?),但是明明可以ping通外网啊,原来是不能访问这个默认源,所以更换一下源

chen@ubuntu:~$ sudo apt-get update
Get: http://ppa.launchpad.net/nginx/stable/ubuntu xenial InRelease [2,281 B]
Err: http://ppa.launchpad.net/nginx/stable/ubuntu xenial InRelease
Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Fetched , B in 0s (, B/s)
Reading package lists... Done
E: Failed to fetch http://ppa.launchpad.net/nginx/stable/ubuntu/dists/xenial/InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: Some index files failed to download. They have been ignored, or old ones used instead.
chen@ubuntu:~$ sudo apt-get install nginx
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package nginx

  编辑:sudo vi /etc/apt/sources.list

在下方添加163的源

deb http://mirrors.163.com/ubuntu/ precise main restricted
deb-src http://mirrors.163.com/ubuntu/ precise main restricted
deb http://mirrors.163.com/ubuntu/ precise-updates main restricted
deb-src http://mirrors.163.com/ubuntu/ precise-updates main restricted
deb http://mirrors.163.com/ubuntu/ precise universe
deb-src http://mirrors.163.com/ubuntu/ precise universe
deb http://mirrors.163.com/ubuntu/ precise-updates universe
deb-src http://mirrors.163.com/ubuntu/ precise-updates universe
deb http://mirrors.163.com/ubuntu/ precise multiverse
deb-src http://mirrors.163.com/ubuntu/ precise multiverse
deb http://mirrors.163.com/ubuntu/ precise-updates multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-updates multiverse
deb http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-security main restricted
deb-src http://mirrors.163.com/ubuntu/ precise-security main restricted
deb http://mirrors.163.com/ubuntu/ precise-security universe
deb-src http://mirrors.163.com/ubuntu/ precise-security universe
deb http://mirrors.163.com/ubuntu/ precise-security multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-security multiverse
deb http://extras.ubuntu.com/ubuntu precise main
deb-src http://extras.ubuntu.com/ubuntu precise main

再次执行:sudo apt-get update

     sudo apt-get upgrade

     sudo apt install nginx

chen@ubuntu:~$ sudo apt-get update
Ign: http://mirrors.163.com/ubuntu precise InRelease
Get: http://mirrors.163.com/ubuntu precise Release [49.6 kB]
Get: http://mirrors.163.com/ubuntu precise Release.gpg [198 B]
Get: http://mirrors.163.com/ubuntu precise/main amd64 Packages [1,273 kB]
Get: http://mirrors.163.com/ubuntu precise/main i386 Packages [1,274 kB]
Get: http://mirrors.163.com/ubuntu precise/restricted amd64 Packages [8,452 B]
Get: http://mirrors.163.com/ubuntu precise/restricted i386 Packages [8,431 B]
Get: http://mirrors.163.com/ubuntu precise/universe amd64 Packages [4,786 kB]
Get: http://mirrors.163.com/ubuntu precise/universe i386 Packages [4,796 kB]
Get: http://mirrors.163.com/ubuntu precise/multiverse amd64 Packages [119 kB]
Get: http://mirrors.163.com/ubuntu precise/multiverse i386 Packages [121 kB]
Fetched 12.4 MB in 6s (, kB/s)
AppStream cache update completed, but some metadata was ignored due to errors.
Reading package lists... Done
W: http://mirrors.163.com/ubuntu/dists/precise/Release.gpg: Signature by key 630239CC130E1A7FD81A27B140976EAF437D05B5 uses weak digest algorithm (SHA1)
chen@ubuntu:~$ sudo apt install nginx
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libgd2-noxpm nginx-common nginx-full
Suggested packages:
libgd-tools
The following NEW packages will be installed:
libgd2-noxpm nginx nginx-common nginx-full
upgraded, newly installed, to remove and not upgraded.
Need to get kB of archives.
After this operation, , kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get: http://mirrors.163.com/ubuntu precise/main amd64 libgd2-noxpm amd64 2.0.36~rc1~dfsg-6ubuntu2 [200 kB]
Get: http://mirrors.163.com/ubuntu precise/universe amd64 nginx-common all 1.1.19-1 [17.8 kB]
Get: http://mirrors.163.com/ubuntu precise/universe amd64 nginx-full amd64 1.1.19-1 [379 kB]
Get: http://mirrors.163.com/ubuntu precise/universe amd64 nginx all 1.1.19-1 [6,612 B]
Fetched kB in 0s ( kB/s)
Selecting previously unselected package libgd2-noxpm:amd64.
(Reading database ... files and directories currently installed.)
Preparing to unpack .../libgd2-noxpm_2.0.36~rc1~dfsg-6ubuntu2_amd64.deb ...
Unpacking libgd2-noxpm:amd64 (2.0.~rc1~dfsg-6ubuntu2) ...
Selecting previously unselected package nginx-common.
Preparing to unpack .../nginx-common_1.1.19-1_all.deb ...
Unpacking nginx-common (1.1.-) ...
Selecting previously unselected package nginx-full.
Preparing to unpack .../nginx-full_1.1.19-1_amd64.deb ...
Unpacking nginx-full (1.1.-) ...
Selecting previously unselected package nginx.
Preparing to unpack .../nginx_1.1.19-1_all.deb ...
Unpacking nginx (1.1.-) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
Processing triggers for systemd (-4ubuntu21.) ...
Processing triggers for ureadahead (0.100.-) ...
Processing triggers for man-db (2.7.-) ...
Setting up libgd2-noxpm:amd64 (2.0.~rc1~dfsg-6ubuntu2) ...
Setting up nginx-common (1.1.-) ...
Setting up nginx-full (1.1.-) ...
Setting up nginx (1.1.-) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
Processing triggers for systemd (-4ubuntu21.) ...
Processing triggers for ureadahead (0.100.-) ...

Ubuntu的Unable to locate package无法更新源问题解决方案的更多相关文章

  1. Ubuntu:Unable to locate package ***

    在Ubuntu 上使用apt-get 安装包时遇到  Unable to locate package 的信息 解决方案: 更细apt-get然后重新安装 #sudo apt-get update   ...

  2. Ubuntu : 解决更新时出现 Unable to locate package update

    当用apt-get更新软件包时常出现错误提示Unable to locate package update, 尤其是在ubuntu server上,解决方法是:     先更新apt-get      ...

  3. linux -- Ubuntu报错“unable to locate package...”

    有时候在Ubuntu命令行中执行安装某个文件的时候,如:sudo apt-get install xinit ,报 “unable to locate package...” 错误,解决办法如下 1. ...

  4. Ubuntu install 错误 E:Unable to locate package

    今天在 Ubuntu 上执行 sudo apt install sl 命令,结果报错:E:Unable to locate package sl 上网查询了一下,先更新一下 apt-get,执行:su ...

  5. 【转】ubuntu 11.04使用apt-get安装软件时一直提示E:unable to locate package

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

  6. Ubuntu Server安装telnet服务时"Unable to locate package telnetd"解决方法

    装好Ubuntu Server 12.04后,用apt-get安装telnetd报"E: Unable to locate package telnetd",解决方法如下: 虚拟机 ...

  7. ubuntu 安装nginx, 出现 Unable to locate package

    今天在初始化一台新的ubuntu 服务器时,敲上了 sudo apt-get install nginx 来安装nginx, 却发现提示:  Reading package lists... Done ...

  8. Docker:Err http://archive.ubuntu.com trusty InRelease & E: Unable to locate package [name] 问题

    参考: Docker containers can't resolve DNS on Ubuntu 14.04 Desktop Host Unable to locate package错误解决办法 ...

  9. ubuntu 14.04 编译内核出现unable to locate package ncurses-devel 问题的解决

    http://cache.baiducontent.com/c?m=9f65cb4a8c8507ed4fece7631046893b4c4380146d96864968d4e414c422461614 ...

随机推荐

  1. PhysicalDrive

    由于"\"是C/C+中转义符, "\\\\.\\"就相当于\\.\ 在Windows中 \\.\ 前缀用于标识设备,其中的"."表示本地计算 ...

  2. Java-Maven-Runoob:Maven教程

    ylbtech-Java-Maven-Runoob:Maven教程 1.返回顶部 1. Maven 教程 Maven 翻译为"专家"."内行",是 Apache ...

  3. ubuntu安装composer

    1.下载composer.phar wget https://getcomposer.org/composer.phar 2.重命名composer.phar为composer mv composer ...

  4. Linux平台总线驱动设备模型

    platform总线是一种虚拟的总线,相应的设备则为platform_device,而驱动则为platform_driver.Linux 2.6的设备驱动模型中,把I2C.RTC.LCD等都归纳为pl ...

  5. linux输入子系统之按键驱动

    上一节中,我们讲解了Linux  input子系统的框架,到内核源码里详细分析了输入子系统的分离分层的框架等. 上一节文章链接:http://blog.csdn.net/lwj103862095/ar ...

  6. python's sixteenth day for me 员工信息表

    import os user_dic = { 'username':None, 'password':None, 'login':True } flag = False name_list = ['i ...

  7. autoit 简单使用-- 操作windows窗口

    autoit 简单使用 autoit中文交流论坛: http://www.autoitx.com/index.php 1 下载 autoit 中文安装包 : https://yunpan.cn/OcP ...

  8. STM32使用无源蜂鸣器演奏歌曲

    上一次使用了有源蜂鸣器,只能发出固定的”滴滴“声,当然不能满足于此呀.使用无源蜂鸣器,只要输出不同频率的PWM波,即可发出不同的音符. 不同的音符组合起来就是一个曲子了. 改变PWM的音调,可以输出D ...

  9. 只能在执行Render() 的过程中调用 RegisterForEventValidation;

    October 17, 2008  3:28 PMMarch 29, 2013  8:28 PM Aillo 编程   0 Comments 在实现"将GridView中的数据导出到Exce ...

  10. IIS监控应用程序池和站点假死,自动重启IIS小工具

    文章技术适合初学者.高级的C#开发工程师这些估计都熟悉到烂了,望不要喷. 第一.C#代码要操作IIS 就必须先导入 Microsoft.Web.Administration.dll ,方便控制台程序做 ...