dnf

 

'@anaconda' means that the package was installed by the Anaconda installer.

 

  1. dnf upgrade --repo update* --exclude kernel*

     

  2. 下载源码rpm包
    dnf download --source crun

     

     

  3. 查看使用的mirror
    dnf download --url glx-utils

     

  4. download specific architecture, 与包名要完全对应, 可先使用dnf info glx-utils查看可以architecture
    dnf download --arch x86_64 glx-utils

     

  5. download debuginfo debugsource 
    dnf download --debuginfo crun
    dnf download --debugsource glx-utils

     

     

  6. find all versions 
    dnf repoquery --show-duplicates docker-ce

     

     

  7. show only results that owns FILE
    dnf repoquery --file /etc/xattr.conf

     

  8. don't install weak dependencies
    dnf install --setopt=install_weak_deps=false --best langpacks-zh_CN

     

/etc/dnf/dnf.conf

[main]
gpgcheck=True
installonly_limit=3
clean_requirements_on_remove=True
best=False
skip_if_unavailable=True
excludepkgs=kernel*

 

 

repo:

[RepositoryID]
name= $releaserver - $arch - $basearch
baseurl=url://server1/path/to/repository/
        url://server2/path/to/repository/
        url://server3/path/to/repository/
enabled=1|0              # default 1
gpgcheck=1|0             # default 1
cost=1000                # default 1000
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
failovermethod=roundrobin|priority
metadata_expire=7d
type=rpm
skip_if_unavailable=False

 

dnf repolist [all|enabled|disabled]
dnf list all [glob_exp]
dnf list available [glob_exp]                list available and installed
dnf list updates [glob_exp]                  list updates available in dnf repository
dnf list installed [glob_exp]                  list installed packeges
dnf list extras [glob_exp]                      list installed but are not available in dnf repository
dnf reinstall packges
dnf check-update [glob_exp]
dnf clean
dnf makecache
dnf search [all] string        默认只搜索name和summary含有指定string的包
dnf repoquery --deplist package
dnf history subcommand

--nogpgcheck
--disablerepo=
--enablerepo=
--noplugins
--exclude=packge
--skip-broken
--disablerepo="*" --enablerepo=epel

 

posted @ 2023-01-25 16:10  ascertain  阅读(173)  评论(0编辑  收藏  举报