тестирование apt-mirror

Я хочу настроить локальное apt-mirror на моем сервере Ubuntu 16.04. В моем mirror.list я загружал только основной и ограниченный пакеты, так как мне не хватает места для всего этого.

После загрузки 20 ГБ пакетов я создал в /var/www/html слинк с именем ubuntu, чтобы получить доступ к пакетам через apache. И, наконец, я отредактировал sources.list на клиенте и изменил fr.archive.ubuntu.com на мой IP. Но когда я запускаю apt-get update, он показывает это:

enter image description here

И установка пакета дает это:

enter image description here

Может кто-нибудь помочь мне? Заранее спасибо.

1
задан 8 June 2016 в 18:12

1 ответ

Если Вы используете apt-mirror v.0.5.1-1 как я. Эта проблема может быть устранена, добавляют DEP-11 индексируйте загрузку в /usr/bin/apt-mirror после line 611 из файла.

вот код.

######################################################################################
## DEP-11 index download

%urls_to_download = ();

sub find_dep11_files_in_release
{
    # Look in the dists/$DIST/Release file for the DEP-11 files that belong
    # to the given component and architecture.

    my $dist_uri  = shift;
    my $component = shift;
    my $arch      = shift;
    my ( $release_uri, $release_path, $line ) = '';

    $release_uri  = $dist_uri . "Release";
    $release_path = get_variable("skel_path") . "/" . sanitise_uri($release_uri);

    unless ( open STREAM, "<$release_path" )
    {
        warn( "Failed to open Release file from " . $release_uri );
        return;
    }

    my $checksums = 0;
    while ( $line = <STREAM> )
    {
        chomp $line;
        if ($checksums)
        {
            if ( $line =~ /^ +(.*)$/ )
            {
                my @parts = split( / +/, $1 );
                if ( @parts == 3 )
                {
                    my ( $sha1, $size, $filename ) = @parts;
                    if ( $filename =~ m{^$component/dep11/(Components-${arch}\.yml|icons-[^./]+\.tar)\.gz$} )
                    {
                        add_url_to_download( $dist_uri . $filename, $size );
                    }
                }
                else
                {
                    warn("Malformed checksum line \"$1\" in $release_uri");
                }
            }
            else
            {
                $checksums = 0;
            }
        }
        if ( not $checksums )
        {
            if ( $line eq "SHA256:" )
            {
                $checksums = 1;
            }
        }
    }
}

print "Processing DEP-11 indexes: [";

foreach (@config_binaries)
{
    my ( $arch, $uri, $distribution, @components ) = @{$_};
    print "D";
    if (@components)
    {
        $url = $uri . "/dists/" . $distribution . "/";

        my $component;
        foreach $component (@components)
        {
            find_dep11_files_in_release( $url, $component, $arch );
        }
    }
}

print "]\n\n";

push( @index_urls, sort keys %urls_to_download );
download_urls( "dep11", sort keys %urls_to_download );

foreach ( keys %urls_to_download )
{
    s[^(\w+)://][];
    s[~][%7E]g if get_variable("_tilde");
    $skipclean{$_} = 1;
}

Затем выполненное обновление Ваше зеркало разъединяет снова. Это должно работать.

1
ответ дан 8 June 2016 в 18:12

Другие вопросы по тегам:

Похожие вопросы: