Apt get dist upgrade что делает
Перейти к содержимому

Apt get dist upgrade что делает

  • автор:

What is Apt-get upgrade and dist-upgrade commands and how to use them

If we talk about updating the packages, Linux operating systems come with a lot of free software updates for each package. It continuously releases the updates, patches, and fixes in order to improve the performance and fix bugs in them. It is very important to regularly check for these updates and install them in order to safeguard the system against potential threats and vulnerabilities. For installation of these updates, upgrade is performed and there are two ways to achieve this: one is apt-get upgrade and the second one is apt-get dist-upgrade. There is some difference between these two ways that often confuse users. This article will help you to understand and differentiate the apt-get upgrade and apt-get dist-upgrade.

Upgrading Package Database

To keep your system up to date, update and upgrade commands are used. The update command only updates the package list with the latest available versions, however, it does not install or upgrade the package. The upgrade command actually upgrades and installs the latest versions of packages that are already installed. Before going to upgrade the packages, check for the updates as follows. It will let the apt-get to know the new versions available.

What is Apt-get upgrade

To install the latest versions of all the previously installed packages on your system, apt-get upgrade is used. This command only upgrades the packages which have a new release available as stated in the sources.list file in the “/etc/apt” folder. It does not attempt to install a new package or remove any installed package on its own.

To upgrade or install the latest versions, run the following command as sudo as an only privilege user can check for and install updates on the Linux system:

To upgrade a specific package, command is as follows:

What is Apt-get dist-upgrade

Similar to apt-get upgrade command, the apt-get dist-upgrade also upgrades the packages. In addition to this, it also handles changing dependencies with the latest versions of the package. It intelligently resolves the conflict among package dependencies and tries to upgrade the most significant packages at the expense of less significant ones, if required. Unlike apt-get upgrade command, the apt-get dist-upgrade is proactive and it installs new packages or removes existing ones on its own in order to complete the upgrade.

In order to upgrade the packages, run the dist-upgrade command with sudo privileges:

To upgrade a specific package, command is as follows:

Sometimes, when you run apt-get upgrade, you receive the message “The following packages have been kept back”. These packages are kept back because in order to install their new version, they need some other package which is not already installed. And as we have discussed, the apt-get upgrade only upgrades the existing packages, neither installs a new package or removes an existing one. That is why it keeps these packages back. Sometimes, the packages are also kept back because of broken dependencies (when the package which it depends on does not have a downloadable version).

While with apt-get dist-upgrade, the new dependent package will be installed to resolve the dependency.

To conclude, if you want to only upgrade the packages without installing or removing them, go for the apt-get upgrade. On the other hand, if you want to upgrade no matter whether any new package is installed or the existing package is removed to fulfill dependencies, go for apt-get dist-upgrade.

About the author

Karim Buzdar

Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. He blogs at LinuxWays.

DESCRIPTION¶

Unless the -h, or —help option is given, one of the commands below must be present.

dist-upgrade

dselect-upgrade

A specific version of a package can be selected for installation by following the package name with an equals and the version of the package to select. This will cause that version to be located and selected for install. Alternatively a specific distribution can be selected by following the package name with a slash and the version of the distribution or the Archive name (stable, testing, unstable).

Both of the version selection mechanisms can downgrade packages and must be used with care.

This is also the target to use if you want to upgrade one or more already-installed packages without upgrading every package you have on your system. Unlike the "upgrade" target, which installs the newest version of all currently installed packages, "install" will install the newest version of only the package(s) specified. Simply provide the name of the package(s) you wish to upgrade, and if a newer version is available, it (and its dependencies, as described above) will be downloaded and installed.

Finally, the apt_preferences(5) mechanism allows you to create an alternative installation policy for individual packages.

If no package matches the given expression and the expression contains one of '.', '?' or '*' then it is assumed to be a POSIX regular expression, and it is applied to all package names in the database. Any matches are then installed (or removed). Note that matching is done by substring so 'lo.*' matches 'how-lo' and 'lowest'. If this is undesired, anchor the regular expression with a '^' or '$' character, or create a more specific regular expression.

The arguments are interpreted as binary and source package names. See the —only-source option if you want to change that.

Source packages are tracked separately from binary packages via deb-src lines in the sources.list(5) file. This means that you will need to add such a line for each repository you want to get sources from; otherwise you will probably get either the wrong (too old/too new) source versions or none at all.

If the —compile option is specified then the package will be compiled to a binary .deb using dpkg-buildpackage for the architecture as defined by the —host-architecture option. If —download-only is specified then the source package will not be unpacked.

A specific source version can be retrieved by postfixing the source name with an equals and then the version to fetch, similar to the mechanism used for the package files. This enables exact matching of the source package name and version, implicitly enabling the APT::Get::Only-Source option.

Note that source packages are not installed and tracked in the dpkg database like binary packages; they are simply downloaded to the current directory, like source tarballs.

The arguments are interpreted as binary or source package names. See the —only-source option if you want to change that.

autoclean (and the auto-clean alias since 1.1)

autoremove (and the auto-remove alias since 1.1)

indextargets

OPTIONS¶

—no-install-recommends

—install-suggests

-d, —download-only

-f, —fix-broken

-m, —ignore-missing, —fix-missing

-q, —quiet

-s, —simulate, —just-print, —dry-run, —recon, —no-act

Simulated runs print out a series of lines, each representing a dpkg operation: configure (Conf), remove (Remv) or unpack (Inst). Square brackets indicate broken packages, and empty square brackets indicate breaks that are of no consequence (rare).

-y, —yes, —assume-yes

—no-show-upgraded

-V, —verbose-versions

-a, —host-architecture

-P, —build-profiles

-b, —compile, —build

—with-new-pkgs

—only-upgrade

—allow-downgrades

—allow-remove-essential

—allow-change-held-packages

—list-cleanup

-t, —target-release, —default-release

—trivial-only

—auto-remove, —autoremove

—diff-only, —dsc-only, —tar-only

—allow-unauthenticated

—no-allow-insecure-repositories

—allow-releaseinfo-change

Specialist options (—allow-releaseinfo-change-field) exist to allow changes only for certain fields like origin, label, codename, suite, version and defaultpin. See also apt_preferences(5). Configuration Item: Acquire::AllowReleaseInfoChange.

Package management with APT

IconsPage/apt.pngPackage management via apt-get runs hand-in-hand with the /etc/apt/sources.list file. For information on editing or updating your sources list see SourcesList.

Introduction

This page describes how to handle the packages on your system using apt-get and related commands. For example, you can install a new package, remove an installed package, or update all installed packages to the latest versions.

Commands

Installation commands

    This command installs a new package.
auto-apt

Maintenance commands

Removal commands

  • This command removes an installed package, leaving configuration files intact.
  • This command completely removes a package and the associated configuration files. Configuration files residing in
  • This command removes an installed package and dependencies.

Search commands

This command determines which installed package owns <package_name>. It shows files from installed packages that match <package_name>, with the name of the package they came from. Consider this to be a «reverse lookup» utility.

Typical usage example

I want to feel the wind in my hair, I want the adrenaline of speed. So let’s install a racing game. But what racing games are available?

It gives me a lot of answers. I see a game named «torcs». Let’s get some more information on this game.

Hmmm. it seems interesting. But is this game not already installed on my computer? And what is the available version? Which repository is it from (Universe or Main)?

Ok, so now, let’s install it!

What is the command I must type in the console to launch this game? In this example, it’s straightforward («torcs»), but that’s not always the case. One way of finding the name of the binary is to look at what files the package has installed in «/usr/bin». For games, the binary will be in «/usr/games». For administrative programs, it’s in «/usr/sbin».

The first part of the command display all files installed by the package «torcs» (try it). With the second part, we ask to only display lines containing «/usr/games/».

Hmmm, that game is cool. Maybe there are some extra tracks?

But I’m running out of space. I will delete the apt cache!

Oh no, my mother asked me to remove all games from this computer. But I want to keep the configuration files so I can simply re-install it later.

If I want to also remove config files :

Setting up apt-get to use a http-proxy

These are three methods of using apt-get with a http-proxy.

Temporary proxy session

This is a temporary method that you can manually use each time you want to use apt-get through a http-proxy. This method is useful if you only want to temporarily use a http-proxy.

Enter this line in the terminal prior to using apt-get (substitute your details for yourproxyaddress and proxyport).

If you normally use sudo to run apt-get you will need to login as root first for this to work unless you also add some explicit environment settings to /etc/sudoers, e.g.

APT configuration file method

This method uses the apt.conf file which is found in your /etc/apt/ directory. This method is useful if you only want apt-get (and not other applications) to use a http-proxy permanently.

Add this line to your /etc/apt/apt.conf file (substitute your details for yourproxyaddress and proxyport).

Save the apt.conf file.

BASH rc method

This method adds a two lines to your .bashrc file in your $HOME directory. This method is useful if you would like apt-get and other applications for instance wget, to use a http-proxy.

Add these lines to the bottom of your

/.bashrc file (substitute your details for yourproxyaddress and proxyport)

Save the file. Close your terminal window and then open another terminal window or source the

Test your proxy with sudo apt-get update and whatever networking tool you desire. You can use firestarter or conky to see active connections.

If you make a mistake and go back to edit the file again, you can close the terminal and reopen it or you can source

/.bashrc as shown above.

How to login a proxy user

If you need to login to the Proxy server this can be achieved in most cases by using the following layout in specifying the proxy address in http-proxy. (substitute your details for username, password, yourproxyaddress and proxyport)

Среда Linux

Коллекция материалов по работе с системой Linux С наступающим Новым годом!

Страницы

  • Главная страница
  • Оглавление
  • О блоге
  • Контакты
  • Он-лайн ТВ
  • Онлайн Радио

пятница, 13 марта 2015 г.

Как правильно обновлять систему через терминал в Ubuntu подобных системах

Также можно обратиться к мануалу в системе (если знаете английский язык):

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *