[问题]如何备份 apt 的 cache?
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
- neomi
- 帖子: 137
- 注册时间: 2006-08-11 13:03
[问题]如何备份 apt 的 cache?
如题,我的网络速度不是很理想,所以打算备份一下 apt 下来的包
那些 deb 我倒是能找到,可是重装后该怎么用呢?
那些 deb 我倒是能找到,可是重装后该怎么用呢?
- skyx
- 论坛版主
- 帖子: 9202
- 注册时间: 2006-12-23 13:46
- 来自: Azores Islands
- 联系:
Re: [问题]如何备份 apt 的 cache?
neomi 写了:如题,我的网络速度不是很理想,所以打算备份一下 apt 下来的包
那些 deb 我倒是能找到,可是重装后该怎么用呢?
其实在系统正常时,你用ghost或其它软件备份最省事,
在重装新系统前:你可以先备份cache到你的fat32分区
如 sudo cp /var/cache/apt/archives/*.deb /media/hdx/cache/
:
重装后:
cd /media/xxx/ your backup dir
sudo cp *.deb /var/cache/apt/archives/
sudo apt-get update
要保证update没有提示错误 ,如出错,重新 update,如果还是有错误 ,那就换个源。
if update has no errors,then you can do as bellows:
sudo apt-get upgrade 这时你备份的大多数deb文件是用得着的
sudo apt-get dist-upgrade 这时你备份的大多数deb文件是用得着的
sudo apt-get install the software that you want to 这时你备份的大多数deb文件是用得着的,如果提示找不到你要的软件,那手动安装也是个好办法
cp可能会出现的问题,应该是你的cache 太大,我的cache备份有6G,直接用以下命令可能会:
sudo cp *.deb /var/cache/apt/archives/
bash: /usr/bin/sudo: Argument list too long
the reason above is possiblly that your deb bakup dir is too big
so you can try :
sudo cp a*.deb /var/cache/apt/archives/
sudo cp b*.deb /var/cache/apt/archives/
.................
sudo cp z*.deb /var/cache/apt/archives/
一个不用命令行,在图形界面下操作的方法,dapper edgy可用,7.04不可用:
if you use edgy or dapper :
the most convenient way to cp *.deb is as belows:
sudo nautilus
然后在nautilus下你有生杀大权:
then you can copy everything you want to as you like.
but be careful to do this !!!
good luck to u
上次由 skyx 在 2007-01-23 10:21,总共编辑 6 次。
no security measure is worth anything if an attacker has physical access to the machine
- SuperWar3Fan
- 帖子: 1263
- 注册时间: 2006-05-20 6:25
- 来自: 山东淄博
- 联系:
- skyx
- 论坛版主
- 帖子: 9202
- 注册时间: 2006-12-23 13:46
- 来自: Azores Islands
- 联系:
- skyx
- 论坛版主
- 帖子: 9202
- 注册时间: 2006-12-23 13:46
- 来自: Azores Islands
- 联系:
- wyg1258
- 帖子: 654
- 注册时间: 2006-09-12 19:44
- 来自: whu
- skyx
- 论坛版主
- 帖子: 9202
- 注册时间: 2006-12-23 13:46
- 来自: Azores Islands
- 联系:
我不敢这样搞,原因是有可能会执行apt-get clean,如果做了个软链接,不小心clean了,那有可cache 备份能完了,我没试过,理论上在fat32上应该是。yohu 写了:这么麻烦做什么,还复制来复制去的,真是的,浪费自己时间。
我是这么备份的:直接把目录转到其它分区,这样你更新的文件都可以放在其它分区上,重装系统再做个连接就可以了,简单有效,不用老复制来复制去的。代码: 全选
sudo mv /var/cache/apt/archives /media/hda6 sudo ln -s /media/hda6/archives /var/cache/apt/archives
sudo nautilus 后,在gui上复制回来也就是几分钟时间
用cp命令还要快,不过我的cache备份太大了,有6G,现在用ghost,。
no security measure is worth anything if an attacker has physical access to the machine