Commit 0f720da2 authored by Jyothis Jagan's avatar Jyothis Jagan
Browse files

session3.md fixes

parent d7c77368
......@@ -2,7 +2,7 @@
Refer [AptCLI](https://wiki.debian.org/AptCLI)
apt and aptitude are two popular command line package management tools for Debian. The session discussed usage of apt.
`apt` and `aptitude` are two popular command line package management tools for Debian. The session discussed usage of `apt`.
## Basic Commands
* `apt install <package>` installs package
......@@ -18,19 +18,23 @@ apt and aptitude are two popular command line package management tools for Debia
### Serch package a file belongs to
Refer [apt-file](https://wiki.debian.org/apt-file)
`apt-file search <filename>` can be used to find the package in which a file is included.
jyothisjagan@jyothisjagan:~$ apt-file search pq-fe.h
libpq-dev: /usr/include/postgresql/libpq-fe.h
`dpkg -S <filename>` is similar, but you need to have the package installed.
#### Other Options
* https://packages.debian.org for the search on packages.
* https://tracker.debian.org will tell you details about a package (versions, version control, various automated test results and other details relevant to a package maintainer)
## dpkg
`dpkg -l <pattern>` lists packages matching given pattern. 'dpkg -l' lists all packages installled in the system.
jyothisjagan@jyothisjagan:~$ dpkg -l
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
......@@ -47,7 +51,8 @@ Refer [apt-file](https://wiki.debian.org/apt-file)
...
`dpkg -L <package>` lista files installed to the system from a package
`dpkg -L <package>` lists files installed to the system from a package
jyothisjagan@jyothisjagan:~$ dpkg -L micro
/.
/usr
......@@ -64,6 +69,7 @@ Refer [apt-file](https://wiki.debian.org/apt-file)
/usr/share/man/man1/micro.1.gz
`dpkg-reconfigure` can be used to update choices made during package installation.
jyothisjagan@jyothisjagan:~$ sudo dpkg-reconfigure locales
[sudo] password for jyothisjagan:
Generating locales (this might take a while)...
......@@ -74,6 +80,7 @@ Refer [apt-file](https://wiki.debian.org/apt-file)
Generation complete.
`dpkg -S <filename>` searches for filename from installed packages.
jyothisjagan@jyothisjagan:~$ dpkg -S pthread.h
libc6-dev:amd64: /usr/include/pthread.h
autoconf-archive: /usr/share/doc/autoconf-archive/html/ax_005fpthread.html
......@@ -82,6 +89,7 @@ Refer [apt-file](https://wiki.debian.org/apt-file)
## Dependencies
apt-cache rdepends mypackage will tell you packages that depends on mypackage
jyothisjagan@jyothisjagan:~$ apt-cache rdepends rails
rails
Reverse Depends:
......@@ -90,6 +98,7 @@ apt-cache rdepends mypackage will tell you packages that depends on mypackage
passenger
`reverse-depends -b <package>` shows reverse build dependencies
jyothisjagan@jyothisjagan:~$ reverse-depends -b gedit
Reverse-Build-Depends
=====================
......@@ -99,6 +108,7 @@ apt-cache rdepends mypackage will tell you packages that depends on mypackage
## Check Package Version
`apt policy <package>` shows the version of package which is installed or going to be installed.
jyothisjagan@jyothisjagan:~$ apt policy vim
vim:
Installed: 2:8.1.0875-5
......@@ -124,18 +134,22 @@ Refer [Packaging SourcePackage](https://wiki.debian.org/Packaging/SourcePackage)
Let us install `bc` from source.
First, get source package.
apt source bc
Let us check the contents of the current directory now.
jyothisjagan@jyothisjagan:~/session3$ ls
bc-1.07.1 bc_1.07.1-2.debian.tar.xz bc_1.07.1-2.dsc bc_1.07.1.orig.tar.gz
Now we need to build the package.
apt source -b bc
If build dependencies are met, then it will generate .deb file.
Note: You can install build dependencies using
apt build-dep <package>
## Installing Packages from Third Party Repositories
......@@ -143,12 +157,13 @@ Note: You can install build dependencies using
Here, we are going to install libjs-pdf from https://people.debian.org/~praveen/gitlab/pool/main/p/pdf.js/
1. Add the gpg public key(at https://people.debian.org/~praveen/gitlab/) as a trusted key.
apt-key add praveen.key.asc
2. Add sources.list entry. For that we can download `gitlab.list` to `/etc/apt/sources.list.d`
3.
2. Add sources.list entry. For that we can download `gitlab.list` to `/etc/apt/sources.list.d`. Then
apt update
apt install
apt install libjs-pdf
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment