How to install debian package debian

How to install debian package debian

3 Commands Line Tools to Install Local Debian Packages

If you are asking yourself “How do I install debian package in Ubuntu or Debian?”, then you have come to the right place.

You can right-click on the downloaded deb packages and select install from the context menu but using a graphical installer can be slow compared to terminal commands. Here’s 3 different command line tools to help you install deb packages. They are dpkg, gdebi and apt.

You use dpkg to install local debian package like below.

dpkg itself can’t solve dependency problem because it does not understand repositories. But you can use the following command to solve it. (-f for fixing broken dependency).

gdebi package installer

gdebi isn’t installed by default on Ubuntu, so you need to install it first.

Then to install a local deb package, use

If there’s a dependency problem, gdebi will automatically install them for you, if these dependency packages are available from software repository.

Normally you would use apt to install packages from online software repositories like below:

Did you know that it can also be used to install local deb packages? This is another reason you should be using apt instead of apt-get, which does not have the ability. You simply change to the directory where the deb package are stored and install it like below.

For instance, to install TeamViewer 12 on Ubuntu 16.04/16.10, first download the TeamViewer deb package to the current directory

Then install it with:

It automatically install dependencies if these dependencies are available from software repository.

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

You need to add ./, which represents the current working directory, in front of the package name so that apt can find the deb package.

I hope this post helped you install local debian packages from the command line. As always, if you found this post useful, then Subscribe to our free newsletter to get latest Linux tutorials. You can also follow us on Google+, Twitter or like our Facebook page.

Установка пакетов Debian

Установка пакетов Debian выполняется, как и в Ubuntu, с помощью пакетного менеджера apt и утилиты dpkg. Мы рассматривали их подробно в статье про установку пакетов Ubuntu. В этой же статье мы более детально остановимся на особенностях Debian.

Установка программ с помощью apt

Перед тем как говорить непосредственно про Debian, нужно рассмотреть apt. Этот пакетный менеджер был специально разработан для Debian и потом стал использоваться в других основанных на нем дистрибутивах. Синтаксис для работы с утилитой такой:

$ sudo apt опции команда имя_пакета

Вот основные команды apt, которые вы можете использовать для управления пакетами:

Кроме того, утилите можно передать некоторые опции, основные:

Таким образом, для установки пакета из репозиториев достаточно набрать:

sudo apt install имя_пакета
$ sudo apt install vlc

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

А для удаления пакета наберите:

sudo apt purge vlc

Вы можете искать пакеты с помощью команды search:

sudo apt search vlc

Но куда более интересны политики управления репозиториями и установка отдельных пакетов из определенных хранилищ. Особенно это актуально для Debian, чтобы не добавлять нестабильный репозиторий полностью, а устанавливать из него только отдельные пакеты. Для решения таких задач существует настройка политики управления репозиториями.

С помощью политик вы можете настроить из каких репозиториев будет выполняться установка deb пакетов в debian в первую очередь. Мы рассматривали репозитории Debian и как их добавлять в отдельной статье. Допустим, вы добавили backports, testing и unstable. Теперь, чтобы настроить для них приоритеты откройте конфигурационный файл /etc/apt/preferences и добавьте в него строки:

sudo vi /etc/apt/preferences

Package: *
Pin: release a=stable
Pin-Priority: 700

Package: *
Pin: release a=stretch-backports
Pin-Priority: 650

Package: *
Pin: release a=testing
Pin-Priority: 600

Package: *
Pin: release a=unstable
Pin-Priority: 100

Очень удобно и не ломает систему.

Установка программ с помощью tasksel

Инструмент tasksel разработан специально для Debian. Он позволяет устанавливать пакеты группами. Разработчики сгруппировали пакеты в зависимости от их предназначения и вы можете установить одну из нужных групп. Именно эта утилита используется в установщике Debian.

Чтобы посмотреть список доступных групп наберите:

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

Также вы можете посмотреть какие пакеты находятся в группе:

Или описание группы пакетов:

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

Чтобы установить группу пакетов, например, веб-сервера, выполните:

tasksel install web-server

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

А для удаления группы:

tasksel remove web-server

Установка программ Debian таким способом достаточно проста, но здесь есть не так много пакетов.

Установка пакетов Aptitude

sudo apt install aptitude

Кроме консольных команд, утилита имеет псевдографический интерфейс, с помощью которого намного удобнее управлять пакетами. Возможно, установка пакетов Debian здесь не так удобна, зато удалить лишние пакеты и посмотреть уже установленные самое оно. Для запуска утилиты выполните:

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

Пакеты разделены на удобные категории чтобы их можно было просто найти:

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

Далее чтобы установить или удалить отмеченные пакеты нажмите кнопку «g». Затем еще раз «g» для подтверждения:

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

Конечно, вам необязательно использовать интерфейс curses, если хотите, можете применять привычные консольные команды, утилита их тоже поддерживает. Синтаксис выполнения такой же, как и у apt, но команд намного больше:

Установка deb пакетов в debian с помощью aptitude будет выглядеть аналогично apt:

sudo aptitude install vlc

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

Установка программ Debian в synaptic

Для полноты статьи давайте еще рассмотрим как выполняется установка приложений через графический интерфейс. Для этого будем использовать программу synaptic. Она уже поставляется вместе с дистрибутивом, можно найти в главном меню:

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

Для поиска нужного пакета нажмите кнопку поиск, потом введите его имя:

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

Далее, найденные пакеты будут отображены на панели:

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

Кликните по нужному пакету правой кнопкой и выберите «Отметить для установки»:

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

Утилита покажет какие еще пакеты будут установлены как зависимости:

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

Чтобы установить выбранные пакеты, нажмите кнопку «Применить».

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debianВам нужно будет подтвердить операцию и дождаться завершения установки. Но установка deb пакетов из консоли debian все равно проще.

Выводы

В этой статье мы рассмотрели различные способы как установить программу в Debian. Как видите, существует множество способов и вы можете выбрать тот, который лучше подходит для вас. Мне всегда нравилось работать в терминале. Это дает максимальный контроль над ситуацией и если что-то пойдет не так вы сразу же получите все сообщения об ошибках и тут же сможете их решить. Надеюсь, эта информация была полезной для вас.

How to install packages on Debian 11

In this article, we will discuss all the ways of installing the packages in Debian 11 with the help of examples.

Installing a package using apt

Apt (advanced packaging tool) is the default tool of the command-line used to install the different packages, remove, update and upgrade them.

The general syntax of using the apt command to install packages is.

To install the package, let’s say, vlc, use:

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

To install the deb package, for example, Visual Studio Code, use:

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

We can also use the apt command to remove the unwanted packages from Debian. The general syntax of removing the package is:

To remove a package with its dependencies use:

For example, to remove the package VLC we can use an apt statement.

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

Installing a package using dpkg

Dpkg can also be used to install the packages in Debian 11, not only it is used to install but also for the upgrade, configuration, and removal of the packages. The dpkg is also a default command-line package management interface just like the apt command, but it slightly differs from the apt such as dpkg does not install the dependencies of the package (if needed) but apt can install the dependencies too while installing the package. Similarly, dpkg does not install the packages from remote addresses, it only installs the packages whose installation files are downloaded. It is used mostly to install Debian packages.

The general syntax of the dpkg command to install using any package using i flag (i flag is used to install the package)

For example, we install the package code.deb using the dpkg command:

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

The general syntax of removing the unwanted package from the Debian 11 is

For example, we want to remove “code” using the dpkg command.

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

If we want to remove the package along with its configuration files, then we can use flag “p”, the general syntax of removing the package along with its configuration file will be

Installing a package using aptitude

Aptitude is also a command used to install packages, it works similar to the apt command but the difference is that the aptitude command is not available by default in Debian, so we have to install it.

To install aptitude we can run the following command

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

The general syntax of installing a package using the aptitude is

The difference between the apt and aptitude is level difference such as aptitude is a higher-level and apt is a lower-level package manager which means apt can be used in higher-level packages. We will install the python3-nacl using the aptitude command.

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

We can see it is showing the progress of the installation:

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

Aptitude command also has the ability to display and retrieve the changelog of the official packages of Debian. If we want to remove the unwanted package using the aptitude command, the general syntax will be.

For example, if we want to remove the package python3-nacl, using the aptitude command.

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

Installing a package using gdebi

In Debian 11, the gdebi utility can also be used to install the packages, it works similar to the apt but the difference is apt installs the dependencies of packages from remote only like HTTPS, whereas the gdebi installs local packages resolving the dependencies of the package. Gdebi is not a default package manager in Debian, so we can install it as:

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

To install the package using gdebi, the general syntax will be:

For example, we install visual studio using gdebi.

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

However, gdebi has no command to remove the unwanted packages.

Installing a package using flatpak

Sandbox applications can be installed on Debian 11 using the flatpak command. The flatpak is not the default application, we have to install flatpak in Debian 11 to use it. For the installation, first, run the following statement in the terminal to enter the root user mode:

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

Run the following command to install flatpak.

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

Install the GNOME plugins for the flatpak by command.

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

Also, enable the flatpak by adding the repository of flatpak repo from the flathub, so its applications can be installed.

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

Now will install the application of gnome recipes using the flatpak

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

To run this application.

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

The output will as:

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

Conclusion

Some commands have been obsoleted in the newer version of Debian 11 like apt-get, but there are many other commands which can be used as an alternative to apt-get to install the packages in Debian 11. In this article, we have discussed different commands to install packages in detail in Debian 11 like apt, dpkg, gdebi, aptitude, and flatpak. We also explain the general syntax of these commands and explain with the help of examples how these commands are used to install and remove packages from Debian 11.

About the author

How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

Hammad Zahid

I’m an Engineering graduate and my passion for IT has brought me to Linux. Now here I’m learning and sharing my knowledge with the world.

This tutorial is based on a Debian Women Build it Event held by Margarita Manterola (in collaboration with the OpenHatch project) on 07-May-2011

This tutorial is about taking an existing package, re-building it, applying changes to it, and preparing those changes so that you can send them to a bug as a patch.

This tutorial is now available as a video from Debian’s Peertube instance in English and Malayalam

Requirements

You need very little previous knowledge for this tutorial, just no fear of the command line How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

You should have a working Debian distribution or a Debian based distribution. You can follow Packaging/Pre-Requisites if you need help setting up a Debian Unstable environment.

You should have administration rights in this computer (either root or sudo). Every time that admin rights are needed, we’ll include sudo in front. If you don’t use sudo, just get the rights whatever way you like.

configure apt

Once you have installed the needed packages, the next thing that you need to do, is make sure that you have some source repositories configured in your computer.

Open your /etc/apt/sources.list file and check if you have one or more lines that start with deb-src.

deb-src http://httpredir.debian.org/debian unstable main

This line is needed in order to work with source packages.

Usually, it’s a good idea to use unstable as the repository, since you’ll be working with the latest version of the package. But if you intend to modify a package as it is in stable or testing you could use those distributions as well.

If you use stable/testing/whatever as your running distribution, getting source from unstable won’t affect it.

Once you’ve added the line, you’ll need to do

in order to update the list of packages available for installation.

create a working directory

With the sources URL added to your apt repositories, you’ll now be able to get the source of any Debian package that you like.

For this particular tutorial, we are going to download the source of one package and make a small modification to it, so that it works better.

It’s always a good idea to have a directory that you use to work with source software, separated from other directories used for other stuff. In case you don’t already have one, I’d suggest that you create a directory src with another one called debian inside it:

Inside this directory we will get the source of the package that we want to work with.

Choose the package

Example 1: node-pretty-ms

In this example, we’ll use a package called node-pretty-ms, a library to print time in human readable format.

Example 2: fdupes

In this example, we’ll use a package called fdupes, a tool to detect duplicate files, and we will be fixing the Debian bug 585426.

You should install the package (or check if you have it installed and up to the latest version) before proceeding, since you’ll need to have the dependencies sorted up when you want to install the modified one.

If you don’t have fdupes installed, you can do this by doing:

and check that the bug is still present. You can do that by running

and checking that the second line of info for the —debug option still doesn’t make any sense.

The packaging workflow

Get the source package

Method 1: apt source

In order to get the source of any package, what you need to do is go to your chosen directory (src/debian in this example) and do (as normal user):

Example 1: node-pretty-ms

Example 2: fdupes

It probably also informed you that this package is maintained with Git.

Method 2: dget

Example 1: node-pretty-ms

Example 2: fdupes

Once the package is downloaded, you can check the directory where you are (typing ls), and you’ll find that apart from the 3 files that were downloaded you also have a directory, called node-pretty-ms-7.0.1 or fdupes-1.50-PR2. This is the unpacked source/source directory of the Debian package.

To enter that directory, type:

Example 1: node-pretty-ms

Example 2: fdupes

Method 3: debcheckout/origtargz

You can also get the source repo from the version control system (for example, git).

Example 1: node-pretty-ms

Example 2: fdupes

When you check the contents of this directory (typing ls again), you’ll see quite a number of files of different sorts, and a debian directory.

Every Debian (or Debian derivative) package includes a debian directory, where all the information related to the Debian package is stored. Anything that’s outside of that directory, is the upstream code, i.e. the original code released by whoever programmed the software.

Go into the debian directory, by typing

This is the directory that the package maintainer has added to the source code to build the package.

In this directory you’ll usually find lots of files related to Debian’s version of the program, Debian specific patches, manpages, documentation, and so on. We won’t be going any deeper about these files here. Look at its contents by typing ls.

Just keep in mind that

    the rules file is the executable file that we will be running in order to build the package.

    in the patches directory, there are also a number of patches applied by the maintainer

    Let’s move one directory back, by doing

    You should be again at node-pretty-ms-7.0.1 or fdupes-1.50-PR2, the main directory of the source code.

    Get the build dependencies

    In order to build almost any program, you will need some dependencies installed.

    The dependencies are the programs or libraries needed to compile your program. Usually it’s a bunch of packages that end in -dev, but it might also be other things like automake or gcc, depending on how many development tools you’ve ever installed in that machine.

    apt provides a way of easily installing all the needed dependencies:

    Example 1: node-pretty-ms

    Example 2: fdupes

    Once you’ve downloaded these tools, you’ll be ready to build the package.

    Rebuild without changes

    Before making any changes to the code, let’s build the package as it is right now, just to make sure that it builds and it installs properly. Do:

    The extra parameters are to build a binary only package (.deb) and prevent it from signing the package, since we don’t need to sign it right now.

    Example 1: node-pretty-ms

    Example 2: fdupes

    In your own language. can be i386, amd64, depending on which architecture you are running your machine on. Architecture indepent packages can be all.

    Once the package has correctly built, the next step is to install this file with:

    Example 1: node-pretty-ms

    Remaining sections are relevant to Example 2 only.

    Example 2: fdupes

    After that, check that the bug is still present, running

    Edit the source code

    Now, we want to actually fix this bug.

    Here comes the fun part. When you are trying to fix a package bug, sometimes it will be located in the upstream source, sometimes it will be related to how the program was packaged for Debian. So you’ll be editing different files depending on where the problem is.

    In this particular case, the package uses the dpatch tool, a tool to manage patches for the package, so we will make use of that tool. Other packages use a different tool, called quilt, to manage patches, but we won’t be covering that one in this tutorial.

    To create a new patch, you’ll need to do the following. Type:

    The name of the patch was chosen to match the pattern already established by the maintainer.

    Now we need to edit the fdupes.c file. Go to the line 1066 and delete it. The line says:

    printf(» \teach set of duplicates without prompting the user\n»);

    You can edit the file with your preferred editor (vi fdupes.c, gedit fdupes.c, kate fdupes.c, etc).

    Once you are done, you should type into the console :

    It will end the special environment that dpatch created for us, and you’ll have a new patch in the debian/patches/ directory. Check it out with:

    In order for this patch to get applied, you’ll need to edit the debian/patches/00list file, and add after the last line :

    The 00list file is the dpatch file that lists all the patches that will be applied. They are applied in order, from the one appearing in the first line, till the one appearing in the last line.

    Before rebuilding the package with this patch, we want to make our package different from the original one, so that we can afterwards extract the changes in order to send them as a patch to the bug. In order to do this, type:

    In case this is vi, and it’s your first time with vi, you can start editing by pressing the Insert key, and after you are finished, you can save an close by pressing: ESC :wq

    So, you are editing the changelog file now. What you have to enter in this file is some description of the change that we’ve made. For example:

    Do this in the line with the empty *.

    Building the modified package

    Once this is done, just build the package again with the same command as before:

    In the case that you need to debug the compiled package, particularly if it’s a Segmentation Fault that you are trying to fix, you might want to compile it like this, so that the code is not optimized and not stripped and it’s easier to debug:

    You’ll see a some compiling output on screen. This is usually not very interesting, unless you are looking for a bug that is related to the compilation of the package itself. Normally, I just let this go while I do something else (grab some cookies for your coffee, for example).

    Installing and testing the modified package

    Install it with:

    and test that the help is now correct. How to install debian package debian. Смотреть фото How to install debian package debian. Смотреть картинку How to install debian package debian. Картинка про How to install debian package debian. Фото How to install debian package debian

    If in any case what you’ve done has made things worst, you can always revert to Debian’s version by doing:

    Building the source package

    Sending your changes to the BTS

    Once you’ve built any source package, you can find out the difference between your package and the original one, by using debdiff:

    In this particular case, since we used the dpatch tool, what we would send to the BTS as a patch is the dpatch file that we created, because the change that we made is enclosed there.

    But if we hadn’t used dpatch, we could use the output of that debdiff and send that to the BTS.

    Conclusions

    That’s it, get ready for the next package

    You’re done with modifying the package, you can now keep fixing bugs in other Debian packages! These are the important commands you’ll need to remember:

    Feedback

    I hope you enjoyed the tutorial, please send me your feedback if you feel like it, or modify this wiki if you want to add some useful information I might have left out.

    Questions and Answers

    QUESTION: Is the number 80_ in the name of the patch a cosmetic thing?

    ANSWER: It’s so that you can get them in order when you list them with ls. The order of application is the order in which they appear in the 00list file. Some maintainers choose to give them numbers, some don’t. But when you are patching a package, you should try to follow whichever pattern the maintainer chose.

    QUESTION: About dpatch-edit-patch params, where did you get your params? I mean the bts****

    ANSWER: The first one is the name of the patch. I chose a name similar to the other ones. «bts» stands for «bug tracking system», the number is the bug number that we are closing.

    QUESTION: How does dch pick the number «3.1»?

    QUESTION: When sending a patch to the BTS, do we send anything about the changelog?

    ANSWER: Not necessarily, but you can send that too, it depends on the bug that you are fixing. Sending the debdiff output is always acceptable.

    If you’re sending only a small and simple patch it’s normal to let the maintainer write the changelog; if it’s a big NMU update then yes you should send the changelog as part of your big patch to the BTS.

    QUESTION: Sending a changelog with a NMU is considered not polite?

    ANSWER: What some (not all) maintainers don’t like is if when someone actually uploads an NMU. Sending a patch to the BTS is always/immer/siempre/sempre well received!

    QUESTION: What is the quickest/easiest way to find out which tool (if any) is used to manage patches?

    ANSWER: If there’s a build dependency on quilt or dpatch in debian/control. Or if there’s a debian/README.source file.

    QUESTION: Does this workflow work for all packages?

    ANSWER: The workflow is quite general. The only thing that might change is the patch management system (dpatch/quilt/none). The rest is basically always the same.

    See also

    If you want to go on a little bit further in your package making, you can read some of the AdvancedBuildingTips

    You can find a tutorial about creating new packages for Debian at IntroDebianPackaging

    Packaging is the page that gather everything about packaging on this wiki

    Advanced topics on Debian package management

    Debian package management consists of several layers. The lowest layers are made up of dpkg and associated programs. On top of these layers is the Apt family of tools such as apt, apt-get, apt-cache, and others. See the Package Management Tools page for a description of other tools for working with DebianPackage files.

    You may know some software like Firefox, GIMP, etc, but what they really are is just lots and lots of files that have been compiled into one. The people (or sometimes a single person) that write this software are known as upstream providers, they compile their code and write up how to get it installed.

    Repositories are just a central storage location for packages. Many online repositories hold lots of packages. Your machine doesn’t know where to look for these repositories unless you explicitly tell it where to look. Debian already comes with pre-approved sources to get packages from and this is how it installs all the base packages you see on your system (if a user did a net-install). On a Debian system, this sources file is the » /etc/apt/sources.list» file. Your machine will know to look there and check for any source repositories you added.

    apt provides a high-level command line interface for debian’s package management system, with all the necessary tools in one place. apt aims to provide a simple, efficient way of handling packages for end users.

    Update your package lists

    To use apt, it is important to retrieve a fresh copy of the package lists from the configured sources:

    Upgrading your system

    You should upgrade you system everyday, this gives you security and bug fixes:

    Sometimes it is helpful to use «full-upgrade». It performs the function of the upgrade but will remove currently installed packages if that is essential to upgrade the system as a whole. This command is usually issued while doing system upgrades.

    Before upgrading your Debian system to the next release, drop into a «tty» console by pressing CTRL+ALT+F3/F4/F5 etc, as dpkg restarts some login managers that will forcefully log you out while upgrading, resulting in a broken/partial upgrade

    Installing and removing packages

    To install a package, in this example Firefox:

    To remove a package:

    Note

    apt performs the requested action on one or more packages specified via regex, glob or exact match. The requested action can be overridden for specific packages by appending a plus (+) to the package name to install this package or a minus (-) to remove it.

    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. Alternatively, the version from a specific release can be selected by following the package name with a forward slash (/) and code name (stretch, buster, sid. ) or suite name (stable, testing, unstable). This will also select versions from this release for dependencies of this package if needed to satisfy the request. Removing a package removes all packaged data, but leaves usually small (modified) user configuration files behind, in case the remove was an accident. Just issuing an installation request for the accidentally removed package will restore its function as before in that case. On the other hand, you can get rid of these leftovers by calling purge even on already removed packages. Note that this does not affect any data or configuration stored in the users’ home directory.

    Finding packages

    Search for a package:

    For example, to find packages with the term ‘cats’ in the package name or description:

    To see detailed information about a package:

    Clean up

    After you remove a package, you should remove any other packages that were automatically installed to satisfy dependencies and are now no longer needed:

    It can also be issued while removing a package like:

    You should check this does not include applications you have grown to like even though they were once installed just as a dependency of another package. You can mark such a package as manually installed by using apt install foo or apt-mark auto/manual foo. Packages which you have installed explicitly/directly via install are also never proposed for automatic removal.

    Editing Sources

    There is a cool new feature of apt that allows editing package sources, i.e. «sources.list», in your preferred editor while providing basic sanity checks:

    See SourcesList on how to configure your sources.

    Low-level Tools

    Largely dpkg and friends, these are commands that perform a single task. They are most directly comparable to Redhat’s «rpm» command.

      dpkg-reconfigure locales to reconfigure Locales.

      dpkg-reconfigure exim to reconfigure the exim mail-transfer agent. This command isn’t currently part of dpkg; it’s provided by debconf.

      dpkg, (see DPkg) invoked with various command-line arguments. If you find a place to download debian packages that is not accessible via apt, you can download the packages and install them directly. Note that this method will not automatically resolve dependencies between packages etc, therefore use apt or dselect if possible.

      deborphan can be handy but is no longer required to recover space because apt now automatically uninstalls unneeded packages that were installed only to satisfy a dependency of a package that was specifically requested to be installed but has since been removed. It gives you a list of library packages that no longer have higher-level packages depending on them.

      Contents of a debian file

      To see the contents of debian packages in the Debian repositories, whether installed or uninstalled, install the apt-file package and enter

      To get the contents of the file «abc.deb», you have to enter

      Reconfiguring of debconf

      To reconfigure debconf so that it informs you of most changes of the new packages:

      Chose «medium» here

      Package Management with apt-get and dpkg

      Package resource list for APT

      The file /etc/apt/sources.list is the definition file of the sources for apt. For further information about this file type

      Retrieve new lists of packages:

      To fetch the new lists of all the packages from sources.list enter:

      or the equivalent

      This command checks for new release-files on the given servers. Luckily the command is clever enough to check if the release-file has changed after the last update.

      Upgrade of all the files:

      To make an update of all the changed packages, enter the line

      If you want to do this from cron you should consider using the cron-apt package.

      The older apt-get based method is:

      Distribution Upgrade of all the files:

      WARNING

      Following the upgrade instructions found in the release notes is the best way to ensure that your system upgrades from one major Debian release to another (e.g. from jessie to stretch) without breakage!

      These instructions will tell you to do a dist-upgrade (instead of upgrade) at least once. You would have to type something like

      at some point during the major release upgrade.

      A dist-upgrade will also be required to keep up-to-date with the latest version in testing and unstable. A dist-upgrade may be very occasionally needed for you to obtain security upgrades in stable releases too in the case where packages change names.

      Discover a package:

      How can you discover which package to use without the GUI programs?

      Or use a web interface:

      With the web search interface you can search the package contents for specific files:

      Add a package:

      How can you add a package to your system without the GUI programs? All you have to do is find out the name of this package and enter the command

      to add the package sylpheed-claws.

      Remove a package:

      To get rid of the package foo which is no longer needed, enter the command

      Removing a package removes all packaged data, but leaves usually small (modified) user configuration files behind, in case the remove was an accident. Just issuing an installation request for the accidentally removed package will restore its function as before in that case. On the other hand, you can get rid of these leftovers by calling purge even on already removed packages. Note that this does not affect any data or configuration stored in your home directory.

      So, technically if the package is needed by other packages you will be prompted to remove this package and all packages which depend on it. Also just removing a package does not remove the configuration files that relate to the package. To get rid of the package foo which is no longer needed along with all configuration files and related dependencies, enter the command:

      You can also use the command below to purge configuration files after issuing a normal by apt-get remove foo:

      Warning

      Careful while removing packages. Pay attention to apt messages.

      Forcing removal of a package:

      While making a distribution upgrade it could happen that you have to remove a package first. But sometimes this is not possible with apt-get remove since the package has unmet dependencies or is not installed completely. You can remove the package foo by using the command

      Read the contents of a installed package:

      Sometimes you want to know which files are in the package foo. To get this information enter the command

      Get the description of a package:

      You don’t know what the package foo is for? Just write

      Search the package of a file:

      Have you ever wondered to which package a given file belongs? To get this information (e.g. for /usr/bin/apt-get), start the command

      and it will tell you that this file is part of the package apt.

      Источники информации:

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

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