การสร้างจากซอร์ส: configure, make และ make install
เมื่อไม่มีแพ็กเกจให้ใช้ เรียนรู้กระบวนการสร้างจากซอร์สแบบดั้งเดิมด้วย configure, make และ make install รวมถึงความเกี่ยวข้องกับตัวจัดการแพ็กเกจ
การสร้างจากซอร์ส: configure, make และ make install เป็นบทเรียน Linux Command Line Mastery ฟรีบน CoddyKit นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน Linux Command Line Mastery และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส Linux Command Line Mastery มีบทเรียนทั้งหมด 4 บทเรียน
บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ
When Packages Are Not Enough
Package managers like apt and dnf cover most needs, but sometimes you must build software from source: a newer version, a missing distro package, or custom compile options.
The Three-Step Dance
Most source projects follow the same ritual:
./configurechecks your systemmakecompiles the codemake installcopies files into place
Getting the Source
Source usually arrives as a compressed tarball, which ties back to the archiving skills you already learned.
tar -xzf hello-2.12.tar.gz
cd hello-2.12Installing Build Tools
You need a compiler and make. On Debian/Ubuntu the meta-package build-essential provides them.
sudo apt install build-essentialRunning configure
./configure probes for libraries and generates a Makefile. The --prefix option chooses where it will install.
./configure --prefix=/usr/localCompiling with make
make reads the Makefile and compiles. Use -j to parallelize across CPU cores for speed.
make -j4Installing the Build
make install copies binaries and data into the prefix. Installing to system paths usually needs root.
sudo make installHandling Missing Dependencies
If configure complains about a missing library, install its -dev package, which provides headers needed for compiling.
sudo apt install libssl-devCleaning Up
make clean removes compiled objects so you can rebuild from scratch.
make cleanUninstalling Source Builds
Source installs are not tracked by your package manager. Many projects offer make uninstall, or you can install to /usr/local to keep them separate from packaged software.
sudo make uninstallSource vs Packages
Prefer packages when possible: they handle dependencies and updates. Build from source only when you need control or a version your distro lacks.
Quick Check
Which step actually compiles the program?
Recap
You can build software the classic way:
- Extract the tarball with
tar ./configure --prefix=...sets up the buildmake -jcompiles,sudo make installinstalls- Install -dev packages for missing headers
Reach for source builds only when packages cannot meet your needs.
เรียนรู้ Linux Command Line Mastery ด้วย AI tutor — ฟรี
เขียนและเรียกใช้โค้ดจริงในเบราว์เซอร์ของคุณ รับความช่วยเหลือทันทีจาก AI tutor 24/7 และเรียนรู้ต่อจากที่คุณหยุดบนเว็บหรือในแอป
- คอร์ส
- 12
- บทเรียน
- 48
คำถามที่พบบ่อย
บทเรียน “การสร้างจากซอร์ส: configure, make และ make install” ฟรีหรือไม่
ใช่ — ข้อความเต็มของ “การสร้างจากซอร์ส: configure, make และ make install” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส Linux Command Line Mastery ให้อัปเกรดเป็น CoddyKit PRO คอร์ส Linux Command Line Mastery มีบทเรียนทั้งหมด 4 บทเรียน
คุณจะเรียนรู้อะไรในบทเรียน “การสร้างจากซอร์ส: configure, make และ make install”
เมื่อไม่มีแพ็กเกจให้ใช้ เรียนรู้กระบวนการสร้างจากซอร์สแบบดั้งเดิมด้วย configure, make และ make install รวมถึงความเกี่ยวข้องกับตัวจัดการแพ็กเกจ คุณปฏิบัติ Linux Command Line Mastery ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน
คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน Linux Command Line Mastery หรือไม่
ไม่จำเป็นต้องมีประสบการณ์มาก่อน Linux Command Line Mastery บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน
บทเรียน “การสร้างจากซอร์ส: configure, make และ make install” ใช้เวลานานแค่ไหน
บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย
ฉันเขียนและรันโค้ดในบทเรียน Linux Command Line Mastery นี้ได้ไหม
ได้ บทเรียน Linux Command Line Mastery ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ
บทเรียนทั้งหมดในหลักสูตรนี้
- การจัดเก็บและบีบอัดไฟล์: `tar`, `gzip`, `bzip2`
- การจัดการแพ็กเกจ (Debian/Ubuntu): `apt`, `dpkg`
- การจัดการแพ็กเกจ (CentOS/Fedora): `yum`, `dnf`, `rpm`
- การสร้างจากซอร์ส: configure, make และ make install