Ubuntu安装软件包时报错: Failed to fetch ...deb

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/kongxx/article/details/84891387

问题描述

今天在Ubuntu上安装软件包的时候报错,如下:

apt-get install nginx
Failed to fetch http://mirrors.aliyuncs.com/ubuntu/pool/main/n/nginx/nginx_1.4.6-1ubuntu3.4_all.deb

问题原因

Ubuntu自带的一些源不好使导致的。

解决办法

删除 /var/lib/apt/lists/partial 目录下的所有文件,然后运行apt-get update。

cd /var/lib/apt/lists/partial
rm ./* 
apt-get update

然后再次安装软件包

apt-get install nginx

猜你喜欢

转载自blog.csdn.net/kongxx/article/details/84891387