查阅得知安装codeblocks执行如下命令
sudo add-apt-repository ppa:pasgui/ppa
sudo apt-get update
sudo apt-get install codeblocks
sudo apt-get update时出现如下报错:
N: See apt-secure(8) manpage for repository creation and user configuration details.
尝试 cd /var/lib/dpkg;sudo mv info info.bak;sudo mkdir info;sudo apt-get update 仍出现上述问题,遂尝试用ubuntu系统自带的应用商店安装也未能正常下载安装,直接卡死。
再次尝试手动下载官网程序20余兆,安装程序sudo dpkg -i codeblocks-contrib-dbg_16.01_ubuntu16.04.1_amd64.deb时出现错误部分如下:
dpkg: warning: files list file for package 'qmlscene' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libncurses5:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'baobab' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'hplip' missing; assuming package has no files currently installed
尝试如下三种方式均未能正常安装,
sudo apt-get -o Dpkg::Options::="--force-overwrite" -f install
sudo apt-get install --fix-missing
sudo apt-get install -f
最后决定还是先处理更新源列表问题,查阅得知,删除这两个文件,重新更新源即可
sudo rm -rf /var/lib/apt/lists/*
sudo rm -rf /etc/apt/sources.list.d/*
sudo apt-get update
为了防止出现更大的错误,两个文件备份后删除,更新源正常。
此时接着安装codeblocks,首先检查是否缺乏相关依赖执行
sudo apt install build-essential
出现如下提示:
codeblocks-contrib-dbg : Depends: codeblocks-contrib (= 16.01~ubuntu16.04.1) but it is not going to be installed
Depends: codeblocks-dbg (= 16.01~ubuntu16.04.1) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
按提示执行sudo apt-get -f install后sudo apt install build-essential正常,
接着安装gcc,执行此命令 sudo apt-get install gcc ,最后安装 codeblocks,
sudo apt-get install codeblocks即正常。
以上为个人笔记,其中的深层缘由暂未了解,其中的解决方法来源于网上各位大佬的解答分享和自己的推测和实践得来,若有不对的地方,请大家指教,谢谢