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

ubuntu設(shè)定apt-get源

這篇具有很好參考價值的文章主要介紹了ubuntu設(shè)定apt-get源。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報違法"按鈕提交疑問。

一、更新為本地源

備份
備份/etc/apt/sources.list
cp /etc/apt/sources.list /etc/apt/sources.list.bak


在/etc/apt/sources.list文件前面添加如下條目
#添加阿里源 deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

最后執(zhí)行如下命令更新源
##更新
sudo apt-get update
sudo apt-get upgrade

二、sudo apt-get update報錯

Get:1 http://mirrors.aliyun.com/ubuntu bionic InRelease [242 kB] Get:2 http://mirrors.aliyun.com/ubuntu bionic-security InRelease [88.7 kB] Get:3 http://mirrors.aliyun.com/ubuntu bionic-updates InRelease [88.7 kB] Err:1 http://mirrors.aliyun.com/ubuntu bionic InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32 Get:4 http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease [242 kB] Get:5 http://mirrors.aliyun.com/ubuntu bionic-backports InRelease [83.3 kB] Err:2 http://mirrors.aliyun.com/ubuntu bionic-security InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32 Err:3 http://mirrors.aliyun.com/ubuntu bionic-updates InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32 Err:4 http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32 Err:5 http://mirrors.aliyun.com/ubuntu bionic-backports InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32 Reading package lists... Done W: GPG error: http://mirrors.aliyun.com/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32 E: The repository 'http://mirrors.aliyun.com/ubuntu bionic InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. W: GPG error: http://mirrors.aliyun.com/ubuntu bionic-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32 E: The repository 'http://mirrors.aliyun.com/ubuntu bionic-security InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. W: GPG error: http://mirrors.aliyun.com/ubuntu bionic-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32 E: The repository 'http://mirrors.aliyun.com/ubuntu bionic-updates InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. W: GPG error: http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32 E: The repository 'http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. W: GPG error: http://mirrors.aliyun.com/ubuntu bionic-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32 E: The repository 'http://mirrors.aliyun.com/ubuntu bionic-backports InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.
分析:
更換源之后需要添加公鑰,執(zhí)行以下命令:
注意:這里的recv-keys就是報錯中的key,粘貼過來即可
W: GPG error: http://mirrors.aliyun.com/ubuntu bionic-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
即執(zhí)行如下操作:
gpg --keyserver keyserver.ubuntu.com --recv-keys 公鑰
gpg --export --armor 公鑰 | sudo apt-key add -
針對本文問題,則執(zhí)行:
gpg --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
gpg --export --armor 3B4FE6ACC0B21F32 | sudo apt-key add -

三、更新

升級 & 安裝
apt-get update // 更新源文件,并不會做任何安裝升級操作
apt-get upgrade // 升級所有已安裝的包
apt-get install packagename // 安裝指定的包
apt-get install packagename --only-upgrade // 僅升級指定的包
apt-get install packagename --reinstall // 重新安裝包
apt-get -f install // 修復(fù)安裝
apt-get build-dep packagename // 安裝相關(guān)的編譯環(huán)境
apt-get source packagename // 下載該包的源代碼
apt-get dist-upgrade // 升級系統(tǒng)
apt-get dselect-upgrade // 使用 dselect 升級
查詢 & 顯示
apt-cache search packagename // 查詢指定的包   
apt-cache show packagename // 顯示包的相關(guān)信息,如說明、大小、版本等
apt-cache depends packagename // 了解使用該包依賴哪些包
apt-cache rdepends packagename // 查看該包被哪些包依賴
刪除
apt-get remove packagename // 刪除包   
apt-get remove packagename -- purge // 刪除包,包括刪除配置文件等
apt-get autoremove packagename --purge // 刪除包及其依賴的軟件包+配置文件等(只對6.10有效,推薦使用)
清理和檢查
apt-get clean // 清理無用的包
apt-get autoclean // 清理無用的包
apt-get check // 檢查是否有損壞的依賴

三、安裝g++問題

`fresher@DESKTOP-EIF33SC:~$ sudo apt install g++
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
libc6-dev : Depends: libc6 (= 2.27-3ubuntu1.6) but 2.35-0ubuntu3.1 is to be installed
Depends: libc-dev-bin (= 2.27-3ubuntu1.6) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.`
以上問題,經(jīng)調(diào)查,是因為/etc/apt/sources.list中設(shè)定的源和Ubuntu的版本不對應(yīng)導(dǎo)致的。解決辦法如下:
ubuntu的版本源是有規(guī)律的。要查版本號可以通過lsb_release -a查看自己系統(tǒng)上的版本號。
ubuntu設(shè)定apt-get源
然后可判斷出上面的阿里源配置的是Ubuntu 18.04。而Ubuntu 22.04的代號是jammy。將/etc/apt/sources.list文件中的“bionic”替換成“jammy”即可。文章來源地址http://www.zghlxwxcb.cn/news/detail-491204.html

到了這里,關(guān)于ubuntu設(shè)定apt-get源的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

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

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

相關(guān)文章

  • Ubuntu軟件包管理:apt-get remove 與 apt-get purge的區(qū)別與注意事項

    本文解釋了在Ubuntu中使用apt-get remove和apt-get purge命令卸載軟件包的區(qū)別,以及使用purge命令時的注意事項,以避免配置文件殘留導(dǎo)致重新安裝失敗的問題。

    2023年04月25日
    瀏覽(26)
  • Ubuntu中,snap、apt和apt-get的區(qū)別

    Ubuntu中,snap、apt和apt-get的區(qū)別

    實際上,apt和apt-get沒有什么區(qū)別,只是apt比apt-get更高級一點(diǎn) apt支持進(jìn)度條顯示 apt支持顏色輸出,但是apt-get的顏色就極為單調(diào) apt加入了apt update指令,它會自動更新apt中的軟件包的版本 apt支持自動清理已卸載的軟件包 apt支持列出軟件包的詳細(xì)信息 所以, 不管從哪方面說,

    2024年02月12日
    瀏覽(18)
  • PVE使用apt-get update更新出現(xiàn)401的解決辦法

    PVE安裝完畢后,會自動添加一個企業(yè)存儲庫的訂閱,但如果您是免費(fèi)用戶,在使用 apt-get update 更新軟件的時候會出現(xiàn)401錯誤,錯誤內(nèi)容如下: 解決辦法 備份原有的存儲庫: 然后修改 /etc/apt/sources.list 在末尾添加免費(fèi)的存儲庫: 最后再更新即可: apt-get update 此文部分內(nèi)容參

    2024年02月13日
    瀏覽(53)
  • 【問題整理】Ubuntu 執(zhí)行 apt-get install xxx 報錯

    一、問題描述: 執(zhí)行apt-get install fcitx時,報如下錯誤 二、解決方法: 嘗試修復(fù)依賴問題: 這個命令會嘗試修復(fù)系統(tǒng)中的依賴問題,這可能會解決安裝過程中的錯誤。 清理殘留文件: 這些命令將重新配置未完成的安裝,并清理不再需要的文件。 重新配置 GRUB: 如果您正在安裝

    2024年02月13日
    瀏覽(26)
  • Ubuntu之a(chǎn)pt-get系列--安裝JDK8--方法/教程

    Ubuntu之a(chǎn)pt-get系列--安裝JDK8--方法/教程

    原文網(wǎng)址:Ubuntu之a(chǎn)pt-get--安裝JDK8--方法/教程_IT利刃出鞘的博客 本文介紹如何在Ubuntu下安裝JDK8。 可以通過如下命令判斷系統(tǒng)是否已安裝jdk: 命令 結(jié)果 如上所示,表示還沒有安裝。 結(jié)果: 本處我安裝openjdk-8-jdk 可以通過apt安裝,命令如下: 命令 結(jié)果 如上則表示安裝成功,

    2024年02月10日
    瀏覽(50)
  • RabbitMQ | 在ubuntu中使用apt-get安裝高版本RabbitMQ

    目錄 一、官方腳本 二、徹底卸載 三、重新安裝 1.安裝高版本Erlang 2.安裝RabbitMQ 直接使用apt安裝的rabbitmq版本較低,甚至可能無法使用死信隊列等插件。首先提供一個 官方 的安裝腳本: 但是這個辦法對我這里的情況不奏效。解決方法往下看。 1.安裝高版本Erlang 下載 Erlang S

    2024年02月10日
    瀏覽(23)
  • ubuntu下獲取apt-get離線安裝包的通用方法

    背景 ubuntu下,使用apt-get在線安裝某些模塊十分的簡單,與之相對,想要離線安裝某一些功能包往往會產(chǎn)生很多問題,包括并不限于依賴等,同時也有安裝包獲取困難,版本不對等問題,這里提供一個通用解決方案。 1,準(zhǔn)備 準(zhǔn)備一臺與想要離線安裝的系統(tǒng)完全相同的可聯(lián)網(wǎng)

    2024年02月16日
    瀏覽(26)
  • Ubuntu離線安裝Openssh,完美解決沒有網(wǎng)絡(luò)無法直接apt-get

    Ubuntu離線安裝Openssh,完美解決沒有網(wǎng)絡(luò)無法直接apt-get

    ? ? ? ?缺省情況下,我們在部署好ubuntu后,ubuntu是不允許我們直接SSH的,需要我們?nèi)ハ螺d,但是在機(jī)房這樣的內(nèi)網(wǎng)環(huán)境下,就顯得格外困難,因為無法直接apt-get。所有我們可以通關(guān)上傳openssh軟件包進(jìn)行安裝,來解決這個問題! ? openssh-client??SSH客戶端 openssh-server? SSH遠(yuǎn)程

    2024年02月09日
    瀏覽(24)
  • sudo apt-get update時遇到 無法安全地用該源進(jìn)行更新,所以默認(rèn)禁用該源

    sudo apt-get update時遇到 無法安全地用該源進(jìn)行更新,所以默認(rèn)禁用該源

    重新安裝ca-certificates 安裝地址 http://ports.ubuntu.com/pool/main/c/ca-certificates/ 選最新更新的 我是ubuntu 18.04,其他版本對應(yīng)選擇 或者用命令行 將文件下載到本地后使用以下命令 至此問題解決

    2024年02月13日
    瀏覽(21)
  • 解決Ubuntu 或Debian apt-get IPv6問題:如何設(shè)置僅使用IPv4

    解決Ubuntu 或Debian apt-get IPv6問題:如何設(shè)置僅使用IPv4

    解決Ubuntu 或Debian apt-get IPv6問題:如何設(shè)置僅使用IPv4 背景 : 在Ubuntu 22.04(包括 20.04 18.04 等版本) 或 Debian (10、11、12)系統(tǒng)中,當(dāng)你使用 apt update 或 apt install 命令時,系統(tǒng)默認(rèn)會優(yōu)先使用IPv6網(wǎng)絡(luò)。但有些時候,盡管系統(tǒng)開啟了IPv6,但實際上IPv6網(wǎng)絡(luò)并不可用,這就導(dǎo)致了apt命令

    2024年02月10日
    瀏覽(30)

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

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

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

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包