超簡單!教你如何修改源列表(sources.list)來提高軟件訪問速度


 

因為Ubuntu官方的源地址不在國內,所以在國內的訪問速度非常慢,比如:我們要下載或是更新軟件那速度比蝸牛還慢。所以,我們需要改成國內的鏡像服務器,這樣,我們在下載或更新軟件的時候就會很快了。

配置步驟如下:

1.網絡的配置

2.選擇合適的的鏡像源(本篇文章所講的)

3.永久更改ulimit和修改MySQL的存儲路徑datadir

比如,可以使用阿里雲的鏡像:

復制代碼
​deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
復制代碼

 

除了阿里雲的鏡像,國內還有清華大學鏡像、中科大鏡像等等,大家可以根據自己的網絡連接情況選擇合適自己的鏡像源。

隨着 Ubuntu 16.04 LTS 的發布,Ubuntu 的軟件包管理命令也發生了變化,新系統采用了 Debian 項目中所使用的 APT(Advanced Package Tool)來完成各種的不同的任務,APT 命令全面取代了我們之前在 Linux 軟件包管理基本操作入門中所介紹的 apt-get、apt-cache 等功能。

Ubuntu 16.04 LTS       老版本Ubuntu
apt install 包名             替代 apt-get install 包名
apt remove 包名             替代 apt-get remove 包名
apt search 包名              替代 apt-cache search 包名
apt show 包名              替代 apt-cache show 包名
apt update              替代 apt-get update
apt upgrade              替代 apt-get upgrade
apt list –installed              替代 dpkg –get-selections | grep -v deinstall      替代 dpkg -l
apt list –upgradable              apt-get -u upgrade –assume-no
apt edit-sources              替代 echo ‘new line of text’ | sudo tee -a /etc/apt/sources.list
apt autoremove              替代 sudo nano /etc/apt/sources.list
apt purge 包名             替代 apt-get autoremove

上面是新的apt和舊的apt-get、apt-cache的對比,大家可以看下有什么不同之處。

 

 

文章首發於我的技術博客猿人學Python基礎教程


免責聲明!

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



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