通过仅获取必要的语言文件来缩短apt-get操作时间
Debian / Ubuntu 已经被翻译成许多语言。
尽管这是一个优点,但如果不进行任何设置,会导致获取所有翻译信息的更新时间变长,这是一个缺点。
将设置为仅获取自己使用的物品,可以缩短时间。
1. 删除已经获取的翻译信息。
如果您从未执行过 apt-get update 或 aptitude update,您可以跳过此操作。
如果您已经执行过 apt-get update 或 aptitude update,由于您已经获取了国际化(翻译等)的信息,因此首先我们将删除它们。
如果有国际化信息存在,即使更改了apt的设置,也会尝试获取更新信息。
cd /var/lib/apt/list
sudo rm -f *Translation*
2. 选择要使用的语言设置
打开编辑器,打开/ etc /apt /apt.conf文件(如果文件不存在则创建)并添加以下行:“这是要使用的语言!”
编辑和保存需要具备 root 权限。
APT::Acquire::Language "ja_JP";
APT::Acquire::Language "en";
APT::Acquire::Translation "ja_JP";
3. 更新软件包数据库 (Gengxin ruanjianbao shujuku)
这是个约定,对吧。
apt-get update
或
aptitude update
请运行并更新软件包数据库。
不再获取指定语言以外的国际化信息。
4. 真实的情况会如何变化?
在进行设置之前,执行了 aptitude update,结果如下。
$ sudo aptitude update
取得: 1 http://ftp.jp.debian.org wheezy InRelease [207 kB]
取得: 2 http://ftp.jp.debian.org wheezy/main Sources/DiffIndex [7,876 B]
Hit http://ftp.jp.debian.org wheezy/contrib Sources/DiffIndex
取得: 3 http://ftp.jp.debian.org wheezy/main amd64 Packages/DiffIndex [7,876 B]
Hit http://ftp.jp.debian.org wheezy/contrib amd64 Packages/DiffIndex
Hit http://ftp.jp.debian.org wheezy/contrib Translation-en/DiffIndex
取得: 4 http://ftp.jp.debian.org wheezy/main Translation-ja/DiffIndex [7,819 B]
取得: 5 http://ftp.jp.debian.org wheezy/main Translation-en/DiffIndex [7,876 B]
Hit http://ftp.jp.debian.org wheezy/main Translation-fi/DiffIndex
取得: 6 http://ftp.jp.debian.org wheezy/main Translation-pl/DiffIndex [7,819 B]
Hit http://ftp.jp.debian.org wheezy/main Translation-sv/DiffIndex
Hit http://ftp.jp.debian.org wheezy/main Translation-sk/DiffIndex
Hit http://ftp.jp.debian.org wheezy/main Translation-hr/DiffIndex
Hit http://ftp.jp.debian.org wheezy/main Translation-ru/DiffIndex
Hit http://ftp.jp.debian.org wheezy/main Translation-vi/DiffIndex
Hit http://ftp.jp.debian.org wheezy/main Translation-eu/DiffIndex
Hit http://ftp.jp.debian.org wheezy/main Translation-sr/DiffIndex
取得: 7 http://ftp.jp.debian.org wheezy/main Translation-fr/DiffIndex [7,819 B]
取得: 8 http://ftp.jp.debian.org wheezy/main Translation-da/DiffIndex [7,819 B]
取得: 9 http://ftp.jp.debian.org wheezy/main Translation-cs/DiffIndex [7,819 B]
取得: 10 http://ftp.jp.debian.org wheezy/main Translation-ro [1,455 B]
Hit http://ftp.jp.debian.org wheezy/main Translation-eo/DiffIndex
Hit http://ftp.jp.debian.org wheezy/main Translation-hu/DiffIndex
取得: 11 http://ftp.jp.debian.org wheezy/main Translation-nb [1,302 B]
取得: 12 http://ftp.jp.debian.org wheezy/main Translation-uk/DiffIndex [7,819 B]
Hit http://ftp.jp.debian.org wheezy/main Translation-km/DiffIndex
Hit http://ftp.jp.debian.org wheezy/main Translation-ko/DiffIndex
Hit http://ftp.jp.debian.org wheezy/main Translation-id/DiffIndex
Hit http://ftp.jp.debian.org wheezy/main Translation-es/DiffIndex
Hit http://ftp.jp.debian.org wheezy/main Translation-zh/DiffIndex
取得: 13 http://ftp.jp.debian.org wheezy/main Translation-it/DiffIndex [7,876 B]
Hit http://ftp.jp.debian.org wheezy/main Translation-ca/DiffIndex
Hit http://ftp.jp.debian.org wheezy/main Translation-pt/DiffIndex
Hit http://ftp.jp.debian.org wheezy/main Translation-nl/DiffIndex
取得: 14 http://ftp.jp.debian.org wheezy/main Translation-de/DiffIndex [7,819 B]
取得: 15 http://ftp.jp.debian.org wheezy/main 2012-09-06-0212.33.pdiff [5,423 B]
取得: 16 http://ftp.jp.debian.org wheezy/main amd64 2012-09-06-0212.33.pdiff [10.7 kB]
取得: 17 http://ftp.jp.debian.org wheezy/main 2012-09-06-1412.31.pdiff [427 B]
取得: 18 http://ftp.jp.debian.org wheezy/main 2012-09-06-0212.33.pdiff [5,423 B]
取得: 19 http://ftp.jp.debian.org wheezy/main 2012-09-06-0212.33.pdiff [937 B]
取得: 20 http://ftp.jp.debian.org wheezy/main 2012-09-06-1412.31.pdiff [737 B]
取得: 21 http://ftp.jp.debian.org wheezy/main 2012-09-06-1412.31.pdiff [909 B]
取得: 22 http://ftp.jp.debian.org wheezy/main 2012-09-06-1412.31.pdiff [6,029 B]
取得: 23 http://ftp.jp.debian.org wheezy/main 2012-09-06-1412.31.pdiff [33 B]
取得: 24 http://ftp.jp.debian.org wheezy/main 2012-09-06-1412.31.pdiff [1,419 B]
取得: 25 http://ftp.jp.debian.org wheezy/main 2012-09-06-1412.31.pdiff [1,747 B]
取得: 26 http://ftp.jp.debian.org wheezy/main 2012-09-06-1412.31.pdiff [1,581 B]
取得: 27 http://ftp.jp.debian.org wheezy/main amd64 2012-09-06-0212.33.pdiff [10.7 kB]
取得: 28 http://ftp.jp.debian.org wheezy/main 2012-09-06-1412.31.pdiff [427 B]
取得: 29 http://ftp.jp.debian.org wheezy/main 2012-09-06-0212.33.pdiff [937 B]
取得: 30 http://ftp.jp.debian.org wheezy/main 2012-09-06-1412.31.pdiff [737 B]
取得: 31 http://ftp.jp.debian.org wheezy/main 2012-09-06-1412.31.pdiff [909 B]
取得: 32 http://ftp.jp.debian.org wheezy/main 2012-09-06-1412.31.pdiff [6,029 B]
取得: 33 http://ftp.jp.debian.org wheezy/main 2012-09-06-1412.31.pdiff [33 B]
取得: 34 http://ftp.jp.debian.org wheezy/main 2012-09-06-1412.31.pdiff [1,419 B]
取得: 35 http://ftp.jp.debian.org wheezy/main 2012-09-06-1412.31.pdiff [1,747 B]
取得: 36 http://security.debian.org wheezy/updates InRelease [87.8 kB]
取得: 37 http://ftp.jp.debian.org wheezy/main 2012-09-06-1412.31.pdiff [1,581 B]
取得: 38 http://security.debian.org wheezy/updates/main Sources [937 B] 取得: 39 http://security.debian.org wheezy/updates/contrib Sources [14 B] 取得: 40 http://security.debian.org wheezy/updates/main amd64 Packages [979 B] 取得: 41 http://security.debian.org wheezy/updates/contrib amd64 Packages [14 B] Ign http://security.debian.org wheezy/updates/contrib Translation-ja_JP Ign http://security.debian.org wheezy/updates/contrib Translation-ja
Ign http://security.debian.org wheezy/updates/contrib Translation-en
Ign http://security.debian.org wheezy/updates/contrib Translation-fi
Ign http://security.debian.org wheezy/updates/contrib Translation-pl
Ign http://security.debian.org wheezy/updates/contrib Translation-sv
Ign http://security.debian.org wheezy/updates/contrib Translation-sk
Ign http://security.debian.org wheezy/updates/contrib Translation-hr
Ign http://security.debian.org wheezy/updates/contrib Translation-ru
Ign http://security.debian.org wheezy/updates/contrib Translation-vi
Ign http://security.debian.org wheezy/updates/contrib Translation-eu
Ign http://security.debian.org wheezy/updates/contrib Translation-sr
Ign http://security.debian.org wheezy/updates/contrib Translation-fr
Ign http://security.debian.org wheezy/updates/contrib Translation-da
Ign http://security.debian.org wheezy/updates/contrib Translation-cs
Ign http://security.debian.org wheezy/updates/contrib Translation-ro
Ign http://security.debian.org wheezy/updates/contrib Translation-eo
Ign http://security.debian.org wheezy/updates/contrib Translation-hu
Ign http://security.debian.org wheezy/updates/contrib Translation-nb
Ign http://security.debian.org wheezy/updates/contrib Translation-uk
Ign http://security.debian.org wheezy/updates/contrib Translation-km
Ign http://security.debian.org wheezy/updates/contrib Translation-ko
Ign http://security.debian.org wheezy/updates/contrib Translation-id
Ign http://security.debian.org wheezy/updates/contrib Translation-es
Ign http://security.debian.org wheezy/updates/contrib Translation-zh
Ign http://security.debian.org wheezy/updates/contrib Translation-it
Ign http://security.debian.org wheezy/updates/contrib Translation-ca
Ign http://security.debian.org wheezy/updates/contrib Translation-pt
Ign http://security.debian.org wheezy/updates/contrib Translation-nl
Ign http://security.debian.org wheezy/updates/contrib Translation-de
Ign http://security.debian.org wheezy/updates/main Translation-ja_JP
Ign http://security.debian.org wheezy/updates/main Translation-ja
Ign http://security.debian.org wheezy/updates/main Translation-en
Ign http://security.debian.org wheezy/updates/main Translation-fi
Ign http://security.debian.org wheezy/updates/main Translation-pl
Ign http://security.debian.org wheezy/updates/main Translation-sv
Ign http://security.debian.org wheezy/updates/main Translation-sk
Ign http://security.debian.org wheezy/updates/main Translation-hr
Ign http://security.debian.org wheezy/updates/main Translation-ru
Ign http://security.debian.org wheezy/updates/main Translation-vi
Ign http://security.debian.org wheezy/updates/main Translation-eu
Ign http://security.debian.org wheezy/updates/main Translation-sr
Ign http://security.debian.org wheezy/updates/main Translation-fr
Ign http://security.debian.org wheezy/updates/main Translation-da
Ign http://security.debian.org wheezy/updates/main Translation-cs
Ign http://security.debian.org wheezy/updates/main Translation-ro
Ign http://security.debian.org wheezy/updates/main Translation-eo
Ign http://security.debian.org wheezy/updates/main Translation-hu
Ign http://security.debian.org wheezy/updates/main Translation-nb
Ign http://security.debian.org wheezy/updates/main Translation-uk
Ign http://security.debian.org wheezy/updates/main Translation-km
Ign http://security.debian.org wheezy/updates/main Translation-ko
Ign http://security.debian.org wheezy/updates/main Translation-id
Ign http://security.debian.org wheezy/updates/main Translation-es
Ign http://security.debian.org wheezy/updates/main Translation-zh
Ign http://security.debian.org wheezy/updates/main Translation-it
Ign http://security.debian.org wheezy/updates/main Translation-ca
Ign http://security.debian.org wheezy/updates/main Translation-pt
Ign http://security.debian.org wheezy/updates/main Translation-nl
Ign http://security.debian.org wheezy/updates/main Translation-de
Fetched 416 kB in 1分 15秒 (5,538 B/s)
设置完成后就是这样的。
$ sudo aptitude update
Hit http://ftp.jp.debian.org wheezy InRelease
Hit http://ftp.jp.debian.org wheezy/main Sources/DiffIndex
Hit http://ftp.jp.debian.org wheezy/contrib Sources/DiffIndex
Hit http://ftp.jp.debian.org wheezy/main amd64 Packages/DiffIndex
Hit http://ftp.jp.debian.org wheezy/contrib amd64 Packages/DiffIndex
取得: 1 http://ftp.jp.debian.org wheezy/contrib Translation-en/DiffIndex [5,197 B]
取得: 2 http://ftp.jp.debian.org wheezy/main Translation-en/DiffIndex [7,876 B]
Hit http://security.debian.org wheezy/updates InRelease
Hit http://security.debian.org wheezy/updates/main Sources
Hit http://security.debian.org wheezy/updates/contrib Sources
Hit http://security.debian.org wheezy/updates/main amd64 Packages
Hit http://security.debian.org wheezy/updates/contrib amd64 Packages
Ign http://security.debian.org wheezy/updates/contrib Translation-ja_JP Ign http://security.debian.org wheezy/updates/contrib Translation-en Ign http://security.debian.org wheezy/updates/main Translation-ja_JP Ign http://security.debian.org wheezy/updates/main Translation-en Fetched 13.1 kB in 7秒 (1,642 B/s)
清爽 >ω<ノ