Cheat Sheet:
LinuxCBT Slides:
dpkg
List all installed packages:
root@debian93:~# dpkg -l
root@debian93:~# dpkg -l Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-==============================-==============================-============-=============================================================================== ii adduser 3.115 all add and remove users and groups [...]
root@debian93:~# dpkg -l | wc -l 331
List specfic installed package metadeta:
root@debian93:~# dpkg -l adduser Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-========================================-=========================-=========================-====================================================================================== ii adduser 3.115 all add and remove users and groups
List all files installed by specific package:
root@debian93:~# dpkg -L adduser /. /etc /etc/deluser.conf /usr /usr/sbin /usr/sbin/adduser /usr/sbin/deluser [...]
Install package from downloaded package:
root@debian93:~# cd /tmp root@debian93:/tmp# wget http://ftp.de.debian.org/debian/pool/main/t/tofrodos/tofrodos_1.7.13+ds-2_amd64.deb
root@debian93:~# dpkg -i /tmp/tofrodos_1.7.13+ds-2_amd64.deb Selecting previously unselected package tofrodos. (Reading database ... 28344 files and directories currently installed.) Preparing to unpack .../tofrodos_1.7.13+ds-2_amd64.deb ... Unpacking tofrodos (1.7.13+ds-2) ... Setting up tofrodos (1.7.13+ds-2) ... Processing triggers for man-db (2.7.6.1-2) ...
root@debian93:~# dpkg -L tofrodos /. /usr /usr/share /usr/share/doc-base /usr/share/doc-base/tofrodos [...]
Which Package installed sepcfic file:
root@debian93:~# dpkg -S /usr/share/doc-base/tofrodos tofrodos: /usr/share/doc-base/tofrodos
apt-* :
Refresh /etc/apt/sources.list Repos DB:
root@debian93:~# apt-get update Hit:1 http://security.debian.org/debian-security stretch/updates InRelease Ign:2 http://ftp.de.debian.org/debian stretch InRelease Get:3 http://ftp.de.debian.org/debian stretch-updates InRelease [91.0 kB] Hit:4 http://ftp.de.debian.org/debian stretch Release Fetched 91.0 kB in 1s (71.2 kB/s) Reading package lists... DoneIn order to have better understanding of '/etc/apt/sources.list', check the following link:
https://wiki.debian.org/SourcesList
List current used Debian Repos:
Configuration file:root@debian93:~/scripts# cat /etc/apt/sources.list # # deb cdrom:[Debian GNU/Linux 9.3.0 _Stretch_ - Official amd64 NETINST 20171209-12:10]/ stretch main #deb cdrom:[Debian GNU/Linux 9.3.0 _Stretch_ - Official amd64 NETINST 20171209-12:10]/ stretch main deb http://ftp.de.debian.org/debian/ stretch main deb-src http://ftp.de.debian.org/debian/ stretch main deb http://security.debian.org/debian-security stretch/updates main deb-src http://security.debian.org/debian-security stretch/updates main # stretch-updates, previously known as 'volatile' deb http://ftp.de.debian.org/debian/ stretch-updates main deb-src http://ftp.de.debian.org/debian/ stretch-updates main
List of current used Repos, notice '/etc/apt/sources.list.d' usage
root@debian93:~/scripts# grep -h '^deb' /etc/apt/sources.list /etc/apt/sources.list.d/* deb http://ftp.de.debian.org/debian/ stretch main deb-src http://ftp.de.debian.org/debian/ stretch main deb http://security.debian.org/debian-security stretch/updates main deb-src http://security.debian.org/debian-security stretch/updates main deb http://ftp.de.debian.org/debian/ stretch-updates main deb-src http://ftp.de.debian.org/debian/ stretch-updates main grep: /etc/apt/sources.list.d/*: No such file or directory
"deb http://ftp.de.debian.org/debian/ stretch main" could be found in the following path:
http://ftp.de.debian.org/debian/dists/stretch/main/
"deb http://security.debian.org/debian-security stretch/updates main" could be found in the following path:
http://security.debian.org/debian-security/dists/stretch/updates/
Following script should provide better way to list current used repos
https://github.com/abdurrahman84/BASH-real-examples/blob/master/debian_repo_list.sh
Check "apt-*' and 'aptitude' jobs in crontab:
root@debian93:~# ls /etc/cron.daily/apt* /etc/cron.daily/apt-compat /etc/cron.daily/aptitude /etc/cron.daily/apt-show-versions
Sample of repo creation if you want to set repos manually in '/etc/apt/sources.list' file:
root@debian8:~# cat /etc/apt/sources.list # # deb cdrom:[Debian GNU/Linux 8.10.0 _Jessie_ - Official amd64 NETINST Binary-1 20171209-21:51]/ jessie main #deb cdrom:[Debian GNU/Linux 8.10.0 _Jessie_ - Official amd64 NETINST Binary-1 20171209-21:51]/ jessie main deb http://mirrors.kernel.org/debian/ jessie main contrib non-free deb-src http://mirrors.kernel.org/debian/ jessie main contrib non-free deb http://security.debian.org/ jessie/updates main contrib non-free deb-src http://security.debian.org/ jessie/updates main contrib non-free # jessie-updates, previously known as 'volatile' deb http://mirrors.kernel.org/debian/ jessie-updates main deb-src http://mirrors.kernel.org/debian/ jessie-updates main



No comments:
Post a Comment