انجمن‌های فارسی اوبونتو

لطفاً به انجمن‌ها وارد شده و یا جهت ورود ثبت‌نام نمائید

لطفاً جهت ورود نام کاربری و رمز عبورتان را وارد نمائید


ارائه ۲۴٫۱۰ اوبونتو منتشر شد 🎉

نویسنده موضوع: مشکل در نصب apt-fast  (دفعات بازدید: 5754 بار)

0 کاربر و 1 مهمان درحال مشاهده موضوع.

آفلاین alireza hashemi

  • Full Member
  • *
  • ارسال: 232
  • جنسیت : پسر
مشکل در نصب apt-fast
« : 29 فروردین 1393، 09:58 ب‌ظ »
سلام دوستان.
من توی ubuntu 14.04 با دستور زیر مخزن apt-fast رو اضافه کردم.
sudo add-apt-repository ppa:apt-fast/stableخروجی:
This PPA contains tested (stable) builds of apt-fast.
 More info: https://launchpad.net/~apt-fast/+archive/stable
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmpnmbt18j3/secring.gpg' created
gpg: keyring `/tmp/tmpnmbt18j3/pubring.gpg' created
gpg: requesting key CA8DA16B from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpnmbt18j3/trustdb.gpg: trustdb created
gpg: key CA8DA16B: public key "Launchpad PPA for apt-fast" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK
بعد آپدیت کردم و دستور زیر رو زدم:
sudo apt-get install apt-fastخروجی:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package apt-fast
apt-fast نصب نشد.
دوستان لطفا کمکم کنید تا بتونم این مشکل رو حل کنم.

آفلاین azadi

  • Jr. Member
  • *
  • ارسال: 26
  • جنسیت : پسر
پاسخ : مشکل در نصب apt-fast
« پاسخ #1 : 29 فروردین 1393، 11:40 ب‌ظ »
بعد از اضافه کردن مخازن آپدیت می کنی؟؟
sudo apt-get updateچون دستورشو ندیدم تو دستوراتت

آفلاین alireza hashemi

  • Full Member
  • *
  • ارسال: 232
  • جنسیت : پسر
پاسخ : مشکل در نصب apt-fast
« پاسخ #2 : 29 فروردین 1393، 11:41 ب‌ظ »
بعد از اضافه کردن مخازن آپدیت می کنی؟؟
sudo apt-get updateچون دستورشو ندیدم تو دستوراتت
بله

آفلاین alireza hashemi

  • Full Member
  • *
  • ارسال: 232
  • جنسیت : پسر
پاسخ : مشکل در نصب apt-fast
« پاسخ #3 : 30 فروردین 1393، 12:11 ق‌ظ »
آخر آپدیت از مخزن apt-fast داره error میگیره.
Ign http://ppa.launchpad.net trusty InRelease                                 
Ign http://ppa.launchpad.net trusty Release.gpg                               
Ign http://ppa.launchpad.net trusty Release                                   
Ign http://archive.ubuntu.com trusty InRelease                                 
Ign http://archive.ubuntu.com trusty-updates InRelease                         
Ign http://extras.ubuntu.com trusty InRelease                                 
Hit http://extras.ubuntu.com trusty Release.gpg                               
Hit http://extras.ubuntu.com trusty Release                               
Hit http://extras.ubuntu.com trusty/main Sources                               
Hit http://extras.ubuntu.com trusty/main amd64 Packages                   
Hit http://extras.ubuntu.com trusty/main i386 Packages                   
Ign http://extras.ubuntu.com trusty/main Translation-en_US                     
Ign http://extras.ubuntu.com trusty/main Translation-en                       
Ign http://archive.ubuntu.com trusty-backports InRelease                       
Ign http://archive.ubuntu.com trusty-security InRelease                       
Get:1 http://archive.ubuntu.com trusty Release.gpg [933 B]
Get:2 http://archive.ubuntu.com trusty-updates Release.gpg [933 B]             
Hit http://archive.ubuntu.com trusty-backports Release.gpg                 
Hit http://archive.ubuntu.com trusty-security Release.gpg                 
Get:3 http://archive.ubuntu.com trusty Release [58.5 kB]
Get:4 http://archive.ubuntu.com trusty-updates Release [58.5 kB]               
Hit http://archive.ubuntu.com trusty-backports Release                         
Hit http://archive.ubuntu.com trusty-security Release                         
Get:5 http://archive.ubuntu.com trusty/main Sources [1,064 kB]                 
Err http://ppa.launchpad.net trusty/main amd64 Packages                       
  404  Not Found
Err http://ppa.launchpad.net trusty/main i386 Packages                         
  404  Not Found
Ign http://ppa.launchpad.net trusty/main Translation-en_US                     
Ign http://ppa.launchpad.net trusty/main Translation-en                       
Get:6 http://archive.ubuntu.com trusty/restricted Sources [5,433 B]           
Get:7 http://archive.ubuntu.com trusty/universe Sources [6,399 kB]             
Get:8 http://archive.ubuntu.com trusty/multiverse Sources [174 kB]             
Get:9 http://archive.ubuntu.com trusty/main amd64 Packages [1,350 kB]         
Get:10 http://archive.ubuntu.com trusty/restricted amd64 Packages [13.0 kB]   
Get:11 http://archive.ubuntu.com trusty/universe amd64 Packages [5,859 kB]     
Get:12 http://archive.ubuntu.com trusty/multiverse amd64 Packages [132 kB]     
Get:13 http://archive.ubuntu.com trusty/main i386 Packages [1,348 kB]         
Get:14 http://archive.ubuntu.com trusty/restricted i386 Packages [13.4 kB]     
Get:15 http://archive.ubuntu.com trusty/universe i386 Packages [5,866 kB]     
Get:16 http://archive.ubuntu.com trusty/multiverse i386 Packages [134 kB]     
Hit http://archive.ubuntu.com trusty/main Translation-en                       
Hit http://archive.ubuntu.com trusty/multiverse Translation-en
Hit http://archive.ubuntu.com trusty/restricted Translation-en
Hit http://archive.ubuntu.com trusty/universe Translation-en
Get:17 http://archive.ubuntu.com trusty-updates/main Sources [1,712 B]
Get:18 http://archive.ubuntu.com trusty-updates/restricted Sources [14 B]
Get:19 http://archive.ubuntu.com trusty-updates/universe Sources [648 B]
Get:20 http://archive.ubuntu.com trusty-updates/multiverse Sources [1,790 B]
Get:21 http://archive.ubuntu.com trusty-updates/main amd64 Packages [3,014 B]
Get:22 http://archive.ubuntu.com trusty-updates/restricted amd64 Packages [14 B]
Get:23 http://archive.ubuntu.com trusty-updates/universe amd64 Packages [1,633 B]
Get:24 http://archive.ubuntu.com trusty-updates/multiverse amd64 Packages [6,437 B]
Get:25 http://archive.ubuntu.com trusty-updates/main i386 Packages [3,050 B]   
Get:26 http://archive.ubuntu.com trusty-updates/restricted i386 Packages [14 B]
Get:27 http://archive.ubuntu.com trusty-updates/universe i386 Packages [1,631 B]
Get:28 http://archive.ubuntu.com trusty-updates/multiverse i386 Packages [6,422 B]
Hit http://archive.ubuntu.com trusty-updates/main Translation-en               
Hit http://archive.ubuntu.com trusty-updates/multiverse Translation-en         
Hit http://archive.ubuntu.com trusty-updates/restricted Translation-en         
Hit http://archive.ubuntu.com trusty-updates/universe Translation-en           
Hit http://archive.ubuntu.com trusty-backports/main Sources                   
Hit http://archive.ubuntu.com trusty-backports/restricted Sources             
Hit http://archive.ubuntu.com trusty-backports/universe Sources               
Hit http://archive.ubuntu.com trusty-backports/multiverse Sources             
Hit http://archive.ubuntu.com trusty-backports/main amd64 Packages             
Hit http://archive.ubuntu.com trusty-backports/restricted amd64 Packages       
Hit http://archive.ubuntu.com trusty-backports/universe amd64 Packages         
Hit http://archive.ubuntu.com trusty-backports/multiverse amd64 Packages       
Hit http://archive.ubuntu.com trusty-backports/main i386 Packages             
Hit http://archive.ubuntu.com trusty-backports/restricted i386 Packages       
Hit http://archive.ubuntu.com trusty-backports/universe i386 Packages         
Hit http://archive.ubuntu.com trusty-backports/multiverse i386 Packages       
Hit http://archive.ubuntu.com trusty-backports/main Translation-en             
Hit http://archive.ubuntu.com trusty-backports/multiverse Translation-en       
Hit http://archive.ubuntu.com trusty-backports/restricted Translation-en       
Hit http://archive.ubuntu.com trusty-backports/universe Translation-en         
Hit http://archive.ubuntu.com trusty-security/main Sources
Hit http://archive.ubuntu.com trusty-security/restricted Sources
Hit http://archive.ubuntu.com trusty-security/universe Sources
Hit http://archive.ubuntu.com trusty-security/multiverse Sources
Hit http://archive.ubuntu.com trusty-security/main amd64 Packages
Hit http://archive.ubuntu.com trusty-security/restricted amd64 Packages
Hit http://archive.ubuntu.com trusty-security/universe amd64 Packages
Hit http://archive.ubuntu.com trusty-security/multiverse amd64 Packages
Hit http://archive.ubuntu.com trusty-security/main i386 Packages
Hit http://archive.ubuntu.com trusty-security/restricted i386 Packages
Hit http://archive.ubuntu.com trusty-security/universe i386 Packages
Hit http://archive.ubuntu.com trusty-security/multiverse i386 Packages
Hit http://archive.ubuntu.com trusty-security/main Translation-en
Hit http://archive.ubuntu.com trusty-security/multiverse Translation-en
Hit http://archive.ubuntu.com trusty-security/restricted Translation-en
Hit http://archive.ubuntu.com trusty-security/universe Translation-en
Ign http://archive.ubuntu.com trusty/main Translation-en_US
Ign http://archive.ubuntu.com trusty/multiverse Translation-en_US
Ign http://archive.ubuntu.com trusty/restricted Translation-en_US
Ign http://archive.ubuntu.com trusty/universe Translation-en_US
Ign http://archive.ubuntu.com trusty-updates/main Translation-en_US
Ign http://archive.ubuntu.com trusty-updates/multiverse Translation-en_US
Ign http://archive.ubuntu.com trusty-updates/restricted Translation-en_US
Ign http://archive.ubuntu.com trusty-updates/universe Translation-en_US
Ign http://archive.ubuntu.com trusty-backports/main Translation-en_US
Ign http://archive.ubuntu.com trusty-backports/multiverse Translation-en_US
Ign http://archive.ubuntu.com trusty-backports/restricted Translation-en_US
Ign http://archive.ubuntu.com trusty-backports/universe Translation-en_US
Ign http://archive.ubuntu.com trusty-security/main Translation-en_US
Ign http://archive.ubuntu.com trusty-security/multiverse Translation-en_US
Ign http://archive.ubuntu.com trusty-security/restricted Translation-en_US
Ign http://archive.ubuntu.com trusty-security/universe Translation-en_US
Fetched 22.5 MB in 17min 58s (20.9 kB/s)
W: Failed to fetch http://ppa.launchpad.net/apt-fast/stable/ubuntu/dists/trusty/main/binary-amd64/Packages  404  Not Found

W: Failed to fetch http://ppa.launchpad.net/apt-fast/stable/ubuntu/dists/trusty/main/binary-i386/Packages  404  Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
« آخرین ویرایش: 30 فروردین 1393، 12:15 ب‌ظ توسط alireza hashemi »

آفلاین alireza hashemi

  • Full Member
  • *
  • ارسال: 232
  • جنسیت : پسر
پاسخ : مشکل در نصب apt-fast
« پاسخ #4 : 30 فروردین 1393، 01:38 ب‌ظ »
تونستم نصب کنم.(بدون اضافه کردن مخزن جدید)
تمام مخازن کانونیکال رو تو قسمت software and update فعال کردم و بعد آپدیت کردم.
دستور sudo apt-get install apt-fast رو زدم و به راحتی نصب شد.
سوال:
پس چرا توی همهی آموزش ها نوشته که باید مخزن اضافه کرد؟

آفلاین x

  • High Sr. Member
  • *
  • ارسال: 561
  • جنسیت : پسر
پاسخ : مشکل در نصب apt-fast
« پاسخ #5 : 30 فروردین 1393، 03:28 ب‌ظ »
سلام
برنامه های مخازن ppa جدید تر از مخازن دیگه هستن
اون مخزن ppa که شما اضافه کردین ارور داد ارور 404

معنی این ارور آشکار است ، و
معمولا وقتی ظاهر می‌شود که صفحه مورد نظر وجود نداشته باشد یا آدرس را به اشتباه
تایپ کرده باشید و یا ناکامل باشد . ولی چرا ارور ۴۰۴ ، چرا ارور ۳۰۳ ، نه ؟!

برای جواب به این سؤال باید به
وقتی برگردیم که هنوز www یک
استاندارد ، نبود. گروهی از دانشمندان جوان CERN
سوئیس شروع به کار روی www
کردند. این گروه جوان از نقشه فیزیکی شبکه CERN
و ساختمان محل کار خود ، در پروتکلهایی که به وجود می‌آوردند استفاده می‌کردند.
آنها محل پایگاه داده‌های خود را در اتاقی در طبقه چهارم ساختمان ، یعنی دقیقا اتاق
۴۰۴ قرار داده بودند ، هر درخواستی برای یک فایل به آن اتاق راهنمایی می‌شد.

با ادامه کار آنها کم‌کم تقاضای
فایل از دیتابیس اتاق ۴۰۴ زیاد شد ، طوری که گاهی نام فایلها اشتباه تایپ می‌شد و
پیام استاندارد" Room 404: file not found"
ظاهر می‌شد.

با باقی ماندن متن این ارور ،
خاطره آن اتاق ۴۰۴ برای همیشه ماندگار مانده است.
« آخرین ویرایش: 30 فروردین 1393، 03:49 ب‌ظ توسط faramarz42 »

آفلاین حسین دیباپور

  • Sr. Member
  • *
  • ارسال: 257
  • جنسیت : پسر
  • حرف کم بزن --- عمل کن یکم
    • وبلاگ شخصی حسین دیباپور
پاسخ : مشکل در نصب apt-fast
« پاسخ #6 : 01 اردیبهشت 1393، 12:06 ب‌ظ »
سلام. منم همین مشکل رو دارم.
هرکاری هم میکنم درست نمیشه.
مخازن کانونیکال رو فعال کردم ولی نشد.
توی لیست مخازن مخازن apt-fast هست که با فعال کردن اون این ارور میاد.
مثل اینکه apt-fast از توی مخازن خودش هم برداشته شده.
چکار باید کنم؟

آفلاین hassan.yavar

  • Jr. Member
  • *
  • ارسال: 59
  • جنسیت : پسر
پاسخ : مشکل در نصب apt-fast
« پاسخ #7 : 01 اردیبهشت 1393، 12:36 ب‌ظ »
اضافه کردن مخازن دوباره با مشکل مواجه شده
الان من کلی زجر کشیدم برای اضافه کردن بوت ریپیر
البته تو 14.04 هر کار کردم نتونستم اما با 13.10 مشکلی نبود به راحتی اضافه شد

آفلاین حسین دیباپور

  • Sr. Member
  • *
  • ارسال: 257
  • جنسیت : پسر
  • حرف کم بزن --- عمل کن یکم
    • وبلاگ شخصی حسین دیباپور
پاسخ : مشکل در نصب apt-fast
« پاسخ #8 : 01 اردیبهشت 1393، 02:24 ب‌ظ »
پس مشکل از مخازنه فعلا.
آخه فکر کردم ایراد از طرف منه.
پس مجبوریم بمونیم تا درست بشه.
ممنونم.

آفلاین robotic

  • Full Member
  • *
  • ارسال: 176
  • جنسیت : پسر
پاسخ : مشکل در نصب apt-fast
« پاسخ #9 : 01 اردیبهشت 1393، 03:08 ب‌ظ »
پس مشکل از مخازنه فعلا.
آخه فکر کردم ایراد از طرف منه.
پس مجبوریم بمونیم تا درست بشه.
ممنونم.



apt-fast برنامه نیست. یک اسکریپت است. که دو تا فایل دارد. کافی است آن دو را ایجاد کنی

این اسکریپت از دو برنامه ی apt-get و aria2 استفاده می کند

برنامه ی apt-get که به طور پیشفرض نصب است.

بنابراین ایتدا برنامه aria2 را نصب بکن

حال اسکریپت را به روش زیر می سازیم.


cd ~
touch apt-fast
touch apt-fast.conf
nano -w apt-fast

بعد کد زیر را کپی کن

#!/bin/bash
#
# apt-fast v1.8
# Use this just like aptitude or apt-get for faster package downloading.
#
# Copyright: 2008-2012 Matt Parnell, http://www.mattparnell.com
# Improvements, maintenance, revisions - 2012 Dominique Lasserre
#
# You may distribute this file under the terms of the GNU General
# Public License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
[ -n "$DEBUG" ] && set -xv

# Print colored messages.
# Usage: msg "message text" "message type" "optional: err"
# Message types are 'normal', 'hint' or 'warning'. Warnings and messages with a
# third argument are piped to stderr.
msg(){
  case "$2" in
    normal) beginColor="$cGreen";;
    hint) beginColor="$cBlue";;
    warning) beginColor="$cRed";;
  esac

if [ -z "$3" ] && [ "$2" != "warning" ]; then
echo -e "${aptfast_prefix} ${beginColor}$1${endColor}";
  else
echo -e "${aptfast_prefix} ${beginColor}$1${endColor}"; >&2
  fi
}

# Search for known options and decide if root privileges are needed.
root=1 # default value: we need root privileges
option=
for arguments in $@; do
if [ "$arguments" == "upgrade" ] ||
      [ "$arguments" == "install" ] ||
      [ "$arguments" == "dist-upgrade" ] ||
      [ "$arguments" == "build-dep" ]; then
option="install"
    break
elif [ "$arguments" == "clean" ] ||
      [ "$arguments" == "autoclean" ]; then
option="clean"
    break
elif [ "$arguments" == "download" ]; then
option="download"
    root=0
    break
elif [ "$arguments" == "source" ]; then
option="source"
    root=0
    break
elif [ "$arguments" == "changelog" ]; then
root=0
    break
fi
done

# To handle priority of options correctly (environment over config file vars)
# we need to preserve all interesting env variables. As this wouldn't be
# difficult enough we have to preserve complete env vars (especially if value
# ist set (even empty) or not) when changing context (sudo)...
# Set a 'random' string to all unset variables.
TMP_RANDOM="13979853562951413"
TMP_LCK_FILE="${LCK_FILE-${TMP_RANDOM}}"
TMP_DOWNLOADBEFORE="${DOWNLOADBEFORE-${TMP_RANDOM}}"
TMP__APTMGR="${_APTMGR-${TMP_RANDOM}}"
TMP_APTCACHE="${APTCACHE-${TMP_RANDOM}}"
TMP_DLDIR="${DLDIR-${TMP_RANDOM}}"
TMP_DLLIST="${DLLIST-${TMP_RANDOM}}"
TMP_LISTDIR="${LISTDIR-${TMP_RANDOM}}"
TMP__MAXNUM="${MAXNUM-${TMP_RANDOM}}"
TMP_aptfast_prefix="${aptfast_prefix-${TMP_RANDOM}}"
TMP_APT_FAST_TIMEOUT="${APT_FAST_TIMEOUT-${TMP_RANDOM}}"

# Check for proper privileges.
# Call explicitly with environment variables to get them into root conext.
if [ "$root" = 1 -a "$UID" != 0 ]; then
exec sudo DEBUG="$DEBUG" \
            LCK_FILE="$TMP_LCK_FILE" \
            DOWNLOADBEFORE="$TMP_DOWNLOADBEFORE" \
            _APTMGR="$TMP__APTMGR" \
            APTCACHE="$TMP_APTCACHE" \
            DLDIR="$TMP_DLDIR" \
            DLLIST="$TMP_DLLIST" \
            LISTDIR="$TMP_LISTDIR" \
            _MAXNUM="$TMP_MAXNUM" \
            aptfast_prefix="$TMP_aptfast_prefix" \
            APT_FAST_TIMEOUT="$TMP_APT_FAST_TIMEOUT" "$0" "$@"
fi


# Define lockfile.
# Use /tmp as directory because everybody (not only root) has to have write
# permissions.
# We need lock for non-root commands too, because we only have one download
# list file.
LCK_FILE="/tmp/apt-fast"
LCK_FD=99

# Set default package manager, APT cache, temporary download dir,
# temporary download list file, and maximal parallel downloads
_APTMGR=apt-get
eval $(apt-config shell APTCACHE Dir::Cache::archives/d)
# Check if APT config option Dir::Cache::archives::apt-fast-partial is set.
eval $(apt-config shell apt_fast_partial Dir::Cache::archives::apt-fast-partial/d)
if [ -z "$apt_fast_partial" ]; then
eval $(apt-config -o Dir::Cache::archives::apt-fast-partial=apt-fast shell DLDIR Dir::Cache::archives::apt-fast-partial/d)
else
eval $(apt-config shell DLDIR Dir::Cache::archives::apt-fast-partial/d)
fi
# Currently not needed.
eval $(apt-config shell LISTDIR Dir::State::lists/d)
DLLIST="/tmp/apt-fast.list"
_MAXNUM=5

# Prefix in front of apt-fast output:
aptfast_prefix=

# Set color variables.
cGreen='\e[0;32m'
cRed='\e[0;31m'
cBlue='\e[0;34m'
endColor='\e[0m'

# Set timout value for apt-fast download confirmation dialog.
# Value is in seconds.
APT_FAST_TIMEOUT=60

# Download command.
_DOWNLOADER='aria2c -c -j ${_MAXNUM} -k1M -s16 -x16 -i ${DLLIST} --connect-timeout=600 --timeout=600 -m0'

# Load config file.
CONFFILE="/etc/apt-fast.conf"
if [ -e "$CONFFILE" ]; then
source "$CONFFILE"
fi

# Now overwrite with preserved values if values were set before (compare with
# 'random' string).
[ "$TMP_LCK_FILE" = "$TMP_RANDOM" ] || LCK_FILE="$TMP_LCK_FILE"
[ "$TMP_DOWNLOADBEFORE" = "$TMP_RANDOM" ] || DOWNLOADBEFORE="$TMP_DOWNLOADBEFORE"
[ "$TMP__APTMGR" = "$TMP_RANDOM" ] || _APTMGR="$TMP__APTMGR"
[ "$TMP_APTCACHE" = "$TMP_RANDOM" ] || APTCACHE="$TMP_APTCACHE"
[ "$TMP_DLDIR" = "$TMP_RANDOM" ] || DLDIR="$TMP_DLDIR"
[ "$TMP_DLLIST" = "$TMP_RANDOM" ] || DLLIST="$TMP_DLLIST"
[ "$TMP_LISTDIR" = "$TMP_RANDOM" ] || LISTDIR="$TMP_LISTDIR"
[ "$TMP__MAXNUM" = "$TMP_RANDOM" ] || _MAXNUM="$TMP__MAXNUM"
[ "$TMP_aptfast_prefix" = "$TMP_RANDOM" ] || aptfast_prefix="$TMP_aptfast_prefix"
[ "$TMP_APT_FAST_TIMEOUT" = "$TMP_RANDOM" ] || APT_FAST_TIMEOUT="$TMP_APT_FAST_TIMEOUT"


# Disable colors if not executed in terminal.
if [ ! -t 1 ]; then
cGreen=
  cRed=
  cBlue=
  endColor=
  #FIXME: Time not updated.
  [ -z "$aptfast_prefix" ] && aptfast_prefix="[apt-fast $(date +"%T")]"
fi


msg_already_running()
{
  msg "apt-fast already running!" "warning"
  msg "Verify that all apt-fast processes are finished then remove $LCK_FILE.lock and try again." "hint"
}

# Check if a lock file exists.
if [ -f "$LCK_FILE.lock" ]; then
msg_already_running
  exit 1
fi


# create the lock file and lock it, die on failure
_create_lock()
{
    eval "exec $LCK_FD>\"$LCK_FILE.lock\""

    trap "_remove_lock; exit" EXIT
    trap "_remove_lock; exit 1;" INT KILL TERM

    flock -n $LCK_FD || { msg_already_running; exit 1; }
}

# unlock and remove the lock file
_remove_lock()
{
    flock -u "$LCK_FD" 2>/dev/null
    rm -f "$LCK_FILE.lock"
}


# Check if mirrors are available. And if so add all mirrors to download list.
get_mirrors(){
  # Check all mirror lists.
  for mirrorstr in ${MIRRORS[@]}; do
    # Build mirrors array from comma separated string.
    mirrors=( $(echo "$mirrorstr" | sed "s/\([^,]\+\)\s*,\s*/\1 /g") )
    # This does not the \s*,\s* trick, so we use sed instead to make it more
    # robust.
    #mirrors=( ${mirrorstr//,/ } )
    # Check for all mirrors if URI of $1 is from mirror. If so add all other
    # mirrors to (resmirror) list and break all loops.
    for mirror in ${mirrors[@]}; do
      # Real expension.
      if [[ "$1" == "$mirror"* ]]; then
filepath=${1#${mirror}}
        # Build list for aria download list.
        list="${mirrors[@]}"
        echo -e "${list// /${filepath}\t}$filepath\n"
        return 0
      fi
done
done
  # No other mirrors found.
  echo "$1"
}

# Get the package URLs.
get_uris(){
  # Add header to overwrite file.
  echo "# apt-fast mirror list: $(date)" > "$DLLIST"
  #NOTE: aptitude doesn't have this functionality, so we use apt-get to get
  # package URIs.
  for urimd5 in $(apt-get -y --print-uris $@ | egrep "^'(http(s|)|(s|)ftp)://[^']+'.+ MD5Sum:\S+\s*$" |
      sed "s/^'\(.\+\)'.*MD5Sum:\(\S\+\)\s*$/\1::MD5Sum:\2/"); do
  #for urimd5 in $(cat foo | egrep "^'(http(s|)|(s|)ftp)://[^']+'.+ MD5Sum:\S+\s*$" |
  # sed "s/^'\(.\+\)'.*MD5Sum:\(\S\+\)\s*$/\1::MD5Sum:\2/"); do
    uri="${urimd5%::MD5Sum:*}"
    checksum="${urimd5#*::MD5Sum:}"
    echo "$(get_mirrors "$uri")" >> "$DLLIST"
    #echo " dir=$DLDIR" >> "$DLLIST"
    echo " checksum=md5=$checksum" >> "$DLLIST"
    echo " out=$(basename $uri)" >> "$DLLIST"
  done
  #cat "$DLLIST"
  #LCK_RM
  #exit
}

# Create and insert a PID number to lockfile.
_create_lock

# Make sure aria2c (in general first parameter from _DOWNLOADER) is available.
CMD="$(echo "$_DOWNLOADER" | sed 's/^\s*\([^ ]\+\).*$/\1/')"
if [ ! $(command -v "$CMD") ]; then
msg "Command not found: $CMD" "normal" "err"
  msg "You must configure $CONFFILE to use aria2c or another supported download manager" "normal" "err"
  exit 1
fi

# Make sure package manager is available.
if [ ! $(command -v "$_APTMGR") ]; then
msg "\`$_APTMGR\` command not available." "warning"
  msg "You must configure $CONFFILE to use either apt-get or aptitude." "normal" "err"
  exit 1
fi


# Run actions.
if [ "$option" == "install" ]; then
msg "\n Working... this may take a while." "normal"

  get_uris $@

  # Check if "assume yes" switch is enabled and if yes enable $DOWNLOADBEFORE.
  #TODO: Get real value over APT items APT::Get::Assume-Yes and
  # APT::Get::Assume-No .
  #FIXME: Composed short options e.g. "-yV" are not recognised - we should use
  # getopts for proper option passing.
  for option in $@; do
if [ "$option" == "-y" ] ||
        [ "$option" == "--yes" ] ||
        [ "$option" == "--assume-yes" ]; then
DOWNLOADBEFORE=true
elif [ "$option" == "--assume-no" ]; then
DOWNLOADBEFORE=
    fi
done

  # Test /tmp/apt-fast.list file exists AND not zero bytes.
  # Then download all files from the list.
  if [ $(cat "$DLLIST" | wc -l) -gt 0 ] && [ ! "$DOWNLOADBEFORE" ]; then
cat "$DLLIST"

    echo -ne "${cRed} If you want to download the packages on your system press Y else n to abort. [Y/n]: ${endColor}"

    while ((!updsys)); do
read -sn1 -t "$APT_FAST_TIMEOUT" answer || { msg "\n Timed out." "warning"; exit 1; }
      case "$answer" in
        [JjYy]) result=1; updsys=1 ;;
        [Nn]) result=0; updsys=1 ;;
        "") result=1; updsys=1 ;;
        *) updsys=0 ;;
      esac
done
else
result=1
  fi

echo

  # Continue if answer was right or DOWNLOADBEFORE is enabled.
  if ((result)); then
if [ -s "$DLLIST" ]; then
      # Test if apt-fast directory is present where we put packages.
      if [ ! -d "$DLDIR" ]; then
mkdir -p -- "$DLDIR"
      fi

cd "$DLDIR" &>/dev/null || exit 1

      eval "${_DOWNLOADER}" # execute downloadhelper command
      if [ $(find "$DLDIR" -printf . | wc -c) -gt 1 ]; then
        # Move all packages to the apt install directory by force to ensure
        # already existing debs which may be incomplete are replaced
        find -type f -name "*.deb" -execdir mv -ft "$APTCACHE" {} \+
      fi
cd - &>/dev/null
    fi
else
exit 1
  fi

  #FIXME: quotes get lost: apt-fast install "foo*" -> apt-get install foo*
  "${_APTMGR}" $@


elif [ "$option" == "clean" ]; then
  #FIXME: quotes get lost (see above)
  "${_APTMGR}" $@ && {
    find "$DLDIR" -maxdepth 1 -type f -delete
    [ -f "$DLLIST" ] && rm -f -- "$DLLIST"*
  }

elif [ "$option" == "download" ]; then
get_uris $@
  eval "${_DOWNLOADER}"

elif [ "$option" == "source" ]; then
msg "\n Working... this may take a while.\n" "normal"
  get_uris $@
  eval "${_DOWNLOADER}"
  # We use APT manager here to provide more verbose output. This method is
  # slightly slower then extractiong packages manually after download but also
  # more hardened (e.g. some options like --compile are available).
  "${_APTMGR}" $@
  # Uncomment following snippet to extract source directly and comment
  # both lines before.
  #while read srcfile; do
  # # extract only .dsc files
  # echo "$srcfile" | grep -q '\.dsc$' || continue
  # dpkg-source -x "$(basename "$srcfile")"
  #done < "$DLLIST"

# Execute package manager directly if unknown options are passed.
else
  #FIXME: quotes get lost (see above)
  "${_APTMGR}" $@

fi


# After error or all done remove our lockfile

سپس  با نگه داشتن کنترل و فشار دادن ایکس به مرحله ذخیره کردن برو سپس y را بزن. و بعد دو بار اینتر.

حال کد زیر را بزن

nano -w apt-fast.conf
سپس کد زیر را کپی کن

###################################################################
# CONFIGURATION OPTIONS
###################################################################
# Every item has a default value besides MIRRORS (which is unset).

# Use aptitude or apt-get?
# Note that for outputting the package URI list, we always use apt-get
# ...since aptitude can't do this
# Optionally add the FULLPATH to apt-get or apt-rpm or aptitude
# e.g. /usr/bin/aptitude
#
# Default: apt-get
#
#_APTMGR=apt-get


# Enable DOWNLOADBEFORE to suppress apt-fast confirmation dialog and download
# packages directly.
#
# Default: dialog enabled
#
#DOWNLOADBEFORE=true


# Choose mirror list to speed up downloads from same archive. To select some
# mirrors take a look at your distribution's archive mirror lists.
# Debian: http://www.debian.org/mirror/list
# Ubuntu: https://launchpad.net/ubuntu/+archivemirrors
#
# Examples:
# To use some German mirrors and official Debian and Ubuntu archives you can use:
# MIRRORS=( 'http://ftp.debian.org/debian,http://ftp2.de.debian.org/debian,http://ftp.de.debian.org/debian,ftp://ftp.uni-kl.de/debian'
# 'http://archive.ubuntu.com/ubuntu,http://de.archive.ubuntu.com/ubuntu,http://ftp.halifax.rwth-aachen.de/ubuntu,http://ftp.uni-kl.de/pub/linux/ubuntu,http://mirror.informatik.uni-mannheim.de/pub/linux/distributions/ubuntu/' )
# To use French Ubuntu mirrors you can use:
# MIRRORS=( 'http://fr.archive.ubuntu.com/ubuntu,http://bouyguestelecom.ubuntu.lafibre.info/ubuntu,http://mirror.ovh.net/ubuntu,http://ubuntu-archive.mirrors.proxad.net/ubuntu' )
#
# Default: disabled
#
#MIRRORS=( 'none' )


# Maximum number of connections
# You can use this value in _DOWNLOADER command. Escape with ${}: ${_MAXNUM}
#
# Default: 5
#
#_MAXNUM=5


# Downloadmanager listfile
# You can use this value in _DOWNLOADER command. Escape with ${}: ${DLLIST}
#
# Default: /tmp/apt-fast.list
#
#DLLIST=/tmp/apt-fast.list


# Download command to use. Temporary download list is designed for aria2. But
# you can choose another download command or download manager. It has to
# support following input file syntax (\t is tab character):
#
# # Comment
# MIRROR1\tMIRROR2\tMIRROR3...
# out=FILENAME1
# MIRROR1\tMIRROR2\tMIRROR3...
# out=FILENAME2
# ...
#
# Examples:
# aria2c with a proxy (set username, proxy, ip and password!)
# _DOWNLOADER='aria2c -c 20 -j ${_MAXNUM} --http-proxy=http://username:password@proxy_ip:proxy_port -i ${DLLIST}'
#
# Default: _DOWNLOADER='aria2c -c -j ${_MAXNUM} -i ${DLLIST} --connect-timeout=600 --timeout=600 -m0'
#
#_DOWNLOADER='aria2c -c -j ${_MAXNUM} -i ${DLLIST} --connect-timeout=600 --timeout=600 -m0'


# Download temp folder for Downloadmanager
# example /tmp/apt-fast. Standard is /var/cache/archives/apt-fast
#
# Default: /var/cache/apt/archives/apt-fast
#
#DLDIR=/var/cache/apt/archives/apt-fast


# APT archives cache directory
#
# Default /var/cache/apt/archives
# (APT configuration items Dir::Cache and Dir::Cache::archives)
#
#APTCACHE=/var/cache/apt/archives


# apt-fast colors
# Colors are disabled when not using a terminal.
#
# Default colors are:
# cGreen='\e[0;32m'
# cRed='\e[0;31m'
# cBlue='\e[0;34m'
# endColor='\e[0m'

سپس  با نگه داشتن کنترل و فشار دادن ایکس به مرحله ذخیره کردن برو سپس y را بزن. و بعد دو بار اینتر.

چند خط دستور زیر را نیز بزن.

sudo chmod +x apt-fast
sudo mv apt-fast /usr/bin/
sudo mv apt-fast.conf /etc/

حالا می توانی از apt-fast استفاده کنی

آفلاین gholami.vahid

  • Full Member
  • *
  • ارسال: 201
  • جنسیت : پسر
    • متن های عاشقانه وزیبا
پاسخ : مشکل در نصب apt-fast
« پاسخ #10 : 22 مهر 1393، 01:36 ب‌ظ »
پس مشکل از مخازنه فعلا.
آخه فکر کردم ایراد از طرف منه.
پس مجبوریم بمونیم تا درست بشه.
ممنونم.



apt-fast برنامه نیست. یک اسکریپت است. که دو تا فایل دارد. کافی است آن دو را ایجاد کنی

این اسکریپت از دو برنامه ی apt-get و aria2 استفاده می کند

برنامه ی apt-get که به طور پیشفرض نصب است.

بنابراین ایتدا برنامه aria2 را نصب بکن

حال اسکریپت را به روش زیر می سازیم.


cd ~
touch apt-fast
touch apt-fast.conf
nano -w apt-fast

بعد کد زیر را کپی کن



با درود یر شما دوست عزیز و گرامی

سرعت  دانلود بنده با aria2  در حدود ۱۲۸ کیلو بایت بر ثانیه است اما زمان استفاده از apt-fast و نصب برنامه ها سرعت  همانند قبل بر روی 20kb است و عملا سرعت افزایش پیدا نکرده است .
به نظر شما مشکل از  سرور و پایین بودن سرعت آن میباشد یا در نصب apt-fast