How do I upgrade (restore) the manually downgraded downgrade packages in Ubuntu?
I was trying to install open-cv on a Jetson TX2(OS-Ubuntu 18.04.4 LTS), and there were some dependencies' version issues. So, I downgraded several dependencies manually from x:x.x.x-0ubuntu0.18.04.1 to x:x.x.x.
These all the packages that I downgrade:
sudo apt-get install -y libavcodec-dev=7:3.4.2-2
sudo apt install libavutil55=7:3.4.2-2
sudo apt install gir1.2-pango-1.0=1.40.14-1
sudo apt install libcairo2-dev=1.12.10
sudo apt install libcairo2=1.15.10-2
sudo apt install gir1.2-pango-1.0=1.40.14-1
sudo apt install libcairo2-dev=1.12.10
sudo apt install libcairo2=1.15.10-2
sudo apt install libcairo-gobject2=1.15.10-2
sudo apt install libxcb-shm0=1.13-1
sudo apt install libpango1.0.0=1.40.14-1
sudo apt install libpango-1.0.0=1.40.14-1
sudo apt install libpangocairo-1.0-0=1.40.14-1
sudo apt install libpangoft2-1.0-0=1.40.14-1
sudo apt install libpangoxft1.0-0=1.40.14-1
sudo apt install libpangoxft-1.0-0=1.40.14-1
sudo apt install libswscale4=7:3.4.2-2
Currently, I would like to upgrade jetpack package from 4.3 to 4.4(sudo apt-get install nvidia-jetpack
) but it gives us the dependency error because of the packages I manually downgraded:
The following packages have unmet dependencies:
nvidia-jetpack : Depends: libopencv-python (= 4.1.1-2-gd5a58aa75) but it is not going to be installed
Depends: libvisionworks-sfm-dev (= 0.90.4) but it is not going to be installed
Depends: libvisionworks-samples (= 1.6.0.500n) but it is not going to be installed
Depends: libvisionworks-tracking-dev (= 0.88.2) but it is not going to be installed
Depends: vpi-samples (= 0.1.0) but it is not going to be installed
Depends: libopencv (= 4.1.1-2-gd5a58aa75) but it is not going to be installed
Depends: libopencv-samples (= 4.1.1-2-gd5a58aa75) but it is not going to be installed
Depends: libopencv-dev (= 4.1.1-2-gd5a58aa75) but it is not going to be installed
Depends: opencv-licenses (= 4.1.1-2-gd5a58aa75) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
What I have tried
Upgrade for all packages at once
I am trying to upgrade to the original version.
apt-get update
apt-get upgrade
Gave me some error:
E: The repository 'http://archive.canonical.com/ubuntu precise Release' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
So, I followed the answer from E: The repository 'http//archive.canonical.com precise Release' is not signed it didn't fix it.
install for a specific packages
Since I know the name of several packages that I downgraded, I tried to upgrade by --only-upgrade option. For example, to upgrade the package I downgraded, I used
sudo apt-get install --only-upgrade libavcodec-dev
However, it gives me
Reading package lists... Done
Building dependency tree
Reading state information... Done
libavcodec-dev is already the newest version (7:3.4.2-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. again.
I know that libavcodec-dev(7:3.4.2-2) is not the latest version since I downgrade it. However, apt-get thinks what I downgrade is the newest version.
How can I fix it?