apt-get -f install 和 apt-get update

时间:2022-04-30 12:46:01
$sudo apt-get install rpm
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 rpm : Depends: librpm2 (>= 4.9.0) but it is not going to be installed
       Depends: librpmbuild2 (>= 4.9.0) but it is not going to be installed
       Depends: librpmio2 (>= 4.9.0) but it is not going to be installed
       Depends: librpmsign0 (>= 4.9.0) but it is not going to be installed
       Depends: rpm2cpio
       Depends: rpm-common (= 4.9.1.1-1ubuntu0.2) but it is not going to be installed
 wps-office:i386 : Depends: libfreetype6:i386 (>= 2.4) but it is not going to be installed
                   Depends: libglu1-mesa:i386 but it is not going to be installed
                   Depends: libcups2:i386 but it is not going to be installed
                   Recommends: ttf-mscorefonts-installer:i386

E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).


$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  libdrm-nouveau2:i386 libxcb-dri2-0:i386 libtxc-dxtn-s2tc0:i386 libxrandr-ltsr2 libllvm3.2 libllvm3.2:i386
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libavahi-client3:i386 libavahi-common-data:i386 libavahi-common3:i386 libcomerr2:i386 libcups2:i386 libdbus-1-3:i386 libfreetype6:i386
  libgcrypt11:i386 libglu1-mesa:i386 libgnutls26:i386 libgpg-error0:i386 libgssapi-krb5-2:i386 libk5crypto3:i386 libkeyutils1:i386
  libkrb5-3:i386 libkrb5support0:i386 libp11-kit0:i386 libtasn1-3:i386
Suggested packages:
  cups-common:i386 rng-tools:i386 gnutls-bin:i386 krb5-doc:i386 krb5-user:i386
The following NEW packages will be installed:
  libavahi-client3:i386 libavahi-common-data:i386 libavahi-common3:i386 libcomerr2:i386 libcups2:i386 libdbus-1-3:i386 libfreetype6:i386
  libgcrypt11:i386 libglu1-mesa:i386 libgnutls26:i386 libgpg-error0:i386 libgssapi-krb5-2:i386 libk5crypto3:i386 libkeyutils1:i386
  libkrb5-3:i386 libkrb5support0:i386 libp11-kit0:i386 libtasn1-3:i386
0 upgraded, 18 newly installed, 0 to remove and 9 not upgraded.
1 not fully installed or removed.
Need to get 2,382 kB of archives.
After this operation, 6,530 kB of additional disk space will be used.
Do you want to continue [Y/n]? 



$ sudo apt-get install rpm
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libdrm-nouveau2:i386 libxcb-dri2-0:i386 libtxc-dxtn-s2tc0:i386 libxrandr-ltsr2 libllvm3.2 libllvm3.2:i386
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  librpm2 librpmbuild2 librpmio2 librpmsign0 rpm-common rpm2cpio
Suggested packages:
  alien elfutils rpm-i18n
The following NEW packages will be installed:
  librpm2 librpmbuild2 librpmio2 librpmsign0 rpm rpm-common rpm2cpio
0 upgraded, 7 newly installed, 0 to remove and 9 not upgraded.
Need to get 528 kB of archives.
After this operation, 1,689 kB of additional disk space will be used.




$ rpm
RPM version 4.9.1.1
Copyright (C) 1998-2002 - Red Hat, Inc.
This program may be freely redistributed under the terms of the GNU GPL


Usage: rpm [-afgpcdlsiv?] [-a|--all] [-f|--file] [-g|--group] [-p|--package] [--pkgid] [--hdrid] [--triggeredby] [--whatrequires]
        [--whatprovides] [--nomanifest] [-c|--configfiles] [-d|--docfiles] [--dump] [-l|--list] [--queryformat=QUERYFORMAT] [-s|--state]
        [--nofiledigest] [--nofiles] [--nodeps] [--noscript] [--allfiles] [--allmatches] [--badreloc] [-e|--erase=<package>+]
        [--excludedocs] [--excludepath=<path>] [--force] [--force-debian] [-F|--freshen=<packagefile>+] [-h|--hash] [--ignorearch]
        [--ignoreos] [--ignoresize] [-i|--install] [--justdb] [--nodeps] [--nofiledigest] [--nocontexts] [--noorder] [--noscripts]
        [--notriggers] [--nocollections] [--oldpackage] [--percent] [--prefix=<dir>] [--relocate=<old>=<new>] [--replacefiles]
        [--replacepkgs] [--test] [-U|--upgrade=<packagefile>+] [-D|--define='MACRO EXPR'] [-E|--eval='EXPR'] [--macros=<FILE:...>]
        [--nodigest] [--nosignature] [--rcfile=<FILE:...>] [-r|--root=ROOT] [--dbpath=DIRECTORY] [--querytags] [--showrc] [--quiet]
        [-v|--verbose] [--version] [-?|--help] [--usage] [--scripts] [--setperms] [--setugids] [--conflicts] [--obsoletes]
        [--provides] [--requires] [--info] [--changelog] [--xml] [--triggers] [--last] [--dupes] [--filesbypkg] [--fileclass]
        [--filecolor] [--fscontext] [--fileprovide] [--filerequire] [--filecaps]




--------------------------------------------------------------------------------------------------------------------------------------------

 apt-get - APT package handling utility 


-f, --fix-broken
           Fix; attempt to correct a system with broken dependencies in place. This option, when used with install/remove, can omit any
           packages to permit APT to deduce a likely solution. If packages are specified, these have to completely correct the problem. The
           option is sometimes necessary when running APT for the first time; APT itself does not allow broken package dependencies to
           exist on a system. It is possible that a system's dependency structure can be so corrupt as to require manual intervention
           (which usually means using dselect(1) or dpkg --remove to eliminate some of the offending packages). Use of this option together
           with -m may produce an error in some situations. Configuration Item: APT::Get::Fix-Broken.



---------------------------------------------------------------------------------------------------------------------------------------------------------------

 apt-get update

update
           update is used to resynchronize the package index files from their sources. The indexes of available packages are fetched from
           the location(s) specified in /etc/apt/sources.list. For example, when using a Debian archive, this command retrieves and scans
           the Packages.gz files, so that information about new and updated packages is available. An update should always be performed
           before an upgrade or dist-upgrade. Please be aware that the overall progress meter will be incorrect as the size of the package
           files cannot be known in advance.