Thursday, September 24, 2026

Ubuntu ดู package version ก่อนจะ apt install

  • ประเด็นคือจะติดตั้ง mysql-server แต่อยากได้ version 8 ไม่แน่จะ
  • จะตรวจสอบสิ่งที่เรากำลังจะติดตั้งอย่างไร

$ apt-cache policy <package_name>

Exam

$ apt-cache policy mysql-server

mysql-server:

  Installed: (none)

  Candidate: 8.0.46-0ubuntu0.24.04.4

  Version table:

     8.0.46-0ubuntu0.24.04.4 500

        500 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages

        500 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages

     8.0.36-2ubuntu3 500

        500 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages

$ apt-cache policy mysql-server-8.0 

mysql-server-8.0:

  Installed: (none)

  Candidate: 8.0.46-0ubuntu0.24.04.4

  Version table:

     8.0.46-0ubuntu0.24.04.4 500

        500 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages

        500 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages

     8.0.36-2ubuntu3 500

        500 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages


No comments:

Post a Comment

Popular Posts