DNF
DNF is the The Fedora Project package manager that is able to query for information about packages, fetch packages from repositories, install and uninstall packages using automatic dependency resolution, and update an entire system to the latest available packages. DNF performs automatic dependency resolution on packages you are updating, installing or removing, and thus is able to automatically determine, fetch and install all available dependent packages. DNF can be configured with new, additional repositories, or package sources, and also provides many plug-ins which enhance and extend its capabilities. DNF is able to perform many of the same tasks that RPM can; additionally, many of the command line options are similar. DNF enables easy and simple package management on a single machine or on groups of them.
GPG-서명된 꾸러미를 사용한 보안 꾸러미 관리
DNF provides secure package management by enabling GPG (Gnu Privacy Guard; also known as GnuPG) signature verification on GPG-signed packages to be turned on for all package repositories (package sources), or for individual repositories. When signature verification is enabled, DNF will refuse to install any packages not GPG-signed with the correct key for that repository. This means that you can trust that the RPM packages you download and install on your system are from a trusted source, such as The Fedora Project, and were not modified during transfer. See Configuring DNF and DNF Repositories for details on enabling signature-checking with DNF, or Checking Package Signatures for information on working with and verifying GPG-signed RPM packages in general. |
DNF also enables you to easily set up your own repositories of RPM packages for download and installation on other machines.
Learning DNF is a worthwhile investment because it is often the fastest way to perform system administration tasks, and it provides capabilities beyond those provided by the PackageKit graphical package management tools.
DNF와 슈퍼유저 권한
You must have superuser privileges in order to use the dnf command to install, update or remove packages on your system. All examples in this chapter assume that you have already obtained superuser privileges by using either the su or sudo command. |
꾸러미 확인과 최신화
최신화 확인하기
The quickest way to check for updates is to attempt to install any available updates by using the dnf upgrade command as follows:
~]# dnf upgrade 마지막 메타자료 만료 점검은 2015년 5월 14일 목요일 23시 23분 51초 (1시간 24분 32초 이전)에 수행되었습니다. 의존성이 해결되었습니다. 처리가 필요하지 않습니다 완료되었습니다!
Note that dnf upgrade installs only those updates that can be installed. If a package cannot be updated, because of dependency problems for example, it is skipped.
The dnf check-update command can be used see which installed packages on your system have new versions available, however it does not mean that they can be successfully installed. This command is therefore mostly useful in scripts and for checking for updated packages that were not installed after running dnf upgrade.
예를 들어:
~]# dnf check-update 2015년 4월 20일 월요일 16시 34분 10초 (2시간 42분 10초 이전)에서 메타자료 사용하기 python.x86_64 2.7.9-6.fc22 최신화 python-cryptography.x86_64 0.8.2-1.fc22 최신화 python-libs.x86_64 2.7.9-6.fc22 최신화
The packages in the above output are listed as having updated versions. The line in the example output tells us:
-
파이썬
— 꾸러미의 이름, -
x86_64
— 꾸러미가 구성된 CPU 구조, -
2.7.9
— 최신화된 꾸러미의 버전, -
6.fc22
— 최신화된 꾸러미의 출시, -
updates-testing
— 최신화된 꾸러미가 위치된 저장소.
꾸러미 최신화하기
You can choose to update a single package, multiple packages, or all packages at once. If any dependencies of the package, or packages, you update have updates available themselves, then they are updated too.
단일 꾸러미를 최신화 하려면, `root`으로 다음 명령을 실행하세요:
dnf upgrade 꾸러미_이름
예제로, python 꾸러미를 최신화 하려면, 다음과 같이 입력하세요:
~]# dnf upgrade python 2015년 4월 20일 월요일 16시 38분 16초 (2시간 42분 14초 이전)에서 메타자료 사용하기 의존성이 해결되었습니다. ================================================================== 꾸러미 구조 버전 저장소 크기 ================================================================== 향상하기: python x86_64 2.7.9-6.fc22 updates 92 k python-libs x86_64 2.7.9-6.fc22 updates 5.8 M 연결 요약 ================================================================== 향상 2 꾸러미 총계 내려받은 크기: 5.9 M 계속할까요 [y/N]:
이 출력은 다음을 포함합니다:
-
python.x86_64
— 당신은 신규 python 꾸러미를 내려받고 설치 할 수 있습니다. -
python-libs.x86_64
— DNF has resolved that the python-libs-2.7.9-6.fc22.x86_64 package is a required dependency of the python package. -
DNF presents the update information and then prompts you as to whether you want it to perform the update; DNF runs interactively by default. If you already know which transactions DNF plans to perform, you can use the
-y
option to automatically answer yes to any questions DNF may ask (in which case it runs non-interactively). However, you should always examine which changes DNF plans to make to the system so that you can easily troubleshoot any problems that might arise.If a transaction does go awry, you can view DNF’s transaction history by using the dnf history command as described in Working with Transaction History.
DNF로 커널 최신화와 설치하기
DNF always installs a new kernel in the same sense that RPM installs a new kernel when you use the command rpm -i kernel. Therefore, you do not need to worry about the distinction between installing and upgrading a kernel package when you use the dnf command: it will do the right thing, regardless of whether you are using the dnf upgrade or dnf install command. When using RPM, on the other hand, it is important to use the rpm -i kernel command (which installs a new kernel) instead of rpm -u kernel (which replaces the current kernel). See Installing and Upgrading Packages for more information on installing and updating kernels with RPM. |
To update all packages and their dependencies, enter dnf upgrade without any arguments:
dnf upgrade
구성 파일 변경 보존하기
You will inevitably make changes to the configuration files installed by packages as you use your Fedora system. RPM, which DNF uses to perform changes to the system, provides a mechanism for ensuring their integrity. See Installing and Upgrading Packages for details on how to manage changes to configuration files across package upgrades.
꾸러미와 꾸러미 그룹
꾸러미 검색 중
You can search all RPM package names and summaries by using the following command:
dnf search
term…
설명과 URL이 일치하도록 [option]`all`를 추가합니다.
dnf search all
term…
This command displays the list of matches for each term. For example, to list all packages that match "meld" or "kompare", type:
~]# dnf search meld kompare Loaded plugins: langpacks, presto, refresh-packagekit ============================ N/S Matched: meld =============================== meld.noarch : Visual diff and merge tool python-meld3.x86_64 : HTML/XML templating system for Python =========================== N/S Matched: kompare ============================= komparator.x86_64 : Kompare and merge two folders 이름과 요약만 일치하며, 모든 것을 위해 "모두 검색"을 사용합니다.
꾸러미 나열하기
dnf list and related commands provide information about packages, package groups, and repositories.
All of DNF’s list commands allow you to filter the results by appending one or more glob expressions as arguments. Glob expressions are normal strings of characters which contain one or more of the wildcard characters * (which expands to match any character multiple times) and ? (which expands to match any one character).
glob 표현식으로 결과 필터링
Be careful to escape the glob expressions when passing them as arguments to a dnf command, otherwise the Bash shell will interpret these expressions as pathname expansions, and potentially pass all files in the current directory that match the globs to DNF. To make sure the glob expressions are passed to DNF as intended, either:
DNF searches only package names when using glob expressions. To search for a version of a package, include a dash and part of the version number as follows: ~]# dnf search kernel*-4* 최근 메타자료 만료 점검은 2015년 5월 14일 목요일 23시 23분 51초 (2시간 46분 09초 이전)에서 수행되었습니다. 설치된 꾸러미 kernel.x86_64 4.0.0-1.fc22 @System kernel.x86_64 4.0.2-300.fc22 @System kernel-core.x86_64 4.0.0-1.fc22 @System kernel-core.x86_64 4.0.2-300.fc22 @System [잘린 출력] See Listing all ABRT addons and plug-ins using glob expressions and Listing available packages using a single glob expression with escaped wildcard characters for an example usage of both these methods. |
- dnf list glob_expression…
-
Lists information on installed and available packages matching all glob expressions.
Example 1. Listing all ABRT addons and plug-ins using glob expressionsPackages with various ABRT addons and plug-ins either begin with "abrt-addon-", or "abrt-plugin-". To list these packages, type the following at a shell prompt:
~]# dnf list abrt-addon\* abrt-plugin\* 최근 메타자료 만료 점검은 2015년 5월 25일 월요일 23시 38분 13초 (0시간 14분 36초 이전)에서 수행되었습니다. 설치된 꾸러미 abrt-addon-ccpp.x86_64 2.5.1-2.fc22 @System abrt-addon-coredump-helper.x86_64 2.5.1-2.fc22 @System abrt-addon-kerneloops.x86_64 2.5.1-2.fc22 @System abrt-addon-pstoreoops.x86_64 2.5.1-2.fc22 @System abrt-addon-python.x86_64 2.5.1-2.fc22 @System abrt-addon-python3.x86_64 2.5.1-2.fc22 @System abrt-addon-vmcore.x86_64 2.5.1-2.fc22 @System abrt-addon-xorg.x86_64 2.5.1-2.fc22 @System abrt-plugin-bodhi.x86_64 2.5.1-2.fc22 @System 사용 가능한 꾸러미 abrt-addon-upload-watch.x86_64 2.5.1-2.fc22 fedora
- dnf list all
-
Lists all installed and available packages.
Example 2. Listing all installed and available packages~]# dnf list all 최종 메타자료 만료 점검은 2015년 5월 25일 월요일 23시 38분 13초( 0시간 21분 11초 전에)에서 수행되었습니다. 설치된 꾸러미 NetworkManager.x86_64 1:1.0.2-1.fc22 @System NetworkManager-libnm.x86_64 1:1.0.2-1.fc22 @System PackageKit.x86_64 1.0.6-4.fc22 @System PackageKit-glib.x86_64 1.0.6-4.fc22 @System aajohan-comfortaa-fonts.noarch 2.004-4.fc22 @System abrt.x86_64 2.5.1-2.fc22 @System [잘린 출력]
- dnf list installed
-
Lists all packages installed on your system. The rightmost column in the output lists the repository from which the package was retrieved.
Example 3. Listing installed packages using a double-quoted glob expressionTo list all installed packages that begin with "krb" followed by exactly one character and a hyphen, type:
~]# dnf list installed "krb?-*" 최종 메타자료 만료 점검은 2015년 5월 25일 월요일 23시38분13초 (0시34분45초 이전)에 수행되었습니다. 설치된 꾸러미 krb5-libs.x86_64 1.13.1-3.fc22 @System krb5-workstation.x86_64 1.13.1-3.fc22 @System
- dnf list available
-
Lists all available packages in all enabled repositories.
Example 4. Listing available packages using a single glob expression with escaped wildcard charactersTo list all available packages with names that contain "gstreamer" and then "plugin", run the following command:
~]# dnf list available gstreamer\*plugin\* 최종 메타자료 만료 점검은 2015년 5월 26일 월요일 23시38분13초 (0시42분15초 이전)에 수행되었습니다. 사용 가능한 꾸러미 gstreamer-plugin-crystalhd.i686 3.10.0-8.fc22 fedora gstreamer-plugin-crystalhd.x86_64 3.10.0-8.fc22 fedora gstreamer-plugins-bad-free.i686 0.10.23-24.fc22 fedora gstreamer-plugins-bad-free.x86_64 0.10.23-24.fc22 fedora gstreamer-plugins-bad-free-devel.i686 0.10.23-24.fc22 fedora gstreamer-plugins-bad-free-devel.x86_64 0.10.23-24.fc22 fedora [잘린 출력]
- dnf group list
-
Lists all package groups.
Example 5. Listing all package groups~]# dnf group list 적재된 플러그인: langpacks, presto, refresh-packagekit 그룹 처리 설정 설치된 그룹: 관리 도구 디자인 제품군 전화-접속 네트워킹 지원 폰트 그놈 데스크탑 환경 [잘린 출력]
- dnf repolist
-
Lists the repository ID, name, and number of packages it provides for each enabled repository.
Example 6. Listing enabled repositories~]# dnf repolist 최종 메타자료 만료 점검은 2015년 5월 25일 월요일 23시 38분 13초( 0시48분29초 이전)에 수행되었습니다. repo id repo name status *fedora Fedora 22 - x86_64 44,762 *updates Fedora 22 - x86_64 - Updates 0
- dnf repository-packages repo_id list
-
Lists the packages from the specified repository.
Example 7. Listing packages from a single repository~]# dnf repository-packages fedora list [option] 최종 메티 자료 점검은 2015년 5월 20일 수요일 22시16분16초에서 1시간38분25초 전에 수행되었습니다. 설치되 꾸러미 PackageKit.x86_64 1.0.6-3.fc22 @System PackageKit-glib.x86_64 1.0.6-3.fc22 @System aajohan-comfortaa-fonts.noarch 2.004-4.fc22 @System [잘린 출력]
The default action is to list all packages available and installed from the repository specified. Add the
available
orinstalled
option to list only those packages available or installed from the specified repository.
Displaying Package Information
To display information about one or more packages, use a command as follows:
dnf info 꾸러미_이름…
For example, to display information about the abrt package, type:
~]# dnf info abrt Last metadata expiration check: 1:09:44 ago on Tue May 31 06:51:51 2016. Installed Packages Name : abrt Arch : x86_64 Epoch : 0 Version : 2.8.1 Release : 1.fc24 Size : 2.2 M Repo : @System From repo : updates-testing Summary : Automatic bug detection and reporting tool URL : https://abrt.readthedocs.org/ License : GPLv2+ Description : abrt is a tool to help users to detect defects in applications and : to create a bug report with all information needed by maintainer to fix it. : It uses plugin system to extend its functionality.
The dnf info package_name command is similar to the rpm -q --info package_name command, but provides as additional information the name of the DNF repository the RPM package was installed from (look for the From repo:
line in the output). The dnf info command shows only the newest available package if there is a newer version available than the one installed. The dnf repoquery command can show all installed and available packages.
To display information about all available packages, both installed and available from a repository, use a command as follows:
dnf repoquery package_name --info
For example, to display information about the abrt package, type:
~]# dnf repoquery abrt --info 최종 메타자료 만료 점검은 2016년 5월 31일 화요일 06시51분51초 (1시01분44초 이전)에 수행되었습니다. 이름 : abrt 버전 : 2.8.1 출시 : 1.fc24 구조: x86_64 크기 : 2318452 라이센스 : GPLv2+ 원천 RPM : abrt-2.8.1-1.fc24.src.rpm 제작일 : 2016-05-25 08:54 제작 : Fedora Project URL : https://abrt.readthedocs.org/ 요약 : Automatic bug detection and reporting tool 설명 : abrt는 사용자가 응용프로그램의 결함을 감지하고 보수 관리자가 이를 수정하는 데 필요한 모든 정보가 포함된 결점 보고서를 생성합니다. 플러그인 시스템을 사용하여 이를 기능적으로 확장합니다.
See the dnf repoquery usage statement for more options:
~]$ dnf repoquery -h
사용법: dnf [options] COMMAND
잘린 출력
꾸러미 설치하기
DNF allows you to install both a single package and multiple packages, as well as a package group of your choice.
To install a single package and all of its non-installed dependencies, enter a command in the following form:
dnf install 꾸러미_이름
You can also install multiple packages simultaneously by appending their names as arguments:
dnf install package_name package_name…
If you are installing packages on a multilib system, such as an AMD64 or Intel64 machine, you can specify the architecture of the package, as long as it is available in an enabled repository, by appending .arch to the package name. For example, to install the sqlite2 package for i586
, type:
~]# dnf install sqlite2.i586
You can use glob expressions to quickly install multiple similarly-named packages:
~]# dnf install audacious-plugins-\*
In addition to package names and glob expressions, you can also provide file names to dnf install. If you know the name of the binary you want to install, but not its package name, you can give dnf install the path name:
~]# dnf install /usr/sbin/named
dnf then searches through its package lists, finds the package which provides /usr/sbin/named
, if any, and prompts you as to whether you want to install it.
파일을 소유한 꾸러미 찾기
If you know you want to install the package that contains the ~]# dnf provides "*bin/named" Using metadata from Thu Apr 16 13:41:45 2015 (4:23:50 hours old) bind-32:9.10.2-1.fc22.x86_64 : The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) server Repo : @System dnf provides "*/file_name" will find all the packages that contain file_name. |
A package group is similar to a package: it is not useful by itself, but installing one pulls a group of dependent packages that serve a common purpose. A package group has a name and a groupid (GID). The dnf group list -v command lists the names of all package groups, and, next to each of them, their groupid in parentheses. The groupid is always the term in the last pair of parentheses, such as kde-desktop-environment
in the following example:
~]# dnf -v group list kde\* cachedir: /var/cache/dnf/x86_64/22 Loaded plugins: builddep, config-manager, copr, playground, debuginfo-install, download, generate_completion_cache, kickstart, needs-restarting, noroot, protected_packages, Query, reposync, langpacks initialized Langpacks plugin DNF version: 0.6.5 repo: using cache for: fedora not found deltainfo for: Fedora 22 - x86_64 not found updateinfo for: Fedora 22 - x86_64 repo: using cache for: updates-testing repo: using cache for: updates not found updateinfo for: Fedora 22 - x86_64 - Updates Using metadata from Thu Apr 16 13:41:45 2015 (4:37:51 hours old) Available environment groups: KDE Plasma Workspaces (kde-desktop-environment)
You can install a package group by passing its full group name (without the groupid part) to group install:
dnf group install group_name
여러-단어로 된 이름은 따옴표로 묶어야 합니다.
당신은 또한 groupid로 설치 할 수 있습니다:
dnf group install
groupid
You can even pass the groupid, or quoted name, to the install command if you prepend it with an @-symbol (which tells dnf that you want to perform a group install):
dnf install
@group
For example, the following are alternative but equivalent ways of installing the KDE Plasma Workspaces
group:
~]# dnf group install "KDE Plasma Workspaces" ~]# dnf group install kde-desktop-environment ~]# dnf install @kde-desktop-environment
꾸러미 제거하기
Similarly to package installation, DNF allows you to uninstall (remove in RPM and DNF terminology) both individual packages and a package group.
To uninstall a particular package, as well as any packages that depend on it, run the following command as root
:
dnf remove 꾸러미_이름…
As when you install multiple packages, you can remove several at once by adding more package names to the command. For example, to remove totem, rhythmbox, and sound-juicer, type the following at a shell prompt:
~]# dnf remove totem rhythmbox sound-juicer
Similar to install, remove can take these arguments:
-
꾸러미 이름
-
glob 표현
-
파일 목록
-
꾸러미 제공
Removing a package when other packages depend on it
DNF is not able to remove a package without also removing packages which depend on it. This type of operation can only be performed by RPM, is not advised, and can potentially leave your system in a non-functioning state or cause applications to misbehave and terminate unexpectedly. For further information, refer to Uninstalling Packages in the RPM chapter. |
You can remove a package group using syntax congruent with the install syntax:
dnf group remove
group
dnf remove
@group
The following are alternative but equivalent ways of removing the KDE Plasma Workspaces
group:
~]# dnf group remove "KDE 플래즈마 웍스페이스" ~]# dnf group remove kde-desktop-environment ~]# dnf remove @kde-desktop-environment
트랜잭션 내역 작업
The dnf history command allows users to review information about a timeline of DNF transactions, the dates and times on when they occurred, the number of packages affected, whether transactions succeeded or were aborted, and if the RPM database was changed between transactions. Additionally, this command can be used to undo or redo certain transactions.
To display a list of all transactions, as root
, either run dnf history with no additional arguments, or enter the following command:
dnfhistory
list
To display only transactions in a given range, use the command in the following form:
dnf history list start_id..end_id
You can also list only transactions regarding a particular package or packages. To do so, use the command with a package name or a glob expression:
dnf history list glob_expression…
For example, the list of first five transactions may look as follows:
~]# dnf history list 1..4 Using metadata from Thu Apr 16 13:41:45 2015 (5:47:31 hours old) ID | Login user | Date a | Action | Altere ------------------------------------------------------------------------------- 4 | root <root> | 2015-04-16 18:35 | Erase | 1 3 | root <root> | 2015-04-16 18:34 | Install | 1 2 | root <root> | 2015-04-16 17:53 | Install | 1 1 | System <unset> | 2015-04-16 14:14 | Install | 668 E
The dnf history list command produces tabular output with each row consisting of the following columns:
-
ID
— an integer value that identifies a particular transaction. -
Login user
— the name of the user whose login session was used to initiate a transaction. This information is typically presented in theFull Name <username>
form, however sometimes the command used to perform the transaction is displayed. For transactions that were not issued by a user (such as an automatic system update),System <unset>
is used instead. -
Date and time
— the date and time when a transaction was issued. -
Action(s)
— a list of actions that were performed during a transaction as described in Possible values of the Action(s) field. -
Altered
— the number of packages that were affected by a transaction, possibly followed by additional information.
[options="header"] |
Action |
Abbreviation |
Description |
|
|
At least one package has been downgraded to an older version. |
|
|
At least one package has been removed. |
|
|
At least one new package has been installed. |
|
|
At least one package has been marked as obsolete. |
|
|
At least one package has been reinstalled. |
|
|
At least one package has been updated to a newer version. |
Apart from reviewing the transaction history, the dnf history command provides means to revert or repeat a selected transaction. To revert a transaction, type the following at a shell prompt as root
:
dnfhistory
undo
id
To repeat a particular transaction, as root
, run the following command:
dnfhistory
redo
id
Both commands also accept the last
keyword to undo or repeat the latest transaction.
Note that both dnf history undo and dnf history redo commands merely revert or repeat the steps that were performed during a transaction, and will fail if the required packages are not available. For example, if the transaction installed a new package, the dnf history undo command will uninstall it and also attempt to downgrade all updated packages to their previous version, but the command will fail if the required packages are not available.
Configuring DNF and DNF Repositories
The configuration file for DNF and related utilities is located at /etc/dnf/dnf.conf
. This file contains one mandatory [main]
section, which allows you to set DNF options that have global effect, and may also contain one or more [repository]
sections, which allow you to set repository-specific options. However, it is recommended to define individual repositories in new or existing .repo
files in the /etc/yum.repos.d/
directory. The values you define in individual [repository]
sections of the /etc/dnf/dnf.conf
file override values set in the [main]
section.
This section shows you how to:
-
set global DNF options by editing the
[main]
section of the/etc/dnf/dnf.conf
configuration file; -
set options for individual repositories by editing the
[repository]
sections in/etc/dnf/dnf.conf
and.repo
files in the/etc/yum.repos.d/
directory; -
use DNF variables in
/etc/dnf/dnf.conf
and files in the/etc/yum.repos.d/
directory so that dynamic version and architecture values are handled correctly; -
add, enable, and disable DNF repositories on the command line; and,
-
set up your own custom DNF repository.
Setting [main] Options
options] The /etc/dnf/dnf.conf
configuration file contains exactly one [main]
section, and while some of the key-value pairs in this section affect how dnf operates, others affect how DNF treats repositories.
You can add many additional options under the [main]
section heading in /etc/dnf/dnf.conf
.
A sample /etc/dnf/dnf.conf
configuration file can look like this:
[main] gpgcheck=1 installonly_limit=3 clean_requirements_on_remove=true
The following are the most commonly-used options in the [main]
section:
디버그수준
=값-
…where value is an integer between
0
and10
. Setting a higherdebuglevel
value causes dnf to display more detailed debugging output.debuglevel=0
disables debugging output, anddebuglevel=2
is the default. exclude
=package_name more_package_names-
This option allows you to exclude packages by keyword during installation and updates. Listing multiple packages for exclusion can be accomplished by quoting a space-delimited list of packages. Shell globs using wildcards (for example,
*
and?
) are allowed. gpg확인
=값-
…여기서_값은 다음 중 하나입니다:
0
— Disable GPG signature-checking on packages in all repositories, including local package installation.1
— Enable GPG signature-checking on all packages in all repositories, including local package installation.gpgcheck=1
is the default, and thus all packages' signatures are checked.If this option is set in the
[main]
section of the/etc/dnf/dnf.conf
file, it sets the GPG-checking rule for all repositories. However, you can also setgpgcheck=value
for individual repositories instead; you can enable GPG-checking on one repository while disabling it on another. Settinggpgcheck=value
for an individual repository in its corresponding.repo
file overrides the default if it is present in/etc/dnf/dnf.conf
.For more information on GPG signature-checking, refer to Checking Package Signatures.
installonlypkgs
=space separated list of packages-
Here you can provide a space-separated list of packages which dnf can install, but will never update. See the dnf.conf(5) manual page for the list of packages which are install-only by default.
If you add the
installonlypkgs
directive to/etc/dnf/dnf.conf
, you should ensure that you list all of the packages that should be install-only, including any of those listed under theinstallonlypkgs
section of dnf.conf(5). In particular, kernel packages should always be listed ininstallonlypkgs
(as they are by default), andinstallonly_limit
should always be set to a value greater than2
so that a backup kernel is always available in case the default one fails to boot.
설치만_제한
=값-
…where value is an integer representing the maximum number of versions that can be installed simultaneously for any single package listed in the
installonlypkgs
directive.The defaults for the
installonlypkgs
directive include several different kernel packages, so be aware that changing the value ofinstallonly_limit
will also affect the maximum number of installed versions of any single kernel package. The default value listed in/etc/dnf/dnf.conf
isinstallonly_limit=3
, and it is not recommended to decrease this value, particularly below2
. 캐쉬유지
=값-
…여기서_값은 다음 중 하나입니다:
0
— Do not retain the cache of headers and packages after a successful installation. This is the default.1
— Retain the cache after a successful installation.
For a complete list of available [main]
options, refer to the [MAIN] OPTIONS
section of the dnf.conf(5) manual page.
Setting [repository] Options
options] The [repository]
sections, where repository is a unique repository ID such as my_personal_repo
(spaces are not permitted), allow you to define individual DNF repositories.
The following is a bare-minimum example of the form a [repository]
section takes:
[repository] name=repository_name baseurl=repository_url
Every [repository]
section must contain the following directives:
name
=저장소_이름-
…where repository_name is a human-readable string describing the repository.
- parameter=저장소_url
-
…where parameter is one of the following:
baseurl
,metalink
, ormirrorlist
;…where repository_url is a URL to a directory containing a
repodata
directory of a repository, a metalink file, or a mirror list file.-
만약 저장소가 HTTP를 통해 사용 가능하다면, 다음을 사용하세요:
http://path/to/repo
-
만약 저장소가 FTP를 통해 사용 가능하다면, 다음을 사용하세요:
ftp://path/to/repo
-
만약 저장소가 로컬 장비라면, 다음을 사용하세요:
file:///path/to/local/repo
-
If a specific online repository requires basic HTTP authentication, you can specify your user name and password by prepending it to the URL as
username:password@link
. For example, if a repository on http://www.example.com/repo/ requires a username of "user" and a password of "password", then thebaseurl
link could be specified ashttp://user:password@www.example.com/repo/
.일반적으로 이와 같은 URL은 다음과 같은 HTTP 연결입니다:
baseurl=http://path/to/repo/releases/$releasever/server/$basearch/os/
Note that DNF always expands the
$releasever
,$arch
, and$basearch
variables in URLs. For more information about DNF variables, refer to Using DNF Variables.
-
To configure the default set of repositories, use the enabled
option as follows:
활성화됨
=값-
…여기서_값은 다음 중 하나입니다:
0
— Do not include this repository as a package source when performing updates and installs.1
— Include this repository as a package source.Turning repositories on and off can also be performed by passing either the
--set-enabled repo_name
or--set-disabled repo_name
option to the dnf command, or through theAdd/Remove Software
window of the PackageKit utility.
Many more [repository]
options exist. For a complete list, refer to the [repository] OPTIONS
section of the dnf.conf(5) manual page.
DNF 변수 사용하기
Variables can be used only in the appropriate sections of the DNF configuration files, namely the /etc/dnf/dnf.conf
file and all .repo
files in the /etc/yum.repos.d/
directory. Repository variables include:
$releasever
-
Refers to the release version of operating system which DNF derives from information available in RPMDB.
$arch
-
Refers to the system’s CPU architecture. Valid values for
$arch
include:i586
,i686
andx86_64
. $basearch
-
Refers to the base architecture of the system. For example, i686 and i586 machines both have a base architecture of
i386
, and AMD64 and Intel64 machines have a base architecture ofx86_64
.
Viewing the Current Configuration
To list all configuration options and their corresponding values, and the repositories, execute the dnf config-manager command with the --dump
option:
~]$ dnf config-manager --dump =============================== main ====================================== [main] alwaysprompt = True assumeno = False assumeyes = False bandwidth = 0 best = False bugtracker_url = https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=dnf cachedir = /var/cache/dnf/x86_64/22 [output truncated]
Adding, Enabling, and Disabling a DNF Repository
Setting [repository Options] describes various options you can use to define a DNF repository. This section explains how to add, enable, and disable a repository by using the dnf config-manager command.
To define a new repository, you can either add a [repository]
section to the /etc/dnf/dnf.conf
file, or to a .repo
file in the /etc/yum.repos.d/
directory. All files with the .repo
file extension in this directory are read by DNF, and it is recommended to define your repositories here instead of in /etc/dnf/dnf.conf
.
DNF repositories commonly provide their own .repo
file. To add such a repository to your system and enable it, run the following command as root
:
dnf config-manager --add-repo repository_url
…where repository_url is a link to the .repo
file.
To add a repository located at http://www.example.com/example.repo, type the following at a shell prompt:
~]# dnf config-manager --add-repo http://www.example.com/example.repo adding repo from: http://www.example.com/example.repo
To enable a particular repository or repositories, type the following at a shell prompt as root
:
dnf config-manager --set-enabled
repository…
…where repository is the unique repository ID. To display the current configuration, add the --dump
option.
To disable a DNF repository, run the following command as root
:
dnf config-manager --set-disabled
repository…
…where repository is the unique repository ID. To display the current configuration, add the --dump
option.
추가 자원
.설치된 문서
-
dnf(8)
— The DNF command reference manual page. -
dnf.conf(8)
— DNF Configuration Reference manual page.
- YUM 대체 DNF
-
DNF 위키는 더 많은 설명서를 포함합니다.
Want to help? Learn how to contribute to Fedora Docs ›