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

session3.md fixes

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