ubuntu必備操作
1 更換apt鏡像源
- 備份鏡像
cp /etc/apt/sources.list /etc/apt/sources.list.bak
- 查看自己ubuntu版本
# 查看自己的codename
#查看自己的ubuntu版本[注意關(guān)注:DISTRIB_CODENAME,發(fā)行代號]
cat /etc/*release
# DISTRIB_CODENAME=cosmic
# 例如(下面是ubuntu的LTS長期支持版):
# Ubuntu20.04(focal)
# Ubuntu19.10(eoan)
# Ubuntu19.04(disco)
# Ubuntu18.04(bionic)
# Ubuntu16.04(xenial)
- 設(shè)置國內(nèi)鏡像源
我ubuntu的版本是18.10,國內(nèi)上沒有維護對應(yīng)的鏡像,但是大版本一致即可(所以我采用了bionic)文章來源:http://www.zghlxwxcb.cn/news/detail-659586.html
vim /etc/apt/sources.list
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
- 更新軟件列表,完成換源
apt update
- 修復(fù)損壞的軟件包
apt-get install -f
- 更新軟件
apt-get upgrade
2 其他命令
①防火墻相關(guān)文章來源地址http://www.zghlxwxcb.cn/news/detail-659586.html
# 查看防火墻狀態(tài)
sudo ufw status
# 開啟/關(guān)閉防火墻
sudo ufw enable/disable
到了這里,關(guān)于ubuntu更換國內(nèi)apt源的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!