1. 問題現象:
在通過sudo apt-get install rpm時報瞭如下錯誤:
應該時apt-get不是最新版本引起的錯誤,
執行sudo apt-get update 但是報如下錯誤:
2. 問題原因 ---- DNS配置錯誤
3. 解決方案 ---- 配置DNS
1. 修改DNS,執行如下命令
sudo vi /etc/resolvconf/resolv.conf.d/base
1. 並插入如下兩行:
nameserver 8.8.8.8
nameserver 8.8.4.4
2. 然後執行 sudo resolvconf -u
3. 查看cat /etc/resolv.conf,是否多了一下兩行
nameserver 8.8.8.8
nameserver 8.8.4.4
4. 如果沒增加,那就手動增加一下 vi /etc/resolv.conf
5. 執行sudo apt-get update
6. Reading package lists... Done 這個提示表示update已完成