For a long time, I was thirsty for not knowing how to do some elementary things in Debian package managers, but, as often happens, there was no one to ask, and they didn’t get around to writing somewhere. And finally the questions matured and I wrote
my question in the
debian's newsletter . Naturally it turned out that he had missed something obvious, but he also learned a lot of unobvious utility, therefore he decided to sketch a cheat sheet, maybe someone would come in handy.
Debian Admin Summary
Basic and well-known
Getting information about new / updated packages
sudo aptitude update
Update
sudo aptitude safe-upgrade
Search for a package by package name
aptitude search key_word
Search package by exact name
aptitude search "^name$"
Search by description
aptitude search "?description("key_word")"
Package Information
aptitude show package_name
Installation
sudo aptitude install package_name
Deletion
sudo aptitude remove package_name
Complete deletion (along with configs)
sudo aptitude purge package_name
Clear cache of loaded packages (free space)
aptitude autoclean
Installing a separately downloaded / created package (to create a package from third-party sources, use the
checkinstall utility with the -D flag)
sudo dpkg -i /path/to/package.deb
For more information
man aptitude sudo aptitude install aptitude-doc-en
and look at the documentation (/usr/share/doc/aptitude/html/en/index.html) for a quick reference on search patterns, go here /usr/share/doc/aptitude/html/en/ch02s04.html. If you are too lazy to dock, then it
is online.
Introduction to the Debian Wiki:
wiki.debian.org/AptitudeAnd now what is not obvious or requires a complete reading of the documentation
1. How after update to see which packages will be updated?
aptitude search ?upgradable
You can also use it (if you put it)
sudo daptup
but after installing it, the usual update will behave in the same way.
2. How to find out what has changed in the packages that will be updated?
You can try
sudo aptitude changelog package_name
for each package.
But it is better to put apt-listchanges, then before any installation of updates, a list of changes will be shown, the default settings are not very convenient, so it is better to reconfigure for yourself, for example, select the output format (while using text, for large updates it is probably pager better), do not send letters, asking for confirmation, display all information. To do this, run
sudo dpkg-reconfigure apt-listchanges
3. What should I do if the update is broken and I need to roll back?
No rollback, you can try to find a previous version of the package.
sudo aptitude version package_name
and install it
sudo aptitude install package_name=version
4. How to find all packages installed manually?
there is a command option (aptitude search '~ i! ~ M'), but unfortunately it does not give the desired result, so the question remains open, there are a lot of ways based on the analysis of logs
/var/log/aptitude (+ ) /var/log/installer/initial-status.gz /var/log/dpkg.log (+ )
but there is no simple and ready-made solution, but information can theoretically be lost during rotations; you need to configure
')
5. How to view the list of files in the package?
if the package is installed
dpkg -L package_name
for any packages, put apt-file and
apt-file list package_name
6. How to see which package the file belongs to?
dpkg -S file_name
7. How to remove all packages, where is the key in the package name?
sudo aptitude purge ~ikey
8. How to remove the remaining configs from remote packages?
sudo aptitude purge ~c
9. How to find a package that contains the file lib.so:
apt-file search lib.so
10. How to convert rpm package to deb?
alien --to-deb /path/to/file.rpm
11. How to find a list of installed kernels?
dpkg --list linux-* | grep ii
12. How to install the package from testing or experimental?
On this topic you need to write separately (
for example ), but if briefly, then there are commands for this
sudo aptitude -t testing package_name
or
sudo aptitude package_name/testing
13. How to remove a meta package, but leave one of the dependencies?
have to read the documentation about the key unmarkauto or look
here .
14. How to find out what got into the file system past the package management system?
There is a utility cruft, although the question of interpreting the results (the report file) is still open.
sudo cruft -d / -r report --ignore /home --ignore /var --ignore /tmp
15. What are some additional repositories?
Debian -
wiki.debian.org/UnofficialRepositoriesUbuntu - a lot of
PPA16. What else is there?
apt-cdromapt-spyauto-apt .
note on Habréapt-keyapt-add-repositorySome things
only apt-get canThere are alternative utilities for managing packages, such as
wajig , which tries to incorporate the functionality of all the other utilities.
17. How to find packages depending on this
apt-cache rdepends package_name
can also come in handy
aptitude why package_name
I thank everyone who helped with their advice in the
mailing list , LJ (
JackYF ) and
Habré (
run4way ,
sledopit ,
nazarpc ,
AgaFonOff ,
amarao ,
traaance ,
adrianopol ,
Karamax ). Comments and additions are welcome.