[Yum-devel] Is "yum clean all" problem or repository issue?Newpackages could not show after "yum clean all"
jigang.djg
jigang.djg at taobao.com
Mon Jul 16 06:48:55 UTC 2012
From the yum manual:
CLEAN OPTIONS
The following are the ways which you can invoke yum in clean mode. Note that "all files" in the com-
mands below means "all files in currently enabled repositories". If you want to also clean any (tem-
porarily) disabled repositories you need to use --enablerepo=’*’ option.
yum clean expire-cache
Eliminate the local data saying when the metadata and mirrorlists were downloaded for each
repo. This means yum will revalidate the cache for each repo. next time it is used. However if
the cache is still valid, nothing significant was deleted.
yum clean packages
Eliminate any cached packages from the system. Note that packages are not automatically
deleted after they are downloaded.
yum clean headers
Eliminate all of the header files which yum uses for dependency resolution.
yum clean metadata
Eliminate all of the files which yum uses to determine the remote availability of packages.
Using this option will force yum to download all the metadata the next time it is run.
yum clean dbcache
Eliminate the sqlite cache used for faster access to metadata. Using this option will force
yum to recreate the cache the next time it is run.
yum clean all
Runs yum clean packages and yum clean headers, yum clean metadata and yum clean dbcache as
above.
For question 1, the answer is "no", i think.
For your questions (2) and (3), the 'yum clean all' command only clean local cached data. For example, on my computer:
ls /etc/yum.repos.d/
rhel-debuginfo.repo rhel.repo
cat /etc/yum.repos.d/rhel.repo
[rhel.5.i386]
name=rhel.5.i386
baseurl=http://yum.mysite.test.com/rhel/$releasever/i386
gpgcheck=0
then for the test, edit file /etc/yum.repos.d/rhel.repo
changing baseurl to an error addres, such as "nobody_know_this_host.com"
"baseurl=http://nobody_know_this_host.com/rhel/$releasever/i386"
as you know, it is an invalid url, firstly, let's have a look at that what are stored in the defaut cache:
tree /var/cache/yum/
/var/cache/yum/
`-- rhel.5.i386
|-- cachecookie
|-- packages
|-- primary.sqlite
`-- repomd.xml
we can see all the cache files on local machine. then run command "yum clean all", and "tree /var/cache/yum/" once again:
tree /var/cache/yum/
/var/cache/yum/
`-- rhel.5.i386
`-- packages
it is shown that the cached files on local machine were removed when running 'yum clean all', and no retires for remote yum server exists.
It is all the process of test for 'yun clean all'
Defaultly, 'yum clean all' only clean repos which are set up (in the .repo finle, enabled=1), to clean all repositiyes, you may try command:
yum clean all --enablerepo=*
Back to your problem again, it seems that the problem is caused by the network or some plugins or other repos.
there are several methods to check it.
(1):if the command "zcat repo_path/repodata/primary.xml.gz | grep new_pkg_name" may output newly-added packages names.
try to download the packages with wget (assuming that the http service is used to download packages for your yum) such as :
wget http://you_yum_domain_name/rhel/5Server/x86_64/new_pkg.rpm
if it succeds, we are sure that the network is ok.
then run command to check whether it is the fault of options of yum command (step 2). (or,stopped and check your network).
(2) run yum list just to list your own repo. (remember to recover the baseurl to right address)
yum list --disablerepo=* --enablerepo=your_own_repo.* | grep new_pkg_name
if it succeds, it's showing that the problem is caused by other repo(s). try to find the reason.
or it fails, the new packages names still can not be seen, go on to step 3
(3) disable all plugins and try yum list or yum search.
yum list --noplugins | grep pkg_name
or
yum list --noplugins --disablerepo=* --enablerepo=your_repo.*
It is all that i can supply for you to resove the problem, good luck to you. waitting for your response.
________________________________
发件人: jupiter
发送时间: 2012-07-15 14:31:13
收件人: jigang.djg
抄送: yum-devel at lists.baseurl.org
主题: Re: [Yum-devel] Is "yum clean all" problem or repository issue?Newpackages could not show after "yum clean all"
Thanks for your response, please see following comments.
On 7/14/12, jigang.djg <jigang.djg at taobao.com> wrote:
>
> after new packages were added to the reposity, did you update the repos ?
> run command like this:
> /usr/bin/createrepo --update -d -p rhel/5Server/x86_64
Yes I did update each time when new packages were added in.
> and then, run command on the client:
> yum list | grep new_pkg_name
>
> can you see the name of your newly-added packages ?
No, that is the problem.
> "yum clean all" is just used to clean local cache on the client.
I tried "yum clean all", I even manually deleted local __db and other
caches then tried "yum list | grep new_package" again, just not
working.
> For your question or test, the operations below may help you:
>
> 1): update the repos as the way i told you above.
> 2): run comand on the client: yum clean all
> 3): run command on the client to view whether new pacakges have already been
> stored in the new repo files:
>
> zcat repo_path/repodata/primary.xml.gz | grep new_pkg_name
Yes, I checked the xml files, the new_packages are in primary.xmk.gz.
The fact that I can even see new packages when I run "yum list | grep
new_package" in the repository machine, it effectively ruled out that
the private repository has stale cache to prevent "yum list" to see
the new packages.
Now I've got more questions:
(1) Are yum repositories including public yum repositories have caches
not only for its own packages but for other repositories packages
which could prevent my local machine to see new packages from the
private repository?
(2) Does "yum clean all" only clean the local machine cache, or the
"yum clean all" clean caches crossed network including all sites in
repo list?
(3) If "yum clean all" cleans caches from repo list sites, does it
clean only for enabled repos, or both enabled and disabled repos?
I completed lost for how the "yum clean all" can do to affect cleaning
all caches across networks. As I cannot add a test new package to the
public yum repository, I never know if the "yum clean all" works or
not to clean all caches crossing the networks. Any idea how to debug
or fix this issue?
If you know how to test "yum clean all", please let me know.
Thank you.
Kind regards
________________________________
This email (including any attachments) is confidential and may be legally privileged. If you received this email in error, please delete it immediately and do not copy it or use it for any purpose or disclose its contents to any other person. Thank you.
本电邮(包括任何附件)可能含有机密资料并受法律保护。如您不是正确的收件人,请您立即删除本邮件。请不要将本电邮进行复制并用作任何其他用途、或透露本邮件之内容。谢谢。
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.baseurl.org/pipermail/yum-devel/attachments/20120716/f8075553/attachment-0001.html>
More information about the Yum-devel
mailing list