현재 버전과 업데이트할 패키지의 향후 버전을 알 수 있는 간단한 yum 명령이 있습니까?
나는 지금 대략:
yum list updates
하지만 이는 새 버전의 패키지만 인쇄합니다...
답변1
설치된 모든 패키지를 나열하려면 다음을 사용할 수 있습니다.
# yum list installed
특정 패키지의 경우 다음을 시도하십시오.
# yum info httpd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.vietoss.com
* epel: ftp.cuhk.edu.hk
* extras: mirror.vietoss.com
* rpmforge: ftp-stud.fht-esslingen.de
* updates: mirror.vietoss.com
Installed Packages
Name : httpd
Arch : x86_64
Version : 2.2.3
Release : 43.el5.centos
Size : 3.3 M
Repo : installed
Summary : Apache HTTP Server
URL : http://httpd.apache.org/
License : Apache Software License
Description: The Apache HTTP Server is a powerful, efficient, and extensible
: web server.
Available Packages
Name : httpd
Arch : x86_64
Version : 2.2.3
Release : 53.el5.centos.3
Size : 1.2 M
Repo : updates
Summary : Apache HTTP Server
URL : http://httpd.apache.org/
License : Apache Software License
Description: The Apache HTTP Server is a powerful, efficient, and extensible
: web server.
# yum list httpd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.vietoss.com
* epel: ftp.cuhk.edu.hk
* extras: mirror.vietoss.com
* rpmforge: ftp-stud.fht-esslingen.de
* updates: mirror.vietoss.com
Installed Packages
httpd.x86_64 2.2.3-43.el5.centos installed
Available Packages
httpd.x86_64 2.2.3-53.el5.centos.3 updates
답변2
이를 더 많이 스크립팅하려면 rpm에서 직접 나가는 것이 더 쉬울 수 있습니다. 다음을 수행하여 설치한 패키지 목록과 해당 버전을 얻을 수 있습니다
rpm -qa --queryformat "%{NAME} %{VERSION}\n"
.
rpm --querytags
%{VARIABLES}에 넣을 수 있는 모든 항목을 찾기 위해 실행할 수 있습니다 . 형식은 printf와 같은 인수를 사용합니다(예를 들어 개행의 경우 \n, 탭의 경우 \t 등).