Quantcast
Channel: my tech blog » Linux
Viewing all articles
Browse latest Browse all 173

Debian package notes (when apt and Automatic Updater in Ubuntu isn’t good enough)

$
0
0

Just a few jots on handling packages in Ubuntu. This post is a true mess.

Pinning

The bottom line seems to be not to use the Software Updater, but instead go

# apt-get upgrade

How to prevent certain packages from being updated, based upon this Pinning Howto page and the Apt Preferences page which cover the internals as well.

There also the manpage:

$ man apt_preferences

Checking what apt-get would install

# apt-get -s upgrade | less

The packages related to the Linux kernel: linux-generic linux-headers-generic linux-image-generic

It’s worth looking here on  this regrading what packages “kept back means” (but the bottom line is that these packages won’t be installed).

Pinning with dpkg

This doesn’t work with apt-get nor Automatic Updater, following this and this web pages:

List all packages

$ dpkg -l

Wildcards can be used to find specific packages. For example, those related to the current kernel:

$ dpkg -l "*$(uname -r)*"
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                          Version                     Architecture                Description
+++-=============================================-===========================-===========================-===============================================================================================
ii  linux-headers-3.13.0-35-generic               3.13.0-35.62                amd64                       Linux kernel headers for version 3.13.0 on 64 bit x86 SMP
ii  linux-image-3.13.0-35-generic                 3.13.0-35.62                amd64                       Linux kernel image for version 3.13.0 on 64 bit x86 SMP
ii  linux-image-extra-3.13.0-35-generic           3.13.0-35.62                amd64                       Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP

Or, to get just the package names:

$ dpkg -l | awk '{ print $2; }' | grep "$(uname -r)"

Pinning a package

In order to prevent a certain package from being updated, use the “hold” setting for the package. For example, holding the kernel related package automatically (all three packages) as root:

# dpkg -l | awk '{ print $2; }' | grep "$(uname -r)" | while read i ; do echo $i hold ; done | dpkg --set-selections

After this, the listing of these packages is:

$ dpkg -l "*$(uname -r)*"
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                          Version                     Architecture                Description
+++-=============================================-===========================-===========================-===============================================================================================
hi  linux-headers-3.13.0-35-generic               3.13.0-35.62                amd64                       Linux kernel headers for version 3.13.0 on 64 bit x86 SMP
hi  linux-image-3.13.0-35-generic                 3.13.0-35.62                amd64                       Linux kernel image for version 3.13.0 on 64 bit x86 SMP
hi  linux-image-extra-3.13.0-35-generic           3.13.0-35.62                amd64                       Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP

Indeed, the “h” notes that the packages are held. To revert this, use “install” instead of “hold” in the input to dpkg –set-selections above.


Viewing all articles
Browse latest Browse all 173

Latest Images

Trending Articles



Latest Images