ubuntu 12.04 apt換源


2022-03 實測可用

前言
本文主要介紹如何為已經不再支持的Ubuntu 12.04LTS 更換源,網上查到的源(很多是13-14年的帖子)都無法直接使用了,例如下面這個

deb http://archive.ubuntu.com/ubuntu precise main universe restricted multiverse
deb http://archive.ubuntu.com/ubuntu precise-security universe main multiverse restricted
deb http://archive.ubuntu.com/ubuntu precise-updates universe main multiverse restricted
deb http://archive.ubuntu.com/ubuntu precise-proposed universe main multiverse restricted

最后google到一個github帖子解決了這個問題,由於12.04不受支持了,12.04相關的這些包的資源被移到了old-releases.ubuntu.com域名下,而不是security.ubuntu.com和 archive.ubuntu.com了,因此需要修改源。使用如下命令修改源:

sudo sed -i.bak -r 's/(archive|security).ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list

修改后的源:

deb http://old-releases.ubuntu.com/ubuntu precise main universe restricted multiverse
deb http://old-releases.ubuntu.com/ubuntu precise-security universe main multiverse restricted
deb http://old-releases.ubuntu.com/ubuntu precise-updates universe main multiverse restricted
deb http://old-releases.ubuntu.com/ubuntu precise-proposed universe main multiverse restricted

參考:

https://blog.csdn.net/gibbs_/article/details/119212041

https://gist.github.com/dergachev/f5da514802fcbbb441a1

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM