修改Debian Wheezy 7.0 7.1的apt缓存路径
2015-11-04 08:02
337 查看
由于Fedora 18 x64的稳定性越发的不满足所需,权衡了一下软件的新旧程度和系统的稳定性,开始投奔Debian Wheezy 7.0/7.1。
投奔了Debian,就需要使用apt,就需要配置apt。
想配置apt-get的缓存路径,上网一顿搜索,找到的都不好用,而且还有很多重复的文章,可能是由于网上的配置是旧版Debian的。
于是开始查看官方的文档,猛敲如下命令:
man apt.conf
在文档发现了这么一句:
In general the sample configuration file in /usr/share/doc/apt/examples/apt.conf /usr/share/doc/apt/examples/configure-index.gz is a good guide for how it should look.
然后在/usr/share/doc/apt/examples/configure-index.gz中找到了如下内容:
...
// Directory layout
Dir "/"
{
...
// Location of the cache dir
Cache "var/cache/apt/" {
Archives "archives/";
// backup directory created by /etc/cron.daily/apt
...
这回知道怎么办了,编辑/etc/apt/apt.conf,没有则新建,敲入如下命令:
vim /etc/apt/apt.conf
添加如下内容并保存(your/own/apt/cache/directory/为新的缓存路径,注意前后是否应该有斜线):
Dir "/"
{
// Location of the cache dir
Cache "your/own/apt/cache/directory/" {
Archives "archives/";
// backup directory created by /etc/cron.daily/apt
Backup "backup/";
srcpkgcache "srcpkgcache.bin";
pkgcache "pkgcache.bin";
};
};
同时,注意到了“// backup directory created by /etc/cron.daily/apt”这句注释,
打开/etc/cron.daily/apt看看,发现其中含有var/cache/apt这个apt-get的默认缓存路径,
于是编辑/etc/cron.daily/apt,敲入如下命令:
vim /etc/cron.daily/apt
替换“var/cache/apt”为“your/own/apt/cache/directory”,使用如下vim替换命令:
:1,$s/var\/cache\/apt/your\/own\/apt\/cache\/directory/g
至此,搞定!
投奔了Debian,就需要使用apt,就需要配置apt。
想配置apt-get的缓存路径,上网一顿搜索,找到的都不好用,而且还有很多重复的文章,可能是由于网上的配置是旧版Debian的。
于是开始查看官方的文档,猛敲如下命令:
man apt.conf
在文档发现了这么一句:
In general the sample configuration file in /usr/share/doc/apt/examples/apt.conf /usr/share/doc/apt/examples/configure-index.gz is a good guide for how it should look.
然后在/usr/share/doc/apt/examples/configure-index.gz中找到了如下内容:
...
// Directory layout
Dir "/"
{
...
// Location of the cache dir
Cache "var/cache/apt/" {
Archives "archives/";
// backup directory created by /etc/cron.daily/apt
...
这回知道怎么办了,编辑/etc/apt/apt.conf,没有则新建,敲入如下命令:
vim /etc/apt/apt.conf
添加如下内容并保存(your/own/apt/cache/directory/为新的缓存路径,注意前后是否应该有斜线):
Dir "/"
{
// Location of the cache dir
Cache "your/own/apt/cache/directory/" {
Archives "archives/";
// backup directory created by /etc/cron.daily/apt
Backup "backup/";
srcpkgcache "srcpkgcache.bin";
pkgcache "pkgcache.bin";
};
};
同时,注意到了“// backup directory created by /etc/cron.daily/apt”这句注释,
打开/etc/cron.daily/apt看看,发现其中含有var/cache/apt这个apt-get的默认缓存路径,
于是编辑/etc/cron.daily/apt,敲入如下命令:
vim /etc/cron.daily/apt
替换“var/cache/apt”为“your/own/apt/cache/directory”,使用如下vim替换命令:
:1,$s/var\/cache\/apt/your\/own\/apt\/cache\/directory/g
至此,搞定!
相关文章推荐
- Gnome 3 有时无响应的临时解决办法
- [摘录]gnome-shell 无响应时一般需要做什么
- 在64-bit debian wheezy上运行32-bit程序真正需要做什么
- debian wheezy升级内核后无法启动的一种情况
- OK6410开发板tftp启动内核出现错误:do not support this address XXXXXXXX
- pthread高优先级线程的优先效果试验
- linux下使用软件方式调节屏幕亮度
- 解决使用iso作为apt源时的WARNING_The_following_packages_cannot_be_authenticated
- debian wheezy在登陆gnome后关闭键盘背光
- 关于Ctrl+R(reverse-search-history)的反向搜索 —— forward-search-history的快捷键
- 将博客搬至CSDN
- KVC 与 KVO 理解
- MUMPS在CentOS下的安装
- 用oc去解决简单的汽车租借问题
- 一个投顾团队的股灾记忆
- Optimal Programs
- String.Format 方法
- 量化目标
- 久久管家的创业故事
- React Native 添加自定义UI组件