Skip to content

Common command line options

Oliver Kurth edited this page Mar 16, 2023 · 10 revisions

Common command line options

--alldeps

Only valid together with --downloadonly (see below). Downloads all dependencies for a package, regardless whether they are installed.

--allowerasing

Allow removing of packages when resolving.

--assumeyes, -y

Answer y (yes) yo all questions, for non-interactive invocations of tdnf.

--best

Insist on installing the latest version of a package when upgrading. Fail if that is not possible. Otherwise, tdnf would use the next best version.

--builddeps

When given with the install command, download and install the build dependencies instead of the binary package. See also the --source option.

--cacheonly, -C

Do not download metadata and use the cached metadata instead, even if expired.

--config file, -c file

Use an alternative configuration file.

--disableexcludes

Disable excludes, regardless of the excludes option in the configuration file.

--disablerepo=pattern

Disable one or more repositories. Can be set to a repoid or a pattern. Can be used together with --enablerepo, but is mutually exclusive with --repo/--repoid. For example: tdnf --disablerepo=* --enablerepo=photon list.

--downloaddir=directory

Can only be used together with --downloadonly. Specifies a directory where to download packages. If not given, the cache directory is used.

--downloadonly

Packages will only be downloaded and not installed. By default, these will be downloaded to the cache directory, or as specified with --downloaddir.

--enablerepo=pattern

Enable one or more repositories. Can be set to a repoid or a pattern. See above for --disablerepo. Mutually exclusive with --repo/--repoid.

--exclude=package1[,package2[...]]

A list of packages to be excluded from operations.

--help

Prints out basic usage information.

--installroot=directory

Packages will be installed relative to this directory.

Unless specified with -c or --config, tdnf will use the configuration file under this directory in etc/tdnf/tdnf.conf if present, otherwise it uses the file /etc/tdnf/tdnf.conf in the host. Similar for the repository configurations. The cache directory will be relative to the installroot and created if necessary.

--json, -j

Output information in json format. Calling tdnf with its alias tdnfj makes it behave as if called with tdnf -j -y.

--noautoremove

Don't automatically remove orphaned dependencies, regardless of the clean_requirements_on_remove option.

--nogpgcheck

Do not verify gpg signatures of packages.

--quiet

Minimize output messages.

--repofromdir=repoid,directory

Add a repository from a directory without metadata. Similar to --repofrompath, but without repodata.

Example: tdnf repofrompath=local,/usr/src/photon/RPMS --repoid=local install lsof to install packages from usr/src/photon/RPMS (there is no need to call createrepo /usr/src/photon/RPMS).

Note that this is not efficient for large repositories, in which case --repofrompath should be used.

--repofrompath=repoid,baseurl

Add a repository with the id repoid and the baseurl baseurl. This is equivalent to adding a repository with the repoid and the baseurl. The repository can be referenced with the id, for example with --repoid.

Example: tdnf repofrompath=local,file:///usr/src/photon/RPMS --repoid=local install lsof to install packages from usr/src/photon/RPMS (after calling createrepo /usr/src/photon/RPMS).

Can be used multiple times to add multiple repositories.

--repoid id, --repo id

Select a particular repository by its id. For example --repoid=photon is equivalent to --disablerepo=* --enablerepo=photon. Can be specified multiple times.

--releasever

Specify the release version of the distribution. By default this will be taken from the package that provides system-release (unless otherwise configured), if installed. Setting this is useful to install when using --installroot.

--source

When given with the install command, download and install the source package instead of the binary package. See also the --builddeps option.

--skip-broken

Skip failures for example if a package is not available or has broken dependencies.

--testonly

Test rpm transactions only but do not do any install.

--version

Display the tdnf version.