Рет қаралды 335
In this video we discuss the way we can create, install, and uninstall .deb packages in Debian Linux.
1. Create a Directory for Your Project:
mkdir hello-world
cd hello-world
2. Write the C++ Program (main.cpp)
3. Compile the Program:
g++ main.cpp -o hello-world
4. Create the Directory Structure for the .deb Package:
mkdir -p hello-world-1.0/usr/local/bin
mkdir -p hello-world-1.0/DEBIAN
5. Move the executable:
mv hello-world hello-world-1.0/usr/local/bin/
6. Create the control file:
vim hello-world-1.0/DEBIAN/control
7. Add the following content to the control file:
Package: hello-world
Version: 1.0
Section: base
Priority: optional
Architecture: amd64
Maintainer: Your Name your.email@example.com
Description: A simple Hello World program
This is a simple Hello World program written in C++.
8. Set the necessary permissions:
chmod 755 hello-world-1.0/DEBIAN
chmod 755 hello-world-1.0/usr
chmod 755 hello-world-1.0/usr/local
chmod 755 hello-world-1.0/usr/local/bin
chmod 755 hello-world-1.0/usr/local/bin/hello-world
9. Build the package:
dpkg-deb --build hello-world-1.0
10. Install the package:
sudo dpkg -i hello-world-1.0.deb
11. Run the program to test:
hello-world
12. Uninstall the Package:
sudo dpkg -r hello-world
or:
sudo apt remove hello-world
13. Remove Configuration Files (if any):
sudo dpkg --purge hello-world
or:
sudo apt purge hello-world
14. Clean Up Unused Dependencies:
sudo apt autoremove
15. Verify Uninstallation:
which hello-world
All Open Source!
Arashtad provides high quality tutorials, eBooks, articles and documents, design and development services, over 400 free online tools, frameworks, CMS, WordPress plugins, Joomla extensions, and other products.
More Courses ▶ tuts.arashtad....
Business Inquiries ▶ arashtad.com/b...
Affiliate Programs ▶ arashtad.com/a...
eBooks ▶ press.arashtad...
Our Products ▶ market.arashta...
Our Services ▶ arashtad.com/s...
Our Portfolio ▶ demo.arashtad....
Free Online Tools ▶ tools.arashtad...
Our Blog ▶ blog.arashtad....
Documents ▶ doc.arashtad.com/
Licensing ▶ arashtad.com/l...
About us ▶ arashtad.com/a...
Join Arashtad Network ▶ i.arashtad.com/
Our Social Profiles ▶ arashtad.com/a...
Vimeo ▶ vimeo.com/aras...
Udemy ▶ www.udemy.com/...
GitHub ▶ github.com/ara...
Linkedin ▶ / arashtad
Twitter ▶ / arashtad