Linux Package Management
Repositories
Repositories hold collections of software packages and related information, including headers that describe each package and provide information on other packages the package depends on. Typically, a Linux distribution maintains repositories for each of its releases.
The apt-get utility selects packages from repositories it searches based on the categories specified in the sources.list configuration file located under etc/apt/. This file has the list of repositories for aptget to search when you ask it to find or install a package.
Each line in sources.list describes one repository and has the following syntax:
type URI repository category-list
where type _is deb for packages of executable files and deb-src for packages of source files; [URI](https://www.safaribooksonline.com/library/view/a-practical-guide/9780133085129/gloss01.html#gloss01_557) is the location of the repository, usually cdrom or an Internet address that starts with http://;repository is the name of the repository apt-get is to search; and category-list _is a SPACE-separated list of categories apt-get selects packages from. Comments begin with a pound sign (#) anywhere on a line and end at the end of the line.
For e.g. deb http://us.archive.ubuntu.com/ubuntu/ precise main restricted multiverse
causes apt-get to search the archive located at us.archive.ubuntu.com/ubuntu for deb packages that contain executable files. It accepts packages that are categorized as main, restricted and multiverse.
APTGET
apt-get
apt-get [options] command [package...]
Options:
autoremove
Remove packages that were automatically installed to satisfy a dependency and are no longer needed.
clean
Clear the local repository of retrieved package files. Useful for freeing up disk space.
check
Update the package cache and check for broken dependencies.
install packages
Install one or more packages. Specify the package name, not the full filename. Other required packages are also retrieved and installed. With a hyphen appended to the package name, the package is removed if it is already installed. Select a version to install by appending an equals sign and the version. Select a distribution to install by appending a slash and the distribution.
purge packages
Like remove, but not only removes the package, but also all of its configuration files.
remove packages
Remove one or more packages. Specify the package name, not the full filename. With a plus sign appended to the name, the package is installed.
update
Resynchronize the package overview files from their sources. Must be done before anupgradeordist-upgrade.
upgrade
Install the latest versions of all packages currently installed (it will not install any new packages but just upgrade existing packages). Run update first.
dist-upgrade
to upgrade all packages, including packages that depend on packages that are not installed. This command also installs dependencies. If a new version of the operating system is available, this option upgrades to the new version.
Yum Package Manager
remove package names
Removes one or more packages.