国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

更換 Ubuntu 系統(tǒng) apt 命令安裝軟件源

這篇具有很好參考價(jià)值的文章主要介紹了更換 Ubuntu 系統(tǒng) apt 命令安裝軟件源。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

更換 Ubuntu 系統(tǒng) apt 命令安裝軟件源

清華大學(xué)開源軟件鏡像站
https://mirrors.tuna.tsinghua.edu.cn/

1. Ubuntu 的軟件源配置文件 /etc/apt/sources.list

MIRRORS -> 使用幫助 -> ubuntu
https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/

apt換源,Linux - Ubuntu Desktop Server,Ubuntu 系統(tǒng),更換 apt 命令安裝軟件源

Ubuntu 系統(tǒng) apt 命令安裝軟件默認(rèn)源為國外源 (服務(wù)器位于國外),在國內(nèi)使用速度較慢,建議改為國內(nèi)的鏡像源服務(wù)器。

Ubuntu 的軟件源配置文件 /etc/apt/sources.list

yongqiang@yongqiang:~$ cat /etc/apt/sources.list
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu/ focal main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu/ focal universe
# deb-src http://archive.ubuntu.com/ubuntu/ focal universe
deb http://archive.ubuntu.com/ubuntu/ focal-updates universe
# deb-src http://archive.ubuntu.com/ubuntu/ focal-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://archive.ubuntu.com/ubuntu/ focal multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ focal multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-updates multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ focal-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu focal partner
# deb-src http://archive.canonical.com/ubuntu focal partner

deb http://security.ubuntu.com/ubuntu/ focal-security main restricted
# deb-src http://security.ubuntu.com/ubuntu/ focal-security main restricted
deb http://security.ubuntu.com/ubuntu/ focal-security universe
# deb-src http://security.ubuntu.com/ubuntu/ focal-security universe
deb http://security.ubuntu.com/ubuntu/ focal-security multiverse
# deb-src http://security.ubuntu.com/ubuntu/ focal-security multiverse
yongqiang@yongqiang:~$

備份軟件安裝源配置文件,以防更換的軟件源無法使用,可以使用備份文件再恢復(fù)到原來的鏡像源地址。

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
yongqiang@yongqiang:~$ lsb_release -c
Codename:       focal
yongqiang@yongqiang:~$
yongqiang@yongqiang:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:        20.04
Codename:       focal
yongqiang@yongqiang:~$
yongqiang@yongqiang:~$ lsb_release -a | grep Codename | awk '{print $2}'
No LSB modules are available.
focal
yongqiang@yongqiang:~$

yongqiang@yongqiang:~$ cat /etc/issue
Ubuntu 20.04.3 LTS \n \l

yongqiang@yongqiang:~$

yongqiang@yongqiang:~$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.3 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
yongqiang@yongqiang:~$

2. 清華大學(xué)開源軟件鏡像站 - Ubuntu 鏡像

https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
本鏡像僅包含 32/64 位 x86 架構(gòu)處理器的軟件包,在 ARM (arm64, armhf)、PowerPC (ppc64el)、RISC-V (riscv64) 和 S390x 等架構(gòu)的設(shè)備上 (對(duì)應(yīng)官方源為 ports.ubuntu.com) 請(qǐng)使用 ubuntu-ports 鏡像。

2.1. 手動(dòng)替換

Ubuntu 的軟件源配置文件是 /etc/apt/sources.list。將系統(tǒng)自帶的該文件備份,在該文件末尾添加下面的內(nèi)容,即可使用 TUNA 的軟件源鏡像。

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

更換軟件安裝源

sudo vim /etc/apt/sources.list

選擇你的 ubuntu 版本: 20.04 LTS

# 默認(rèn)注釋了源碼鏡像以提高 apt update 速度,如有需要可自行取消注釋
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
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse

# 預(yù)發(fā)布軟件源,不建議啟用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse

因鏡像站同步有延遲,可能會(huì)導(dǎo)致生產(chǎn)環(huán)境系統(tǒng)不能及時(shí)檢查、安裝上最新的安全更新,不建議替換 security 源。

2.2. 命令替換

執(zhí)行如下命令自動(dòng)替換

sudo sed -i "s@http://.*archive.ubuntu.com@https://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list
sudo sed -i "s@http://.*security.ubuntu.com@https://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list

更新軟件列表:

sudo apt-get update --yes
sudo apt update --yes

更新軟件:

sudo apt-get upgrade --yes
sudo apt upgrade --yes

3. Certificate verification failed: The certificate is NOT trusted.

Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.  Could not handshake: Error in the certificate verification.

3.1. 更新證書 ca-certificates (建議)

  1. 編輯 /etc/apt/sources.list 文件,臨時(shí)將 https 源修改為 http 源。
  2. 更新證書 ca-certificates
sudo apt install ca-certificates
sudo apt-get install --reinstall ca-certificates
sudo apt install apt-transport-https ca-certificates

sudo apt-get update
  1. 編輯 /etc/apt/sources.list 文件,將 http 源修改回 https 源。

3.2. https 源修改為 http 源

編輯 /etc/apt/sources.list 文件,將 Ubuntu 對(duì)應(yīng)版本的軟件源里的 https 替換成 http,https 是加密傳輸,需要證書認(rèn)證。去掉 s,將 https 源修改為 http 源。

References

https://yongqiang.blog.csdn.net/
https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/文章來源地址http://www.zghlxwxcb.cn/news/detail-737659.html

到了這里,關(guān)于更換 Ubuntu 系統(tǒng) apt 命令安裝軟件源的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • Ubuntu apt-get換源

    Ubuntu apt-get換源

    ubuntu16.04更換鏡像源為阿里云鏡像源 輕量小巧的零配置 APT 加速工具:APT Proxy GitHub項(xiàng)目地址:apt-proxy 備份源配置文件。 打開阿里云鏡像站:OPSX阿里云開源鏡像站,找到Ubuntu,點(diǎn)擊右邊的幫助,查看對(duì)應(yīng)版本的鏡像源信息。 相關(guān)配置 修改 sources.list ,更新鏡像源,更新倉庫信

    2024年02月04日
    瀏覽(23)
  • docker ubuntu tomcat 換源 安裝軟件

    docker ubuntu tomcat 換源 安裝軟件

    options 說明 option 作用 -a 存檔模式(復(fù)制所有uid / gid信息) -L 保持源目標(biāo)中的鏈接 ? ? ?ubuntu 22.04阿里源

    2024年02月19日
    瀏覽(20)
  • ubuntu22.04 安裝優(yōu)化(主題,軟件,換源,插件擴(kuò)展)

    ubuntu22.04 安裝優(yōu)化(主題,軟件,換源,插件擴(kuò)展)

    1、對(duì)于使用VM安裝,這里就不再多說了 2、對(duì)于用系統(tǒng)安裝,可以在網(wǎng)上招一部分資料 1、這是ubuntu的官方主題網(wǎng)址 2、這里想要說的是,其中的部分結(jié)構(gòu)說明,比如我們準(zhǔn)備安裝主題 Orchis gtk theme ,我們點(diǎn)擊進(jìn)去,如下 2、我們可以不管其他的附帶功能,比如當(dāng)前主題需要的

    2024年02月06日
    瀏覽(29)
  • 解決Ubuntu軟件更新命令:sudo apt-get update的“N: 無法安全地用該源進(jìn)行更新,所以默認(rèn)禁用該源”錯(cuò)誤并安裝gcc

    解決Ubuntu軟件更新命令:sudo apt-get update的“N: 無法安全地用該源進(jìn)行更新,所以默認(rèn)禁用該源”錯(cuò)誤并安裝gcc

    使用快捷鍵:Ctrl+Alt+T打開終端進(jìn)入命令行 使用命令確認(rèn)Ubuntu版本: 鏡像源網(wǎng)址: https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/ 打開之后如圖所示,因?yàn)闆]有找到完全對(duì)應(yīng)的Ubuntu版本號(hào),嘗試選擇了Ubuntu版本:22.10,親測可行 因?yàn)槌跏嫉腢buntu不自帶vim工具,所以這里用vi進(jìn)行編輯文件

    2024年01月19日
    瀏覽(20)
  • 【Ubuntu】apt 更換阿里源

    【Ubuntu】apt 更換阿里源

    ?? 阿里云Ubuntu鏡像 示例如圖:有相關(guān)版本的可以直接參照 ?? 目錄如下: 如圖:其默認(rèn)是只讀的,需要修改一下權(quán)限 ?? 我這里是Ubuntu23.04版本,修改前源配置如下圖: 發(fā)現(xiàn)其默認(rèn)的地址是: http://cn.archive.ubuntu.com/ubuntu 然后我們使用vim的替換命令進(jìn)行修改: (把所有

    2024年02月12日
    瀏覽(18)
  • ubuntu更換國內(nèi)apt源

    備份鏡像 查看自己ubuntu版本 設(shè)置國內(nèi)鏡像源 我ubuntu的版本是18.10,國內(nèi)上沒有維護(hù)對(duì)應(yīng)的鏡像,但是大版本一致即可(所以我采用了bionic) 更新軟件列表,完成換源 修復(fù)損壞的軟件包 更新軟件 ①防火墻相關(guān)

    2024年02月12日
    瀏覽(19)
  • 【Linux基礎(chǔ)】Ubuntu系統(tǒng)換源

    【Linux基礎(chǔ)】Ubuntu系統(tǒng)換源

    ??歡迎各位讀者:點(diǎn)贊 ?? 收藏 ?留言 ?? ??博客主頁:https://blog.csdn.net/qq_59134387?? ??原創(chuàng)不易,轉(zhuǎn)載請(qǐng)標(biāo)明出處;如有錯(cuò)誤,敬請(qǐng)指正批評(píng)!?? ??我不去想是否能夠成功,既然選擇了遠(yuǎn)方,便只顧風(fēng)雨兼程!? ??本文將針對(duì)安裝好的Ubuntu系統(tǒng)進(jìn)行換源操作,將系統(tǒng)

    2024年02月16日
    瀏覽(25)
  • 【記錄】Docker|Ubuntu Docker 修改dockerfile換源、主機(jī)共享網(wǎng)絡(luò)解決apt update 失敗

    本文測試環(huán)境:虛擬機(jī) Ubuntu20.04 Docker20 dockerfile第二行后面加如下內(nèi)容,一鍵換源: 參考:Docker 容器無法聯(lián)網(wǎng) apt update 失敗 解決 如果換了源還是沒網(wǎng)絡(luò),可以嘗試使docker和主機(jī)的網(wǎng)絡(luò)共享。 注意,build和run時(shí)共享網(wǎng)絡(luò)時(shí)添加的參數(shù)是不一致的。并且,如果在build時(shí)添加了參

    2024年02月13日
    瀏覽(20)
  • ubuntu apt 更換阿里云源

    簡介 :Ubuntu系統(tǒng)的APT(Advanced Package Tool)是一個(gè)包管理器,用于在Ubuntu上安裝、卸載和更新軟件包。默認(rèn)情況下,APT會(huì)從Ubuntu官方源中下載軟件包,但由于網(wǎng)絡(luò)原因,有時(shí)候下載速度較慢。阿里云是國內(nèi)較為常用的鏡像源之一,其提供了Ubuntu官方源的鏡像。 歷史攻略: doc

    2024年01月16日
    瀏覽(22)
  • linux使用apt命令下載軟件和依賴包

    apt下載軟件及其依賴包 總共兩步:下載軟件包,下載依賴包 以下以ntp及其依賴包為例 1.cd /var/cache/apt/archives/ 該目錄是依賴包默認(rèn)下載目錄 2.執(zhí)行sudo apt download ntp ,僅下載ntp安裝包 3.執(zhí)行下面命令下載ntp依賴包 sudo apt-get install --reinstall -d `apt-cache depends ntp | grep \\\"依賴\\\" | cut -

    2024年02月07日
    瀏覽(22)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包