我正在尝试使用Ubuntu20.04终端在我的系统上安装OpenFace工具包。安装需要gcc/g++版本8。我在我的系统上检查了当前的gcc版本,结果显示安装的版本是gcc-11。有没有办法用gcc-8取代gcc-11的版本,或者下载一套gcc-8软件包,然后再安装呢?非常感谢你的帮助,谢谢。
发布于 2022-07-21 07:41:35
gcc-8包已经在Ubuntu22.04和更高版本的默认存储库中停止使用,但它仍然可以在Ubuntu20.04默认存储库中使用。要在Ubuntu22.04中从Ubuntu20.04安装gcc-8软件包,请运行以下命令:
sudo apt update
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-8/gcc-8_8.4.0-3ubuntu2_amd64.deb
wget http://mirrors.edge.kernel.org/ubuntu/pool/universe/g/gcc-8/gcc-8-base_8.4.0-3ubuntu2_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-8/libgcc-8-dev_8.4.0-3ubuntu2_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-8/cpp-8_8.4.0-3ubuntu2_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-8/libmpx2_8.4.0-3ubuntu2_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/main/i/isl/libisl22_0.22.1-1_amd64.deb
sudo apt install ./libisl22_0.22.1-1_amd64.deb ./libmpx2_8.4.0-3ubuntu2_amd64.deb ./cpp-8_8.4.0-3ubuntu2_amd64.deb ./libgcc-8-dev_8.4.0-3ubuntu2_amd64.deb ./gcc-8-base_8.4.0-3ubuntu2_amd64.deb ./gcc-8_8.4.0-3ubuntu2_amd64.deb
原答复(现已过时):
gcc-8软件包已经在Ubuntu22.04和更高版本的默认存储库中停止使用。要在Ubuntu22.04中从Ubuntu21.10安装gcc-8软件包,请运行以下命令:
sudo apt update
sudo apt remove gcc-11 # optional
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-8/gcc-8_8.5.0-0ubuntu4_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-8/gcc-8-base_8.5.0-0ubuntu4_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-8/libgcc-8-dev_8.5.0-0ubuntu4_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-8/cpp-8_8.5.0-0ubuntu4_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-8/libmpx2_8.5.0-0ubuntu4_amd64.deb
sudo apt install ./libmpx2_8.5.0-0ubuntu4_amd64.deb ./cpp-8_8.5.0-0ubuntu4_amd64.deb ./gcc-8-base_8.5.0-0ubuntu4_amd64.deb ./libgcc-8-dev_8.5.0-0ubuntu4_amd64.deb ./gcc-8_8.5.0-0ubuntu4_amd64.deb
我删除了gcc-11在上面的命令,因为你在你的问题中提到,你也想删除它。如果您想让gcc-11安装在gcc-8旁边,那么请省略sudo apt remove gcc-11
命令。
发布于 2022-09-11 19:02:00
另一个解决方案是Jodeli提出的‘gcc 7’没有安装候选问题。
在终端中键入sudo nano /etc/apt/sources.list
并在文件末尾添加以下内容:
deb [arch=amd64] http://archive.ubuntu.com/ubuntu focal main universe
然后执行:
sudo apt update
sudo apt install gcc-8 g++-8
另外一个好的做法是使用update-alternatives
来管理gcc的不同版本。例如,如果在这些步骤之后,您的/usr/bin目录中有gcc-8和gcc-11,则在终端中运行:
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 20
sudo update-alternatives --config gcc
我不确定它是否比卡雷尔的好得多,因为它们都会导致依赖关系的问题。我想编辑/etc/apt/sources.list
可能会更舒服,因为不需要手动下载所有的包。
发布于 2022-07-21 08:38:14
我认为您没有将OpenFace版本从2.0.0升级到2.2.0
这个脚本14个月前已经升级了。
...
# If we're not on 18.04
sudo apt-get -y update
if [[ `lsb_release -rs` != "18.04" ]] then
echo "Adding ppa:ubuntu-toolchain-r/test apt-repository "
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get -y update
fi
sudo apt-get -y install build-essential
sudo apt-get -y install gcc-8 g++-8
...
https://github.com/TadasBaltrusaitis/OpenFace
希望这能有所帮助。
https://askubuntu.com/questions/1419593
复制相似问题