解決策:

解決策:

apt-mirrorローカルUbuntuイメージを作成するために使用しています。別のミラーからファイルを正常にダウンロードしましたが(週あたり約数ギガバイト)、何も削除していないか、削除できるファイルが表示されませんでした。結局のところ、利用可能なスペースが不足する可能性があります。

出力にはapt-mirror常に次のものが含まれます。

0個のファイルと0個のディレクトリから0.0バイトを解放できます。

これを行うには、/var/spool/apt-mirror/var/clean.sh を実行します。

clean.shapt-mirrorの内容は/var/spool/apt-mirror/var/postmirror.sh簡単なので、実行されるたびに実行されます。

/var/spool/apt-mirror/var/clean.sh

実行すると、clean.sh次のような出力が生成されます。

不要なファイル0個[0バイト]を削除しました...完了しました。

不要なディレクトリ0を削除しました...完了しました。

これは私のmirror.listファイルです:

############# config ##################
#
# set base_path    /var/spool/apt-mirror
#
# set mirror_path  $base_path/mirror
# set skel_path    $base_path/skel
# set var_path     $base_path/var
# set cleanscript $var_path/clean.sh
# set defaultarch  <running host architecture>
# set postmirror_script $var_path/postmirror.sh
# set run_postmirror 0
set nthreads     20
set _tilde 0
#
############# end config ##############

deb-i386 http://ubuntu.c3sl.ufpr.br/ubuntu/ trusty main restricted universe multiverse 
deb-i386 http://ubuntu.c3sl.ufpr.br/ubuntu/ trusty-updates main restricted universe multiverse 
deb-i386 http://ubuntu.c3sl.ufpr.br/ubuntu/ trusty-backports main restricted universe multiverse 
deb-i386 http://ubuntu.c3sl.ufpr.br/ubuntu/ trusty-security main restricted universe multiverse 

deb-amd64 http://ubuntu.c3sl.ufpr.br/ubuntu/ trusty main restricted universe multiverse 
deb-amd64 http://ubuntu.c3sl.ufpr.br/ubuntu/ trusty-updates main restricted universe multiverse 
deb-amd64 http://ubuntu.c3sl.ufpr.br/ubuntu/ trusty-backports main restricted universe multiverse 
deb-amd64 http://ubuntu.c3sl.ufpr.br/ubuntu/ trusty-security main restricted universe multiverse 

clean http://archive.ubuntu.com/ubuntu

ベストアンサー1

解決策:

最後の行を次に変更します。

clean http://ubuntu.c3sl.ufpr.br/ubuntu/

説明する:

問題は、クリーンアップするリポジトリを定義する最後の行にあります。clean削除する必要があるリポジトリの名前を取得します。

## Parse config

open CONFIG, "<$config_file" or die("apt-mirror: can't open config file ($config_file)");
while (<CONFIG>)
{
    ## Here we detect the line starting with "clean" and process the URL
    if ( $config_line eq "clean" )
    {
        $config_line[0] =~ s[^(\w+)://][];
        $config_line[0] =~ s[/$][];
        $config_line[0] =~ s[~][%7E]g if get_variable("_tilde");
        $clean_directory{ $config_line[0] } = 1;
        next;
    }
    die("apt-mirror: invalid line in config file ($.: $config_line ...)");
}
## we store the results in the "clean_directory" variable, now we will
## loop through all of them:
foreach ( keys %clean_directory )
{
    process_directory($_) if -d $_ && !-l $_;
}
## and proceed to take the actions:
sub process_directory
{
    my $dir       = shift;
    my $is_needed = 0;
    return 1 if $skipclean{$dir};
    opendir( my $dir_h, $dir ) or die "apt-mirror: can't opendir $dir: $!";
    foreach ( grep { !/^\.$/ && !/^\.\.$/ } readdir($dir_h) )
    {
        my $item = $dir . "/" . $_;
        $is_needed |= process_directory($item) if -d $item && !-l $item;
        $is_needed |= process_file($item)      if -f $item;
        $is_needed |= process_symlink($item)   if -l $item;
    }
    closedir $dir_h;
    push @rm_dirs, $dir unless $is_needed;
    return $is_needed;
}

ファイルが保存されているディレクトリはフォーマットされているため、クリーンアップする/var/spool/apt-mirror/mirror/mirror.domainディレクトリを決定するには、これらのディレクトリのいずれかと一致する必要があり、そうでない場合は何もしません。

そのため、他のURLと一致するようにURLを変更することが解決策です。

おすすめ記事