Linux Package Management: apt, dnf, yum, rpm, dpkg आणि snap Commands सोप्या भाषेत
Linux वर software packages मधे येतं. Package manager योग्य package download करतो, तपासतो, dependencies install करतो, आणि नंतर update किंवा remove करू शकतो. Debian आणि Ubuntu apt वापरतात, खाली dpkg. RHEL, Amazon Linux, Rocky आणि Fedora dnf (जुन्यांवर yum) वापरतात, खाली rpm. snap अनेक distros वर चालतो. प्रत्येक command आणि key option एक-एक करून बघू.
या chapter मध्ये तुम्ही काय शिकाल
- apt ने lists refresh, install, remove आणि purge
- Packages search, show आणि safely upgrade
- dnf/yum ने install, update, provides, history आणि undo
- rpm आणि dpkg ने installed files query
- Repositories जोडा आणि versions hold
- Snaps install आणि manage
1. रोजचं उदाहरण: विश्वासू wholesaler कडून order
हे का लागतं?
पुण्याचा दुकानदार biscuits बनवत नाही. तो विश्वासू wholesaler च्या catalogue मधून order करतो. Catalogue दर आठवड्याला update होतो. चहा मागवला की wholesaler लागणारी साखर पण पाठवतो. प्रत्येक box ला seal, म्हणजे खरा आहे हे कळतं.
हे काय आहे?
Wholesaler = repository. Catalogue = package index (apt update / dnf makecache). चहा आणि साखर = dependencies. Seal = GPG signature. दुकानदाराचं order book = apt/dnf history.
कसं करायचं (step by step)
2. apt update: catalogue refresh
हे का लागतं?
Fresh index शिवाय apt ला नवे versions कळत नाहीत आणि आता नसलेल्या files (404) download करायचा प्रयत्न करू शकतो.
हे काय आहे?
sudo apt update प्रत्येक repo मधून package lists download करतो. काही install किंवा upgrade करत नाही. install किंवा upgrade आधी चालवा.
कसं करायचं (step by step)
- Refresh.
sudo apt update
Output:
Hit:1 http://archive.ubuntu.com/ubuntu noble InRelease
Get:2 http://security.ubuntu.com/ubuntu noble-security InRelease [126 kB]
Reading package lists... Done
12 packages can be upgraded. Run 'apt list --upgradable' to see them.
याचा अर्थ: फक्त lists बदलल्या.
- काय upgrade होऊ शकतं?
apt list --upgradable
Output:
openssl/noble-updates 3.0.13-0ubuntu3.4 amd64 [upgradable from: 3.0.13-0ubuntu3.1]
याचा अर्थ: नाव, नवीन version, जुनं version.
3. apt install: packages install
हे का लागतं?
nginx, git, python आणि जवळजवळ सगळं असंच मिळतं.
हे काय आहे?
sudo apt install NAME [NAME...] dependencies सह install. -y आपोआप yes (scripts मधे). NAME=VERSION ठराविक version. --no-install-recommends optional extras skip. apt install ./file.deb local file आणि deps.
कसं करायचं (step by step)
- nginx install.
sudo apt install -y nginx
Output:
The following NEW packages will be installed:
libnginx-mod-http-geoip2 nginx nginx-common
Setting up nginx (1.24.0-2ubuntu7) ...
याचा अर्थ: Dependencies सोबत आल्या.
- Slim install.
sudo apt install -y --no-install-recommends python3-pip
Output:
(fewer packages listed)
याचा अर्थ: लहान images साठी छान.
- नेमकं version.
sudo apt install -y nginx=1.24.0-2ubuntu7
Output:
nginx is already the newest version (1.24.0-2ubuntu7).
याचा अर्थ: Test केलेलं version pin.
4. apt remove, purge आणि autoremove
हे का लागतं?
नको असलेलं software काढल्याने disk वाचते आणि security risk कमी. कधी clean reinstall साठी config पण काढायची असते.
हे काय आहे?
apt remove NAME program काढतो पण /etc मधल्या config files ठेवतो. apt purge NAME config पण काढतो. apt autoremove आता कोणाला नको असलेल्या dependencies काढतो.
कसं करायचं (step by step)
- काढा पण config ठेवा.
sudo apt remove -y nginx && ls /etc/nginx | head -2
Output:
conf.d
nginx.conf
याचा अर्थ: Config अजून आहे.
- सगळं काढा.
sudo apt purge -y nginx nginx-common
Output:
Removing nginx-common ...
Purging configuration files for nginx-common ...
याचा अर्थ: /etc/nginx गेलं.
- Leftovers साफ.
sudo apt autoremove -y
Output:
Removing libnginx-mod-http-geoip2 ...
याचा अर्थ: Orphans गेले.
5. apt upgrade आणि full-upgrade
हे का लागतं?
Security fixes updates मधून येतात. Patching हे नेहमीचं weekly काम.
हे काय आहे?
apt upgrade नवी versions install करतो पण packages कधी काढत नाही. apt full-upgrade upgrade पूर्ण करायला packages काढू किंवा जोडू शकतो (उदा. नवे kernels). apt install --only-upgrade NAME एकच package. Kernel updates नंतर /var/run/reboot-required तपासा.
कसं करायचं (step by step)
- Server patch.
sudo apt update && sudo apt upgrade -y
Output:
12 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
याचा अर्थ: काही काढलं नाही.
- फक्त openssl.
sudo apt install --only-upgrade -y openssl
Output:
openssl is already the newest version
याचा अर्थ: Targeted patch.
- Reboot लागेल का?
cat /var/run/reboot-required 2>/dev/null || echo no reboot
Output:
*** System restart required ***
याचा अर्थ: Kernel update झाला.
6. apt search, show आणि list
हे का लागतं?
Install आधी नेमकं नाव, version, size आणि कशावर अवलंबून ते कळायला हवं.
हे काय आहे?
apt search WORD नावं आणि descriptions शोधतो. apt show NAME version, size, depends, description. apt list --installed installed packages. apt-cache policy NAME candidate versions आणि repo.
कसं करायचं (step by step)
- JSON tool शोधा.
apt search --names-only '^jq$'
Output:
jq/noble 1.7.1-3build1 amd64
lightweight and flexible command-line JSON processor
याचा अर्थ: नेमकं नाव.
- Details.
apt show jq 2>/dev/null | grep -E 'Version|Depends|Installed-Size'
Output:
Version: 1.7.1-3build1
Installed-Size: 102 kB
Depends: libjq1 (= 1.7.1-3build1), libc6 (>= 2.34)
याचा अर्थ: लहान आणि सोपं.
- कोणता repo आणि version?
apt-cache policy nginx
Output:
nginx:
Installed: (none)
Candidate: 1.24.0-2ubuntu7
Version table:
1.24.0-2ubuntu7 500
500 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages
याचा अर्थ: Install जे निवडेल ते Candidate.
7. dpkg: low-level Debian tool
हे का लागतं?
विचारायचं असतं: ही file कोणत्या package ची? या package ने कोणत्या files install केल्या? खरंच installed आहे का?
हे काय आहे?
dpkg -l packages list (ii = installed). dpkg -L NAME त्याच्या files. dpkg -S /path owner शोधतो. dpkg -s NAME status. dpkg -i file.deb local file install पण deps आणत नाही (apt -f install ने fix).
कसं करायचं (step by step)
- curl installed आहे का?
dpkg -l curl | tail -n1
Output:
ii curl 8.5.0-2ubuntu10.4 amd64 command line tool for transferring data with URL syntax
याचा अर्थ: ii = installed OK.
- ही file कोणाची?
dpkg -S /usr/bin/curl
Output:
curl: /usr/bin/curl
याचा अर्थ: आधी package नाव.
- Package च्या files.
dpkg -L jq | grep bin
Output:
/usr/bin/jq
याचा अर्थ: Binary कुठे ठेवली.
- Missing deps सह local .deb.
sudo dpkg -i tool_1.0_amd64.deb; sudo apt -f install -y
Output:
dpkg: dependency problems prevent configuration of tool ...
Setting up tool (1.0) ...
याचा अर्थ: apt deps fix करतो.
8. dnf आणि yum install, remove आणि reinstall
हे का लागतं?
Amazon Linux, RHEL, Rocky, Alma आणि Fedora servers companies मधे खूप common.
हे काय आहे?
sudo dnf install NAME (जुन्या systems वर yum सारखंच; नव्यांवर yum हा dnf चा link). yes साठी -y. dnf remove NAME तो आणि unused deps काढतो. dnf reinstall NAME बिघडलेल्या files परत. dnf install ./file.rpm deps सह local file. वेगळी list update step नाही: metadata जुना झाला की dnf refresh करतो (dnf makecache force करतो).
कसं करायचं (step by step)
- nginx install.
sudo dnf install -y nginx
Output:
Installed:
nginx-1:1.24.0-1.amzn2023.0.4.x86_64 nginx-core-1:1.24.0-1.amzn2023.0.4.x86_64
Complete!
याचा अर्थ: Complete! म्हणजे success.
- Remove.
sudo dnf remove -y nginx
Output:
Removed:
nginx-1:1.24.0-1.amzn2023.0.4.x86_64
Complete!
याचा अर्थ: Unused deps पण काढतो.
- Delete झालेली binary fix.
sudo dnf reinstall -y curl
Output:
Reinstalled:
curl-minimal-8.5.0-1.amzn2023.0.4.x86_64
याचा अर्थ: Files परत.
9. dnf check-update, update आणि upgrade --security
हे का लागतं?
RHEL-family servers safely patch, कधी फक्त security fixes.
हे काय आहे?
dnf check-update available updates list (असतील तर exit 100). dnf update किंवा dnf upgrade सगळं (एकच). एकासाठी dnf upgrade NAME. dnf upgrade --security फक्त security errata. needs-restarting -r reboot लागेल का.
कसं करायचं (step by step)
- काय बदलेल?
dnf check-update
Output:
openssl-libs.x86_64 1:3.0.8-1.amzn2023.0.14 amazonlinux
याचा अर्थ: एक update बाकी.
- फक्त security.
sudo dnf upgrade --security -y
Output:
Upgraded:
openssl-libs-1:3.0.8-1.amzn2023.0.14.x86_64
Complete!
याचा अर्थ: कमीत कमी बदल.
- Reboot लागेल का?
sudo dnf needs-restarting -r
Output:
Core libraries or services have been updated since boot-up:
* kernel
Reboot is required to fully utilize these updates.
याचा अर्थ: Reboot plan करा.
10. dnf search, info, provides आणि list
हे का लागतं?
'command not found': ही command कोणतं package देतं? dnf provides उत्तर देतो.
हे काय आहे?
dnf search WORD. dnf info NAME version, repo, size. dnf provides '*/bin/NAME' किंवा file path package शोधतो. dnf list installed. dnf repoquery -l NAME install आधी files list.
कसं करायचं (step by step)
- dig command कोण देतं?
dnf provides '*/bin/dig'
Output:
bind-utils-32:9.18.28-1.amzn2023.0.1.x86_64 : Utilities for querying DNS name servers
Repo : amazonlinux
Matched from:
Filename : /usr/bin/dig
याचा अर्थ: bind-utils install करा.
- Info.
dnf info jq | grep -E 'Version|Repository'
Output:
Version : 1.7.1
Repository : amazonlinux
याचा अर्थ: Official repo मधून.
- Installed आहे का?
dnf list installed | grep -i nginx
Output:
nginx.x86_64 1:1.24.0-1.amzn2023.0.4 @amazonlinux
याचा अर्थ: @ = त्या repo मधून installed.
11. dnf history आणि undo
हे का लागतं?
Patch ने app बिघडलं. नेमकं काय बदललं ते बघून rollback करायचं.
हे काय आहे?
dnf history transactions IDs सह. dnf history info ID packages. sudo dnf history undo ID उलटं करतो (repo मधे जुनी versions हवी). dnf downgrade NAME जुनं version. apt वर /var/log/apt/history.log बघा.
कसं करायचं (step by step)
- अलीकडचे बदल.
sudo dnf history | head -4
Output:
ID | Command line | Date and time | Action(s) | Altered
14 | upgrade --security -y | 2026-10-25 13:10 | Upgrade | 1
13 | install -y nginx | 2026-10-25 12:55 | Install | 2
याचा अर्थ: कोणी, काय, कधी.
- Patch undo.
sudo dnf history undo 14 -y
Output:
Downgraded:
openssl-libs-1:3.0.8-1.amzn2023.0.12.x86_64
Complete!
याचा अर्थ: Rollback झाला.
- apt ची नोंद.
grep -A2 'Start-Date' /var/log/apt/history.log | tail -n3
Output:
Start-Date: 2026-10-25 13:12:01
Commandline: apt upgrade -y
Upgrade: openssl:amd64 (3.0.13-0ubuntu3.1, 3.0.13-0ubuntu3.4)
याचा अर्थ: जुनं आणि नवं version.
12. rpm queries: -qa, -qi, -ql, -qf
हे का लागतं?
rpm package database थेट आणि पटकन वाचतो. Audits आणि scripts साठी छान.
हे काय आहे?
rpm -qa सगळी installed (grep ला pipe). rpm -qi NAME info. rpm -ql NAME files. rpm -qf /path owner. rpm -V NAME database शी files verify. rpm -qp --requires file.rpm install न झालेली file वाचतो. Install साठी rpm -i टाळा; deps सोडवत नाही.
कसं करायचं (step by step)
- Kernel packages.
rpm -qa | grep '^kernel-6'
Output:
kernel-6.1.112-122.189.amzn2023.x86_64
kernel-6.1.115-126.197.amzn2023.x86_64
याचा अर्थ: दोन kernels.
- File चा owner.
rpm -qf /etc/ssh/sshd_config
Output:
openssh-server-8.7p1-8.amzn2023.0.11.x86_64
याचा अर्थ: Owner package.
- Package च्या config files.
rpm -qc nginx-core | head -2
Output:
/etc/nginx/fastcgi.conf
/etc/nginx/mime.types
याचा अर्थ: -qc = फक्त config.
- काही बदललं का?
rpm -V openssh-server
Output:
S.5....T. c /etc/ssh/sshd_config
याचा अर्थ: Size, checksum, time बदलले: कोणी edit केलं.
13. Repositories: जोडा, list आणि enable
हे का लागतं?
अनेक tools (Docker, Node.js, PostgreSQL) स्वतःच्या repo मधून नवी versions देतात.
हे काय आहे?
apt: /etc/apt/sources.list.d मधे .list किंवा .sources file, signed-by= /etc/apt/keyrings मधल्या key कडे; मग apt update. dnf: /etc/yum.repos.d मधे .repo file (dnf config-manager --add-repo URL); dnf repolist enabled repos; एका command साठी --enablerepo/--disablerepo. विश्वासाचे repos च जोडा.
कसं करायचं (step by step)
- Enabled dnf repos.
dnf repolist
Output:
repo id repo name
amazonlinux Amazon Linux 2023 repository
kernel-livepatch Amazon Linux 2023 Kernel Livepatch repository
याचा अर्थ: Packages कुठून येतात.
- Docker चा repo जोडा (Fedora/RHEL).
sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
Output:
Adding repo from: https://download.docker.com/linux/fedora/docker-ce.repo
याचा अर्थ: आता .repo file आहे.
- Key सह apt repo.
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo 'deb [signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu noble stable' | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt update
Output:
Get:5 https://download.docker.com/linux/ubuntu noble InRelease [48.8 kB]
याचा अर्थ: Key फक्त या repo पुरती.
14. Versions hold: apt-mark hold आणि dnf versionlock
हे का लागतं?
Routine patch मधे database किंवा Kubernetes package चं version उडी मारू नये.
हे काय आहे?
apt-mark hold NAME upgrades थांबवतो; apt-mark showhold list; unhold सोडतो. dnf: python3-dnf-plugin-versionlock install, मग dnf versionlock add NAME, list, delete. किंवा /etc/dnf/dnf.conf मधे exclude=NAME.
कसं करायचं (step by step)
- kubelet hold.
sudo apt-mark hold kubelet kubeadm && apt-mark showhold
Output:
kubelet set on hold.
kubeadm set on hold.
kubeadm
kubelet
याचा अर्थ: Upgrades त्यांना skip.
- dnf वर lock.
sudo dnf versionlock add postgresql16-server
Output:
Adding versionlock on: postgresql16-server-0:16.4-1.amzn2023.0.1.*
याचा अर्थ: या version ला lock.
- सोडा.
sudo apt-mark unhold kubelet
Output:
Canceled hold on kubelet.
याचा अर्थ: तयार असाल तेव्हा upgrade.
15. Caches साफ
हे का लागतं?
Download झालेल्या package files साठतात आणि लहान disks आणि container images भरतात.
हे काय आहे?
apt clean /var/cache/apt/archives delete. apt autoclean फक्त जुनी versions. dnf clean all dnf caches. Dockerfiles मधे एकाच RUN line मधे clean.
कसं करायचं (step by step)
- Cache size.
sudo du -sh /var/cache/apt /var/cache/dnf 2>/dev/null
Output:
412M /var/cache/apt
याचा अर्थ: परत मिळणारी जागा.
- साफ.
sudo apt clean && sudo du -sh /var/cache/apt
Output:
36K /var/cache/apt
याचा अर्थ: मोकळी.
- Dockerfile pattern.
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*
Output:
(image layer)
याचा अर्थ: लहान image.
16. snap: install, list, refresh, remove
हे का लागतं?
काही tools सगळ्या libraries आत आणि auto updates सह snaps म्हणून येतात, प्रत्येक distro वर सारखं.
हे काय आहे?
sudo snap install NAME. Full system access लागणाऱ्या tools साठी --classic (code editors). snap list installed. snap refresh आत्ता update; snap refresh --hold updates थांबवतो. snap remove NAME. snap info NAME channels (stable, edge).
कसं करायचं (step by step)
- Snap install.
sudo snap install aws-cli --classic
Output:
aws-cli (v2/stable) 2.18.10 from Amazon Web Services (aws✓) installed
याचा अर्थ: ✓ = verified publisher.
- List.
snap list
Output:
Name Version Rev Tracking Publisher Notes
aws-cli 2.18.10 1211 v2/stable aws✓ classic
core22 20241001 1663 latest/stable canonical✓ base
याचा अर्थ: Tracking = channel.
- Event मधे updates थांबवा.
sudo snap refresh --hold=72h aws-cli
Output:
General refreshes of "aws-cli" held until 2026-10-28T13:20:00+05:30
याचा अर्थ: 3 दिवस surprises नाहीत.
17. अनेक industries मधली खरी उदाहरणं
हे का लागतं?
तेच Linux skill प्रत्येक प्रकारच्या company मध्ये लागतं. वेगवेगळ्या ठिकाणी पाहिलं की लक्षात राहतं.
हे काय आहे?
प्रत्येक row म्हणजे एक काल्पनिक team. कोण हे वापरतं आणि कसं ते दाखवते.
कसं करायचं (step by step)
| Team आणि शहर | ते कसं वापरतात | Command |
|---|---|---|
| Rohit, SaaS startup, Pune | Ubuntu वर weekly security patching | apt update && apt upgrade -y |
| Emma, bank, Zurich | PostgreSQL tested version ला pin | dnf versionlock add postgresql16-server |
| Yusuf, telecom, Istanbul | बदललेली file कोणत्या package ची | rpm -qf /etc/ssh/sshd_config |
| Mei, AI lab, Singapore | No recommends सह slim GPU images | apt-get install --no-install-recommends |
| Carlos, retail, Madrid | वाईट patch rollback | dnf history undo 14 |
| Sana, college, Aurangabad | Lab PCs वर snaps | snap install code --classic |
18. नेहमीच्या errors आणि त्यांचे fixes
हे का लागतं?
हे errors सगळ्यांना येतात. कारण माहीत असलं की तास वाचतात.
हे काय आहे?
आधी नेमका message वाचा. मग खालच्या row शी जुळवा.
कसं करायचं (step by step)
| दिसणारा error | का होतं | Fix कसा करायचा |
|---|---|---|
E: Unable to locate package nginxx | Typo किंवा apt update नाही | Lists update करा आणि नाव तपासा.sudo apt update && apt search nginx |
E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 2101 (unattended-upgr) | दुसरं apt चालू (auto updates) | थांबा; lock delete करू नका.ps -p 2101 -o cmd |
E: Failed to fetch ... 404 Not Found | जुन्या package lists | आधी apt update.sudo apt update |
dpkg: dependency problems prevent configuration | dpkg -i deps install करत नाही | apt ला fix करू द्या.sudo apt -f install -y |
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' | Install मधेच मारलं | Configure पूर्ण करा.sudo dpkg --configure -a |
Error: Unable to find a match: htop | तुमच्याकडे नसलेल्या repo मधे (उदा. EPEL) | Search करा किंवा योग्य repo enable.dnf search htop |
GPG check FAILED / NO_PUBKEY | Repo key नाही किंवा चुकीची | Vendor key import; checks कधी बंद नका.sudo rpm --import KEY_URL |
Error: Failed to download metadata for repo | Network, proxy किंवा चुकीचा repo URL | URL तपासा; सध्या तो repo disable.sudo dnf --disablerepo=REPO makecache |
Problem: conflicting requests ... nothing provides libfoo.so | Incompatible repos mix | Third-party repo काढा किंवा जुळणारं version.dnf repolist |
error: snap "code" requires classic confinement | Snap ला --classic हवं | विश्वास असेल तर --classic.sudo snap install code --classic |
19. Troubleshooting step by step
हे का लागतं?
Install fail झालं तर नाव, repos, locks आणि keys या क्रमाने तपासा.
हे काय आहे?
वरून खाली जा. ज्या step ला problem दिसतो तिथे थांबा.
कसं करायचं (step by step)
- Refresh करा आणि नाव शोधा.
sudo apt update && apt search --names-only NAME
- कोणते repos चालू.
dnf repolist; ls /etc/apt/sources.list.d
- Lock कोणाकडे.
sudo lsof /var/lib/dpkg/lock-frontend
- अर्धवट installs पूर्ण.
sudo dpkg --configure -a && sudo apt -f install
- History बघा.
sudo dnf history | head; tail /var/log/apt/history.log
- Caches साफ करून retry.
sudo dnf clean all && sudo dnf makecache
20. Lab 1: Ubuntu वर पूर्ण package life cycle
हे का लागतं?
Package search, inspect, install, files query, hold, remove आणि purge.
हे काय आहे?
पूर्ण hands-on lab. प्रत्येक step test Linux machine वर करा (EC2 instance, VM किंवा WSL).
कसं करायचं (step by step)
- Refresh आणि search.
sudo apt update -qq && apt search --names-only '^tree$'
Output:
tree/noble 2.1.1-2 amd64
- Install.
sudo apt install -y tree
Output:
Setting up tree (2.1.1-2) ...
- Files आणि owner.
dpkg -L tree | grep bin; dpkg -S $(which tree)
Output:
/usr/bin/tree
tree: /usr/bin/tree
- Hold आणि तपासा.
sudo apt-mark hold tree && apt-mark showhold
Output:
tree set on hold.
tree
- Unhold आणि purge.
sudo apt-mark unhold tree && sudo apt purge -y tree && dpkg -l tree | tail -n1
Output:
dpkg-query: no packages found matching tree
21. Lab 2: history undo आणि rpm audit सह dnf
हे का लागतं?
dnf ने install, rpm ने काय मिळालं ते शोधा, files verify, मग install undo.
हे काय आहे?
पूर्ण hands-on lab. प्रत्येक step test Linux machine वर करा (EC2 instance, VM किंवा WSL).
कसं करायचं (step by step)
- Command कोण देतं.
dnf provides '*/bin/tree'
Output:
tree-2.1.0-1.amzn2023.0.2.x86_64 : File system tree viewer
- Install.
sudo dnf install -y tree
Output:
Complete!
- rpm info आणि files.
rpm -qi tree | head -3; rpm -ql tree | grep bin
Output:
Name : tree
Version : 2.1.0
/usr/bin/tree
- Verify.
rpm -V tree && echo clean
Output:
clean
- शेवटची transaction undo.
sudo dnf history undo last -y
Output:
Removed:
tree-2.1.0-1.amzn2023.0.2.x86_64
Complete!
Ravindra Bagale's Tip
Install with apt or dnf, ask questions with dpkg or rpm. And before any patch on a production server, note the history ID or save apt-mark showmanual, so you can roll back in minutes.
Ravindra Bagale's Tip – मराठी
Install apt किंवा dnf ने, प्रश्न dpkg किंवा rpm ने. आणि production server वर कोणत्याही patch आधी history ID नोंदवा किंवा apt-mark showmanual save करा, म्हणजे minutes मधे rollback.
Ravindra Bagale's Tip – हिंदी
Install apt या dnf से, सवाल dpkg या rpm से. और production server पर किसी भी patch से पहले history ID नोट करें या apt-mark showmanual save करें, ताकि minutes में rollback हो सके.
22. नेहमी विचारले जाणारे प्रश्न
प्र. apt की apt-get?
माणसांसाठी apt (छान output); scripts मधे apt-get (stable output).
प्र. yum की dnf?
dnf हा नवा yum; RHEL 8+ वर yum dnf कडे.
प्र. apt update लागतो पण dnf आधी का नाही?
apt स्वतः lists refresh करत नाही; dnf जुना metadata आपोआप refresh करतो.
प्र. dnf update आणि dnf upgrade सारखेच?
हो.
प्र. Amazon Linux वर .deb install?
नाही, .rpm किंवा container.
प्र. remove vs purge?
purge config files पण delete करतो.
प्र. Snap की apt?
System packages साठी apt; स्वतःचं bundle आणि auto updates हवे त्या apps साठी snap.
प्र. dpkg lock delete करणं safe?
नाही. थांबा किंवा process शोधा; delete केल्याने database बिघडू शकतो.
23. मुलाखत प्रश्न आणि उत्तरं
Beginner level
प्र. Ubuntu वर nginx install?
sudo apt update && sudo apt install nginx.
प्र. Amazon Linux वर nginx?
sudo dnf install nginx.
प्र. apt update काय करतो?
फक्त package lists refresh.
प्र. /usr/bin/curl कोणत्या package ची?
dpkg -S किंवा rpm -qf /usr/bin/curl.
Mid level level
प्र. upgrade vs full-upgrade?
full-upgrade पूर्ण करायला packages काढू किंवा जोडू शकतो.
प्र. dnf बदल rollback कसा?
dnf history undo ID.
प्र. Package upgrade कसं थांबवायचं?
apt-mark hold किंवा dnf versionlock add.
प्र. Missing command चं package?
dnf provides '*/bin/cmd' किंवा apt-file search.
Senior level
प्र. 300 servers safely patch कसे?
Staged rings, local mirror किंवा snapshot repo, critical packages hold, history IDs, health checks, automatic reboot windows.
प्र. apt-key पेक्षा signed-by चांगलं का?
Key फक्त त्या repo साठी trusted, प्रत्येक repo साठी नाही.
प्र. Tampered system files कसे ओळखायचे?
rpm -Va किंवा debsums, package database शी तुलना.
प्र. Packages सह reproducible builds?
नेमकी versions pin, snapshot repos, lock files, आणि images एकदाच build.
घरी करून बघा
- तुमच्या machine वर किती packages installed ते मोजा (dpkg -l | grep -c ^ii किंवा rpm -qa | wc -l). /bin/ls चा owner शोधा.
- htop install करा, hold करा, upgrade करून बघा, मग unhold करून remove. वापरलेला प्रत्येक command लिहा.
सराव Tasks
Amravati Agro Market हा अमरावती मधला शेती व्यवसाय आहे. Anjali Thakre त्यांचं IT व cloud काम पाहतात. त्यांचे पैसे INR मध्ये मोजले जातात आणि AWS resources ap-south-1 Region मध्ये चालतात. खालच्या tasks मध्ये तुम्ही या lesson मध्ये शिकलेलं वापरून त्यांची खरी कामं करता. सगळी नावं, account IDs, IP addresses व numbers सरावासाठी काल्पनिक आहेत.
0 / 16
सोपं Lists refresh
का: Software safely install हवं.
काय करायचं: Ubuntu वर package lists refresh.
- हे काम करणारा Linux command शोधा.
- Task ला लागणारे options (उदा. -r, -h) जोडा.
- File नावं, folders किंवा users योग्य क्रमाने लिहा.
- System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.
सोपं apt install
का: Software safely install हवं.
काय करायचं: Prompt शिवाय Ubuntu वर nginx.
- हे काम करणारा Linux command शोधा.
- Task ला लागणारे options (उदा. -r, -h) जोडा.
- File नावं, folders किंवा users योग्य क्रमाने लिहा.
- System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.
सोपं apt search
का: Software safely install हवं.
काय करायचं: apt मधे redis शोधा.
- हे काम करणारा Linux command शोधा.
- Task ला लागणारे options (उदा. -r, -h) जोडा.
- File नावं, folders किंवा users योग्य क्रमाने लिहा.
- System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.
सोपं dnf install
का: Software safely install हवं.
काय करायचं: Amazon Linux वर prompt शिवाय git.
- हे काम करणारा Linux command शोधा.
- Task ला लागणारे options (उदा. -r, -h) जोडा.
- File नावं, folders किंवा users योग्य क्रमाने लिहा.
- System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.
सोपं सगळे rpm packages
का: Software safely install हवं.
काय करायचं: सगळे installed rpm packages.
- हे काम करणारा Linux command शोधा.
- Task ला लागणारे options (उदा. -r, -h) जोडा.
- File नावं, folders किंवा users योग्य क्रमाने लिहा.
- System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.
सोपं dpkg list
का: Software safely install हवं.
काय करायचं: dpkg ने packages list करून nginx filter.
- हे काम करणारा Linux command शोधा.
- Task ला लागणारे options (उदा. -r, -h) जोडा.
- File नावं, folders किंवा users योग्य क्रमाने लिहा.
- System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.
सोपं Snaps list
का: Software safely install हवं.
काय करायचं: Installed snaps list.
- हे काम करणारा Linux command शोधा.
- Task ला लागणारे options (उदा. -r, -h) जोडा.
- File नावं, folders किंवा users योग्य क्रमाने लिहा.
- System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.
मध्यम Config सह काढा
का: Software safely install हवं.
काय करायचं: Config files सह apache2 काढा.
- हे काम करणारा Linux command शोधा.
- Task ला लागणारे options (उदा. -r, -h) जोडा.
- File नावं, folders किंवा users योग्य क्रमाने लिहा.
- System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.
मध्यम File कोण देतो?
का: Software safely install हवं.
काय करायचं: semanage command कोणतं package देतं.
- हे काम करणारा Linux command शोधा.
- Task ला लागणारे options (उदा. -r, -h) जोडा.
- File नावं, folders किंवा users योग्य क्रमाने लिहा.
- System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.
मध्यम Package ची dnf history
का: Software safely install हवं.
काय करायचं: फक्त nginx ची dnf transaction history list.
- हे काम करणारा Linux command शोधा.
- Task ला लागणारे options (उदा. -r, -h) जोडा.
- File नावं, folders किंवा users योग्य क्रमाने लिहा.
- System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.
मध्यम Updates आहेत?
का: Software safely install हवं.
काय करायचं: Install न करता available updates.
- हे काम करणारा Linux command शोधा.
- Task ला लागणारे options (उदा. -r, -h) जोडा.
- File नावं, folders किंवा users योग्य क्रमाने लिहा.
- System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.
मध्यम File कोणाच्या package चा
का: Software safely install हवं.
काय करायचं: /etc/ssh/sshd_config कोणाच्या package चं.
- हे काम करणारा Linux command शोधा.
- Task ला लागणारे options (उदा. -r, -h) जोडा.
- File नावं, folders किंवा users योग्य क्रमाने लिहा.
- System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.
मध्यम Package मधल्या files
का: Software safely install हवं.
काय करायचं: nginx rpm ने install केलेल्या files.
- हे काम करणारा Linux command शोधा.
- Task ला लागणारे options (उदा. -r, -h) जोडा.
- File नावं, folders किंवा users योग्य क्रमाने लिहा.
- System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.
मध्यम dpkg owner
का: Software safely install हवं.
काय करायचं: Ubuntu वर /usr/bin/curl कोणाचं.
- हे काम करणारा Linux command शोधा.
- Task ला लागणारे options (उदा. -r, -h) जोडा.
- File नावं, folders किंवा users योग्य क्रमाने लिहा.
- System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.
मध्यम .deb install
का: Software safely install हवं.
काय करायचं: dpkg ने local app_1.2_amd64.deb.
- हे काम करणारा Linux command शोधा.
- Task ला लागणारे options (उदा. -r, -h) जोडा.
- File नावं, folders किंवा users योग्य क्रमाने लिहा.
- System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.
मध्यम snap install
का: Software safely install हवं.
काय करायचं: Classic snap code install.
- हे काम करणारा Linux command शोधा.
- Task ला लागणारे options (उदा. -r, -h) जोडा.
- File नावं, folders किंवा users योग्य क्रमाने लिहा.
- System files/users बदलत असाल तर sudo वापरा. Check answer दाबा.
24. संबंधित chapters
- DevOps साठी Linux Ops Refresh
- Automation साठी Bash Scripting
- Linux grep आणि find Commands Examples सह
- Linux Servers मध्ये Passwordless SSH
थोडक्यात सांगायचं तर
- apt update refresh; apt install, remove, purge, autoremove.
- Install आधी apt search, show, apt-cache policy.
- dpkg -l, -L, -S प्रश्नांची उत्तरं.
- dnf install, upgrade --security, provides, history undo.
- Audits साठी rpm -qa, -qf, -ql, -V.
- Signed keys सह repos; versions hold; bundled apps साठी snap.
उजळणी, तुलना आणि मुलाखत cards
हा lesson काही मिनिटांत revise करा. Cards phone वर save करा किंवा PNG download करा. प्रत्येक card वरचा QR हा lesson उघडतो.








अजून cards: Ravi Sir's Cards.