لینوکس و شبکه

لینوکس و شبکه
طبقه بندی موضوعی
آخرین مطالب
  • ۹۹/۱۱/۱۳
    java

۲ مطلب با کلمه‌ی کلیدی «apt-get install» ثبت شده است

۱۶
تیر

Options:

update
گرفتن (دوباره بدست آوردن) لیست بسته‌های جدید
upgrade:
آپگرید کردن
install
نصب یک بسته
remove:
حذف یک بسته
purge:
حذف بسته به همراه تمامی تنظیمات آن
autoremove:
Remove automatically all unused packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed.
dist-upgrade:
Distribution upgrade
build-dep:
Configure build-dependencies for source packages. install all dependencies for 'packagename'
clean:
Erase downloaded archive files. clean clears out the local repository of retrieved package files. It removes everything but the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/.
autoclean:
پاک کردن فایل‌های آرشیو شده از دانلود‌های قبلی
check:
Verify that there are no broken dependencies
source:
Download source archives. Source packages are tracked separately from binary packages via deb-src lines in the sources.list.
[--compile]: package will be compiled to a binary .deb using dpkg-buildpackage for the architecture as defined by the [--host-architecture] option.
[--download-only]:source package will not be unpacked.
download:
دانلود فایل باینری در مسیر فعلی
changelog:
Download and display the changelog for the given package
سیاهه یا تاریخچهٔ تغییراتی که در پروژه صورت گرفته است
indextargets:
listing of information about all data files (index targets) apt-get update would download
 

 


Options:

[--no-install-recommends]
در هنگام نصب، بسته‌های توصیه‌شده بعنوان وابستگی لحاظ نشوند
[--install-suggests]
درهنگام نصب بسته‌های پیشنهاد شونده(توسط برنامه) بعنوان وابستگی لحاظ نشوند
[-d, --download-only]
فقط فایل‌ها دانلود شوند(unpacked یا نصب نشوند)
[-f, --fix-broken]
تلاش برای اصلاح گسیختگی‌های موجود در  وابستگی‌ها
با این گزینه به برنامه apt اجازه داده می‌شود تا درصورت نیاز هر بسته‌ای را حذف نماید
[-m, --ignore-missing, --fix-missing]
نادیده گرفتن بسته‌‌های‌ خرابی(مثلا دانلود نمیشوند یا اینکه دانلود شده اند ولی خراب هستند)
اگر بسته‌ها نمی‌توانند دانلود شوند یا بعد از دانلود امکان چک و بررسی یکپارچکی وجود نداردآن بسته‌ها را عقب نگه‌دار و نتیجه را هندل کن
اگر این سوییچ را با -f استفاده نمایید ممکن است در  مواردی به ارور برخورد نمایید
اگر نام یک بسته در خط فرمان برای نصب آورده شده باشد درصورت عدم دانلود این بسته بدون هیچ گونه اخطاری از نصب این بسته صرف نظر میشود
[--no-download]
فقط از بسته‌های deb موجود(کنونی) در سیستم‌عامل که پیش‌تر دانلود شده استفاده شود
[-q, --quiet]
این کامند برای تهیه لاگ بسیار مفید است زیرا نشانگرهای پیشرفت و موارد توضیحاتی را حذف می‌کند
با مقداردهی به -q=# میتوانیم  سطح عدم تولید توضیحات را مشخص نماییم
[-s, --simulate, --just-print, --dry-run, --recon, --no-act]
هیچ کاری صورت نگیرد
شبیه‌سازی و نمایش در خروجی از تغییراتی که با اجرای دستور صورت خواهد گرفت
[-y, --yes, --assume-yes]
بطور اتوماتیک به هر  prompt پاسخ yes خواهد داد
run non-interactively
در موارد نامطلوب دستور apt-get متوقف خواهد شد(نظیر: تغییر در نگهداری بسته یا نصب یک بسته غیرمجاز  یا حذف یک بسته خیلی مهم)
[--assume-no]
بصورت پیش‌فرض به  همه promp ها پاسخ no می‌دهد
[--no-show-upgraded]
عدم نمایش لیست تمام بسته‌هایی که آپگرید شده‌اند
[-V, --verbose-versions]
نمایش نسخه تمام نسخه‌ها از بسته‌هایی که آپگرید شده‌اند
[-a, --host-architecture]
بصورت پیش‌فرض تنظیم نیست
در زمان استفاده از دستور apt-get source --compile معماری بسته‌های build شونده کنترل و  cross-builddependencies تامین شوند
[-b, --compile, --build]
Compile source packages after downloading them.
[--ignore-hold]
Ignore package holds;
بسته را نگهداری ننماید-به عبارتی پس از نصب آن را در سیستم نگه‌ندارد
[--with-new-pkgs]
این سوییچ وقتی با دستور upgrade همراه شود دراین صورت مجاز به نصب بسته‌های جدید خواهد بود.
این دستور زمان نیازمندی به یک dependency مفید خواهد بود تا آن نیز بتواند نصب نماید
نکته:دستور upgrade هیچگاه بسته‌ای را حذف نمی‌کند و فقط بسته جدید را نصب می‌کند
[--no-upgrade]
Do not upgrade packages;
همراه با دستور  install : اگر بسته هم‌اکنون نصب شده باشد آنگاه از  upgrade آن دستور جلوگیری بعمل خواهد آمد
[--only-upgrade]
همراه با دستور  install : اگر بسته هم‌اکنون در سیستم‌عامل موجود نباشد، نصب صورت نگیرد
تنها زمانی بسته را آپگرید خواهد کرد که درحال حاضر بسته در سیستم‌عامل وجود داشته و ورژن جدید از آن در دسترس باشد
[--allow-downgrades]
این دستور خطرناک است و ممکن است به سیستم عامل آسیب برساند
تنها در موارد خاص کاربرد دارد و در صورت دانلود ممکن است پیغامی ظاهر نشود
[--allow-remove-essential]
این دستور خطرناک است و ممکن است به سیستم عامل آسیب برساند
بله(Force yes) به حذف دستوراتی که بعنوان پایه در سیستم عامل کاربرد دارند
[--force-yes]
بله(Force yes) به تمامی پیغام‌ها
این دستور منقرض شده است و با دستورات
  --allow-downgrades, --allow-remove-essential, --allow-change-held-packages 
جایگزین شده است
[--print-uris]
بجای اینکه فایل‌ها نصب شوند آدرس URL آن پرینت می‌شود
هر URL دارای path و destination file name و سایز و کد MD5 است
sudo apt-get install aptitude --print-uris
[sudo] password for behrooz: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  aptitude-common libclass-accessor-perl libcwidget3v5 libio-string-perl libparse-debianchangelog-perl libsub-name-perl
Suggested packages:
  aptitude-doc-en | aptitude-doc apt-xapian-index debtags libcwidget-dev libhtml-template-perl libxml-simple-perl
The following NEW packages will be installed:
  aptitude aptitude-common libclass-accessor-perl libcwidget3v5 libio-string-perl libparse-debianchangelog-perl libsub-name-perl
0 upgraded, 7 newly installed, 0 to remove and 38 not upgraded.
Need to get 3,494 kB of archives.
After this operation, 15.8 MB of additional disk space will be used.
'http://deb.debian.org/debian/pool/main/a/aptitude/aptitude-common_0.8.7-1_all.deb' aptitude-common_0.8.7-1_all.deb 1592678 MD5Sum:944f23494615284543660e9ee02c6c6d
'http://deb.debian.org/debian/pool/main/c/cwidget/libcwidget3v5_0.5.17-4+b1_amd64.deb' libcwidget3v5_0.5.17-4+b1_amd64.deb 312582 MD5Sum:153078784a4cac12829bfb967cd9b8c4
'http://deb.debian.org/debian/pool/main/a/aptitude/aptitude_0.8.7-1_amd64.deb' aptitude_0.8.7-1_amd64.deb 1477860 MD5Sum:3bd5df11a809e76d0e925e705b0f9f06
'http://deb.debian.org/debian/pool/main/libs/libsub-name-perl/libsub-name-perl_0.21-1_amd64.deb' libsub-name-perl_0.21-1_amd64.deb 13122 MD5Sum:d2ae0127b9770f1511f9d8d6e65c415a
'http://deb.debian.org/debian/pool/main/libc/libclass-accessor-perl/libclass-accessor-perl_0.34-1_all.deb' libclass-accessor-perl_0.34-1_all.deb 25950 MD5Sum:e8d44fcd57dcb4a39e53f7956b30dd22
'http://deb.debian.org/debian/pool/main/libi/libio-string-perl/libio-string-perl_1.08-3_all.deb' libio-string-perl_1.08-3_all.deb 12298 MD5Sum:8d09424a4c3ba34a8ff890af95391947
'http://deb.debian.org/debian/pool/main/libp/libparse-debianchangelog-perl/libparse-debianchangelog-perl_1.2.0-12_all.deb' libparse-debianchangelog-perl_1.2.0-12_all.deb 59376 MD5Sum:52a19d38904388812afef8d78611e26e
 
[--purge]
اگر بجای remove استفاده شود در این صورت همه چیز را پاک خواهد کرد
[--reinstall]
نصب مجدد بسته‌های که هم‌اکنون نصب شده است(در ورژن بالاتر)
[--list-cleanup]
بطور پیش‌فرض این سوییچ در دستور تعبیه شده است
درصورت روشن بودن دستور apt  بطور اتوماتیک محتوی /var/lib/apt/lists  مدیریت را مدیریت کرده و اطمینان حاصل می‌گردد که فایل‌های منسوخ پاک شده باشد
تنها دلیلی که این ویژگی را می‌توان خاموش کرد این استکه این فایل بطور مداوم تغییر می‌نماید
نکته: از سوییچ  --no-list-cleanup برای خاموش کردن آن استفاده می‌شود
[--no-remove]
اگر هر بسته‌ای بخواهد حذف شود دستور apt-get همان موقع بدون اینکه pronpt بدهد قطع می‌شود
[--auto-remove, --autoremove]
Remove automatically all unused packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed as dependencies changed
[--only-source]
تنها در دستورات buil-dep و  source معنی پیدا می‌کند.
نشان میدهد که نام سورس داده شده به فایل‌های باینری مپ نشده باشد و دستورات تنها  نام بسته‌های سورس را بعنوان آرگومان قبول نمایند
[--allow-unauthenticated]
Ignore if packages can't be authenticated and don't prompt about it.
This can be useful while working with local repositories, but is a huge security risk if data authenticity isn't ensured in another way by the user itself.
The usage of the Trusted option for sources.list(5) entries should usually be preferred over this global override.
[--no-allow-insecure-repositories]
در دستور update ، از گرفتن دیتا‌ی verified نشده جلوگیری بعمل می‌آورد
دستور apt update در صورت مواجهه با  ریپوزیتوری‌هایی با امضای رمز شده غیر معتبر ، fail می‌شود
[--show-progress]
نمایش نوار میزان پیشرفت کار در حین نصب با پاک یا آپگرید
[--with-source filename]
Adds the given file as a source for metadata. Can be repeated to add multiple files. See --with-source description in apt-cache(8) for further details.
[-c, --config-file]
Specify a configuration file to use.
The program will read the default configuration file and then this configuration file.
If configuration settings need to be set before the default configuration files are parsed specify a file with the APT_CONFIG environment variable. See apt.conf(5) for syntax information.
 

 

FILES

/etc/apt/sources.list:
Locations to fetch packages from. Configuration Item: Dir::Etc::SourceList.
/etc/apt/sources.list.d/:
File fragments for locations to fetch packages from. Configuration Item: Dir::Etc::SourceParts.
/etc/apt/apt.conf:
APT configuration file. Configuration Item: Dir::Etc::Main.
/etc/apt/apt.conf.d/:
APT configuration file fragments. Configuration Item: Dir::Etc::Parts.
/etc/apt/preferences:
Version preferences file. This is where you would specify "pinning", i.e. a preference to get certain packages from a separate source or from a different version of a distribution. Configuration Item:[Dir::Etc::Preferences].
/etc/apt/preferences.d/:
File fragments for the version preferences. Configuration Item: Dir::Etc::PreferencesParts.
/var/cache/apt/archives/:
Storage area for retrieved package files. Configuration Item: Dir::Cache::Archives.
/var/cache/apt/archives/partial/:
Storage area for package files in transit. Configuration Item: Dir::Cache::Archives (partial will be implicitly appended)
/var/lib/apt/lists/:
Storage area for state information for each package resource specified in sources.list(5) Configuration Item: Dir::State::Lists.
/var/lib/apt/lists/partial/:
Storage area for state information in transit. Configuration Item: Dir::State::Lists (partial will be implicitly appended)
 
 
 
 
  • برای نمایش آدرس URL یک بسته ای که در هنوز در سرور نصب نیست
apt-get -y install --print-uris <PackageName> | cut -f 2 -d \' | grep \.deb

 

 

 

  • behrooz mohamadi nsasab
۰۴
اسفند

  1. sudo mkdir -p  /media/repo1 /media/repo2  /media/repo3 /opt/DVD
  2. sudo chown -R USERNAME:USERNAME /opt
  3. sudo chmod -R 755 /opt
  4. Copy All DVDs in Directory: /opt/DVD
  5. sudo vim /etc/fstab:
    1. /opt/dvd/debian-9.5.0-i386-DVD-1.iso /media/repo1 iso9660 defaults 0 0
    2. /opt/dvd/debian-9.5.0-i386-DVD-2.iso /media/repo1 iso9660 defaults 0 0
    3. /opt/dvd/debian-9.5.0-i386-DVD-3.iso /media/repo1 iso9660 defaults 0 0
  6. sudo vim /etc/apt/sources.lists:
    1. deb [trusted=yes] file:///media/repo1 stretch main contrib
    2. deb [trusted=yes] file:///media/repo2 stretch main contrib
    3. deb [trusted=yes] file:///media/repo3 stretch main contrib
  • behrooz mohamadi nsasab