For example:
The following command will install all packages that match it's pattern:
sudo apt-get install k3b-*
If I want to use that instruction but don't want to install one specific package with broken dependencies, how do I do that?
I have tried this but not works.
sudo apt-get install "$(apt-cache --no-generate pkgnames k3b | grep -v extrathemes | tr '\n' ' ')" :
sam@/home/sam/code/ros/ai/cram/roslisp_repl$ sudo apt-get install "$(apt-cache --no-generate pkgnames k3b | grep -v extrathemes | tr '\n' ' ')"
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package k3b-dbg k3b-data k3b
sam@/home/sam/code/ros/ai/cram/roslisp_repl$
Thank you~
You can do
Say you don't want to install the k3b-extrathemes package. There might be no practical way to do this but to list all the packages except for the one:
sudo apt-get install k3b-data k3b-dbg
.However you can do that with some aid:
That's not terribly partical.
apt-cache ...
returns the name of the packages,grep -v PACKAGENAME
excludes the packages and thetr
command replaces new lines by spaces.I discovered a much simpler way of doing this:
This will use
aptitude
instead ofapt-get
- which provides you with more options. When you see something like the following:Instead of pressing 'y', type the following:
That's a '-' followed by the name of the package to skip. Then you can proceed with the installation as per normal.
You can trivially do this with apt; if you want to install
foo
but notbar
, do this:i.e. append a hyphen to
bar
. From the apt-get man page:This apparently works for packages that would be installed, as well as those that are already installed.