欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Unable to locate package

程序员文章站 2022-07-14 15:34:45
...
                                  Unable to locate package
     在进行ftp和web服务器安装时采用apt-get方式安装一些软件,却总是报出这个错误:Unable to locate package,试了许多办法,改了许多配置文件就是没用,最后才知道是要更新update和upgrade。
     1.sudo apt-get install update 
        sudo apt-get install upgrade
	 2.但是upgrade时又报错了,就是现实不能安装。
	 3.上网查了,是要换成阿里云镜像。
	 4.阿里云镜像如下:
	 # deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties deb http://mirrors.aliyun.com/ubuntu/ xenial universe deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties deb http://archive.canonical.com/ubuntu xenial partner deb-src http://archive.canonical.com/ubuntu xenial partner deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
	 5.具体步骤:
	 5.1 cd /etc/apt/ 
	 5.2 ls 
	 5.3 sudo mv sources.list sources.list_bak
	 5.4 使用记事本(或者Vim等其他编辑器)修改源列表 sudo gedit sources.list
	 5.5粘贴所有阿里云源地址,保存,注意先将以前的全部删除,然后再粘贴。
	 6. 然后再升级更新列表 sudo apt-get install update  
	 7. sudo apt-get install upgrade
	 8. 接下来就可以畅通无阻的下载自己想要的了。
相关标签: ubuntu