Can someone please help me on how to install the following patch to solve a CVE? https://launchpad.net/ubuntu/+source/ghostscript/9.22~dfsg+1-0ubuntu1
1 Answers
The patch you've indicated is already merged into the Ubuntu packaging and has been present since at least 18.04 in the repositories. In 18.04, there's also the newer security release version of 9.26~dfsg+0-0ubuntu0.18.04.13
as well which has more patches and fixes for issues already merged in it. (available in the -updates and -security repositories for 18.04, and -security is usually enabled by default).
Ubuntu 20.04 and later already have a much newer version of Ghostscript which is already at and beyond the patch level you've indicated. There is no action needed on your part unless you are using a version of Ubuntu older than 18.04 (in which case, time to update your system to a newer Ubuntu)
Check the version of the package you're using with apt-cache policy ghostscript
- if the 'Installed' value is a version at or later than 9.22~dfsg+1-0ubuntu1
or 9.26~dfsg+0-0ubuntu0.18.04.13
(for 18.04) systems then you're already good. If you're on Ubuntu 20.04 or newer, you don't even have to check as it's already part of the packaging.

- 74,764
apt-cache policy ghostscript
– Thomas Ward Oct 12 '20 at 12:47