ubuntu系统中docker下的ubuntu镜像apt-get无法使用问题解决

本人菜鸟,要apt-get install default-jdk时死活下载不下来,不是这有问题就是那有问题,各种apt-get能出现的问题都出现了一个遍,例如,0%连接,err1:,Unable to correct problems, you have held broken packages等等
真是改bug改到吐血,越改bug越多
最后终于解决了,看到java -version后的结果,我真的狠掬一把泪,终于!
记录一下我觉得可能起作用的一些操作
1 dns加上
nameserver 8.8.8.8
nameserver 8.8.4.4
2 换源!真的是换源换到吐血,终于找到了我那个对的源
打开 /etc/apt/sources.list
源在这里:
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

你可能感兴趣的:(ubuntu,ubuntu)