From: AShen <ashen@nsrz.ru>
To: ALT Linux Community general discussions <community@lists.altlinux.org>
Subject: Re: [Comm] Синхронизация и экономия трафика
Date: Tue, 07 Apr 2009 11:35:32 +0400
Message-ID: <49DB0244.1000504@nsrz.ru> (raw)
In-Reply-To: <49DAF8BC.2030000@rambler.ru>
alisher пишет:
> Здравствуйте. Получил я локальную копию пятого бранча, спасибо
> Назарову Денису. И хочу теперь синхронизировать, но не целиком, потому
> как трафик ограниченный и инет только на работе, а обновлять домашний.
> Так вот, можно ли получить от apt список rpm, которые установлены на
> моем компьютере? А потом уже только эти пакеты обновлять.
1) создать свой локальный репозитарий. как сделать сказано здесь:
http://freesource.info/wiki/DmitriyKruglikov/Repository?v=f2g&search=repo
2) а вот для того, что б подтянуть из инета пакеты, которые установленны
в системе, но отсуствуют в кэше apt'а, я мспользую такой скрипт:
cat autodownloadcache
#!/bin/sh
#Очищаем кэш от устаревших файлов пакетов
#apt-get autoclean
#обновляем БД по пакетам
#apt-get update
#получаем список установленных в систему пакетов
rm -f /tmp/installrpm
rpm -qa --qf='%{NAME}\n' | sort > /tmp/installrpm
#получаем список имеющих в кэше файлов пакетов в виде "только имена пакетов"
rm -f /tmp/presentfiles
cd /var/cache/apt/archives
ls * | sort > /tmp/presentfiles
rm -f /tmp/presentrpm
cat /tmp/presentfiles | while read FILEPKG; do
rpm -qp $FILEPKG --queryformat "%{NAME}\n" >> /tmp/presentrpm
done
comm -23 /tmp/installrpm /tmp/presentrpm > /tmp/dwrpm
#докачиваем отсутствующие в кэше файлы установленных пакетов
cat /tmp/dwrpm | while read PKG; do
apt-get reinstall -d -y $PKG
done
#EOF
Да скрипт отрабатывает достаточно долго. Из-за вызова apt'а для каждого
пакета отдельно. Если нашему apt'у передать на вход зараз весь список
пакетов, то ему сносит голову: слишком длинная строка входных параметров
(примерно так, в вольном изложеии). Вот по сему надёжней передавать
apt'у отдельно имя каждого пакета. Обчыно данный скрипт я запускаю на
ночь, а придя утром, получаю в кэше apt'а наличие всех файлов
установленных у меня пакетов. Ну а дальше 1).
next prev parent reply other threads:[~2009-04-07 7:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-07 6:54 alisher
2009-04-07 7:35 ` AShen [this message]
2009-04-07 8:35 ` Dmitriy M. Maslennikov
2009-04-07 9:57 ` Michael Shigorin
2009-04-07 13:07 ` AShen
2009-04-07 13:14 ` Michael Shigorin
2009-04-07 14:27 ` Ivan Fedorov
2009-04-07 10:26 ` alisher
2009-04-07 10:42 ` Dmitriy Kruglikov
2009-04-07 11:23 ` alisher
2009-04-07 11:49 ` Dmitriy Kruglikov
2009-04-07 12:48 ` AShen
2009-04-08 14:10 ` Timur Batyrshin
2009-04-08 14:14 ` AShen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49DB0244.1000504@nsrz.ru \
--to=ashen@nsrz.ru \
--cc=community@lists.altlinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git