ubuntu源文件打不開could not open file '/etc/apt/sources.list.d/...

問題描述:

WARNING:root:could not open file '/etc/apt/sources.list.d/sources-aliyun-0.list'shell

解決方案:

1.將/etc/apt/sources.list與/etc/apt/sources.list.d/sources-aliyun-0.list複製一份副本

2.將這兩個原文件內容更換爲如下內容,並保存退出

# 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

3.

sudo apt-get update
sudo apt-get upgradeubuntu

至此 問題解決
小編遇到了這個問題 查了不少資料 都沒能獲得有效的解決
後來將這兩個源文件裏的內容改爲一致 發現問題才獲得解決
若是解決不了 還請多多見諒 繼續查查其餘方法
畢竟形成問題的緣由不同 解決方案也會有所差別
祝你好運!!rest

相關文章
相關標籤/搜索