본문 바로가기

OS/Linux

Ubuntu 패키지 특정 버전으로 설치하기

패키지 버전 형태 확인

패키지마다 버전 형식이 다르므로 버전이 어떤 형태로 표시되는지 확인 (설치 여부와 무관)

apt-cache policy <패키지명>
root@mwjin-PC08:~# apt-cache policy unzip
unzip:
  Installed: (none)
  Candidate: 6.0-25ubuntu1
  Version table:
     6.0-25ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages

 

패키지 저장소나 릴리즈 노트 등에서 원하는 버전 확인

ex) changelogs.ubuntu.com/changelogs/pool/main/u/unzip/unzip_6.0-25ubuntu1/changelog

 

패키지 설치

sudo apt-get install <패키지명>=<버전>
root@mwjin-PC08:~# sudo apt-get install unzip=6.0-25ubuntu1
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  zip
The following NEW packages will be installed:
  unzip
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 169 kB of archives.
After this operation, 593 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 unzip amd64 6.0-25ubuntu1 [169 kB]
Fetched 169 kB in 2s (85.7 kB/s)
Selecting previously unselected package unzip.
(Reading database ... 31885 files and directories currently installed.)
Preparing to unpack .../unzip_6.0-25ubuntu1_amd64.deb ...
Unpacking unzip (6.0-25ubuntu1) ...
Setting up unzip (6.0-25ubuntu1) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for man-db (2.9.1-1) ...