新聞中心
在Ubuntu 20.04中更換國(guó)內(nèi)源,可以提高訪問(wèn)速度,同時(shí)也有利于支持國(guó)內(nèi)的開(kāi)源項(xiàng)目,本文將介紹如何在Ubuntu 20.04中更換國(guó)內(nèi)源,并提供一個(gè)相關(guān)問(wèn)題與解答的欄目。

讓客戶滿意是我們工作的目標(biāo),不斷超越客戶的期望值來(lái)自于我們對(duì)這個(gè)行業(yè)的熱愛(ài)。我們立志把好的技術(shù)通過(guò)有效、簡(jiǎn)單的方式提供給客戶,將通過(guò)不懈努力成為客戶在信息化領(lǐng)域值得信任、有價(jià)值的長(zhǎng)期合作伙伴,公司提供的服務(wù)項(xiàng)目有:空間域名、網(wǎng)站空間、營(yíng)銷軟件、網(wǎng)站建設(shè)、綏芬河網(wǎng)站維護(hù)、網(wǎng)站推廣。
一、準(zhǔn)備工作
1. 備份原有的`sources.list`文件:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
2. 使用文本編輯器打開(kāi)`sources.list`文件:
sudo nano /etc/apt/sources.list
二、更換國(guó)內(nèi)源
以阿里云鏡像源為例,替換原有的源為阿里云的源:
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
三、更新軟件包列表并安裝軟件
sudo apt update && sudo apt upgrade -y
四、常見(jiàn)問(wèn)題與解答
1. 如何添加其他國(guó)內(nèi)源?
答:除了阿里云鏡像源,還有很多其他的國(guó)內(nèi)源,如清華大學(xué)、中國(guó)科技大學(xué)等,只需將上述代碼中的“替換為相應(yīng)的源地址即可,使用清華大學(xué)鏡像源:
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
2. 如何刪除某個(gè)軟件包?
答:使用`apt remove`命令刪除指定的軟件包,刪除名為`example-package`的軟件包:
sudo apt remove example-package
3. 如何查找已安裝的軟件包?
答:使用`dpkg –get-selections | grep installed`命令查找已安裝的軟件包,查找已安裝的軟件包:
dpkg --get-selections | grep installed
分享名稱:ubuntu20.04更換國(guó)內(nèi)源
鏈接地址:http://www.dlmjj.cn/article/dhieieh.html


咨詢
建站咨詢
