run this command to remove broken packages in ubuntu.
sudo dpkg --remove --force-remove-reinstreq package_name
after removing package update your system with command
sudo apt-get update
run this command to remove broken packages in ubuntu.
sudo dpkg --remove --force-remove-reinstreq package_name
after removing package update your system with command
sudo apt-get update
After trying
sudo apt-get update –fix-missing
and
sudo dpkg –configure -a
and
sudo apt-get install -f
the problem of a broken package still exists the solution is to edit the dpkg status file manually.
———–
Unlock the dpkg – (message /var/lib/dpkg/lock)
sudo fuser -vki /var/lib/dpkg/lock
sudo dpkg –configure -a
You can delete the lock file with the following command:
sudo rm /var/lib/apt/lists/lock
You may also need to delete the lock file in the cache directory
sudo rm /var/cache/apt/archives/lock
I had this issue just now. What I did was purge the errant package using dpkg in my case then update and force the reinstall:
sudo dpkg --purge linux-image-3.13.0-35-generic
sudo apt-get update
sudo apt-get -f install
You can use apt-mark:
apt-mark showhold
this will show the packages that are kept in “hold” state so that the package manager won’t auto-upgrade the packages.
From man apt-mark:
showhold
showhold is used to print a list of packages on hold
Error:
Err:13 http://downloads.metasploit.com/data/releases/metasploit-framework/apt lucid InRelease
The following signatures were invalid: KEYEXPIRED 1474234115 KEYEXPIRED 1474234115 KEYEXPIRED 1474234115
Fetched 98.2 kB in 0s (150 kB/s)
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://downloads.metasploit.com/data/releases/metasploit-framework/apt lucid InRelease: The following signatures were invalid: KEYEXPIRED 1474234115 KEYEXPIRED 1474234115 KEYEXPIRED 1474234115
Solution:
$ sudo echo 'deb http://apt.metasploit.com/ lucid main' > /etc/apt/sources.list.d/metasploit-framework.list
$ sudo wget -O - http://apt.metasploit.com/metasploit-framework.gpg.key | apt-key add -
$ sudo apt-get update
$ sudo apt-get -y install metasploit-framework
Simple:
grep ^Package: /var/lib/apt/lists/ppa.launchpad.net_*_Packages
Or more flexible:
grep-dctrl -sPackage . /var/lib/apt/lists/ppa.launchpad.net_*_Packages
For fancier querying, use apt-cache policy and aptitude as described here:
aptitude search '~O LP-PPA-gstreamer-developers'
Execute:
sudo systemctl stop apt-daily.timer
Docker images are pretty minimal, But you can install ping in your official ubuntu docker image via:
apt-get update
apt-get install iputils-ping
Chances are you dont need ping your image, and just want to use it for testing purposes. Above example will help you out.
But if you need ping to exist on your image, you can create a Dockerfile or commit the container you ran the above commands in to a new image.
Commit:
docker commit -m "Installed iputils-ping" --author "Your Name <name@domain.com>" ContainerNameOrId yourrepository/imagename:tag
Dockerfile:
FROM ubuntu
RUN apt-get update && apt-get install -y iputils-ping
CMD bash