Checking on dpkg package updates
You can check the version of a
Debian package (dpkg) on a
Linux system using the command dpkg -s
pkgName where pkgName is the name of the package.
If you wish to check on whether an upgrade is available for the
package, you should first update your local package index to ensure
your system knows about the latest versions available in the
repositories
with the sudo apt update command. If updates
are available you will see something like
19 packages can be upgraded. Run 'apt list
--upgradable' to see them.
If you want to see whether an update is available for a particular
dpkg package, e.g., winetricks, you can use the command
apt-cache policy pkgName. Because
dpkg manages local .deb files and doesn't
directly check remote repositories, you need to use
APT, which is the
frontend for dpkg to compare the installed version against what is available
in the repositories.
alice@Wonderland:~$ apt-cache policy winetricks
winetricks:
Installed: 20250102-1build1
Candidate: 20250102-1build1
Version table:
*** 20250102-1build1 500
500 http://us.archive.ubuntu.com/ubuntu resolute/universe amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu resolute/universe i386 Packages
100 /var/lib/dpkg/status
alice@Wonderland:~$
The Installed and
Candidate lines indicate whether an update is
available.
- Installed: The version currently running on your system.
- Candidate: The highest version available in the repositories that your
system is ready to install.
If the Candidate version is newer (higher) than the Installed version, an
update is available. If the version is the same then a newer version is not
available.
Alternatively, you can use the command apt list
--upgradable pkgName to check on whether an update is
available for a single package. If it returns the package name, an update is
available. If it returns nothing, the package is already up-to-date.
alice@Wonderland:~$ apt list --upgradable winetricks
alice@Wonderland:~$
To see a list of all packages that you can upgrade, you can use
apt list --upgradable.
[ More Info ]
[/os/unix/linux/utilities/package]
permanent link
Another app is currently holding the yum lock
After resolving a problem with network connectivity on a
CentOS 7 Linux
server, I attempted to install a package using
yum, but received the message "Another app is currently
holding the yum lock; waiting for it to exit..."
# yum install rdesktop
Loaded plugins: fastestmirror, langpacks
Existing lock /var/run/yum.pid: another copy is running as pid 16020.
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: PackageKit
Memory : 46 M RSS (1.4 GB VSZ)
Started: Fri Jul 29 12:08:28 2016 - 01:14 ago
State : Running, pid: 16020
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: PackageKit
Memory : 46 M RSS (1.4 GB VSZ)
Started: Fri Jul 29 12:08:28 2016 - 01:16 ago
State : Sleeping, pid: 16020
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: PackageKit
Memory : 46 M RSS (1.4 GB VSZ)
Started: Fri Jul 29 12:08:28 2016 - 01:18 ago
State : Sleeping, pid: 16020
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: PackageKit
Memory : 46 M RSS (1.4 GB VSZ)
Started: Fri Jul 29 12:08:28 2016 - 01:20 ago
State : Sleeping, pid: 16020
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: PackageKit
Memory : 46 M RSS (1.4 GB VSZ)
Started: Fri Jul 29 12:08:28 2016 - 01:22 ago
State : Sleeping, pid: 16020
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: PackageKit
Memory : 46 M RSS (1.4 GB VSZ)
Started: Fri Jul 29 12:08:28 2016 - 01:24 ago
State : Sleeping, pid: 16020
^C
Exiting on user cancel.
#
I checked the process and saw the following information:
# ps aux | grep yum
root 16020 28.4 2.3 1455028 79512 ? SN 12:08 1:16 /usr/bin/python /usr/share/PackageKit/helpers/yum/yumBackend.py refresh-cache yes
root 16354 0.0 0.0 112652 952 pts/0 S+ 12:12 0:00 grep --color=auto yum
#
[ More Info ]
[/os/unix/linux/utilities/package]
permanent link
Building RPMs
The Red Hat Package Manager (RPM
) is a tool that automates the installation and uninstallation of
software on a Linux system and allows you to more easily manage installed
software. The rpm command works with software packaged into rpm
files. You can use the rpm command with rpm files to determine what other
software is required prior to installing the new software, i.e. you can see the
"dependencies" of the new software. You can use the rpm command to easily
obtain details on all software installed on a system that was installed via an
rpm package. For instance rpm -a will show a list of all installed
packages. If I was interested in only packages related to
Clamav, a free antivirus scanner, I
could filter the output with grep, e.g. rpm -a | grep clamav.
I might then see the following on a system:
$rpm -qa | grep clamav
clamav-db-0.80-2.0.rh9.rf
clamav-0.80-2.0.rh9.rf
clamav-milter-0.80-2.0.rh9.rf
I could get details for one of those packages, clamav, with rpm -qi
clamav.
If you wish to build your own RPM files, you can find information on how to
do so at Dag Wieer's Red Hat
Package Manager v4 webpage and at IBM's
Packaging
software with RPM webpage.
The RPM format is not restricted to just the Red Hat distributions of Linux,
but is used on other Linux distributions as well, such as SuSE's and Caldera's
distributions.
References:
- Red Hat
Package Manager v4
Dag Wieers
September 21, 2003
-
Packaging software with RPM
Dan Poirier
(poirier@us.ibm.com)
Software engineer, IBM
01 Nov 2001
[/os/unix/linux/utilities/package]
permanent link