apt

Linux shell

我的未来我决定 提交于 2019-12-03 06:29:06
// 在桌面菜单(.....)管理出右键 得到桌面设置对话框 //chmod + x ...py 赋予权限 //验证 ssh // /etc/init.d/ssh status // vi /etc/ssh/sshd_config 服务配置 // /etc/init.d/networking restart 重启网络 //安装cmake //wget https://github.com/Kitware/CMake/releases/download/v3.15.0-rc3/cmake-3.15.0-rc3-Linux-x86_64.sh 参考链接:https://jingyan.baidu.com/article/3c343ff7e366820d3679637f.html 重置完之后发现网络适配器显示未托管。 解决办法: leafpad /etc/NetworkManager/NetworkManager.conf 把最后一行的managed=false改为managed=true。 保存重启即可。 // 安装谷歌 // wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb // dpkg -i google-chrome-stable_current_amd64.deb //

Checking for installed packages and if not found install

老子叫甜甜 提交于 2019-12-03 05:49:23
问题 I need to check for installed packages and if not installed install them. Example for RHEL, CentOS, Fedora: rpm -qa | grep glibc-static glibc-static-2.12-1.80.el6_3.5.i686 How do I do a check in BASH? Do I do something like? if [ "$(rpm -qa | grep glibc-static)" != "" ] ; then And what do I need to use for other distributions? apt-get? 回答1: Try the following code : if ! rpm -qa | grep -qw glibc-static; then yum install glibc-static fi or shorter : rpm -qa | grep -qw glibc-static || yum

数霉派4buster系统更换镜像源

末鹿安然 提交于 2019-12-03 05:07:45
系统自带的源实在太卡了。于是更换。 备份源 sudo cp /etc/apt/sources.list /etc/apt/sources.list.bk     或者直接注释掉原来源(在前面加#) 使用nano编辑器更改文件/etc/apt/sources.list,sudo nano /etc/apt/sources.list 阿里云: deb http://mirrors.aliyun.com/debian buster main deb http://mirrors.aliyun.com/debian-security buster/updates main deb http://mirrors.aliyun.com/debian buster-updates main 中科大: deb http://mirrors.ustc.edu.cn/raspbian/raspbian/ buster main contrib non-free rpi 清华: 先安装https拉取:  ` sudo apt install apt-transport-https` # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib

How to compare Debian package versions?

假如想象 提交于 2019-12-03 04:46:32
问题 I looked at python-apt and python-debian , and they don't seem to have functionality to compare package versions. Do I have to write my own, or is there something I can use? Ideally, it would look something like: >>> v1 = apt.version("1:1.3.10-0.3") >>> v2 = apt.version("1.3.4-1") >>> v1 > v2 True 回答1: You could use apt_pkg.version_compare: import apt_pkg apt_pkg.init_system() a = '1:1.3.10-0.3' b = '1.3.4-1' vc = apt_pkg.version_compare(a,b) if vc > 0: print('version a > version b') elif vc

Ubuntu 软件管理

◇◆丶佛笑我妖孽 提交于 2019-12-03 04:18:05
Ubuntu软件管理:dpkg和apt    Debian软件包通常为预编译的二进制格式的扩展名“.deb”,类似rpm文件,   dpkg:package manager for Debian,类似于rpm, dpkg是基于Debian的系统的包管理器。可以安装,删除和构建软件包,但无法自动下载和安装软件包或其依赖项    APT:Advanced Packaging Tool,功能强大的软件管理工具,甚至可升级整个Ubuntu的系统,基于客户/服务器架构   APT工作原理:在服务器上先复制所有DEB包,然后用APT的分析工具genbasedir根据 每个DEB 包的包头(Header)信息对所有的DEB包进行分析,并将该分析结果记录在文 件夹base内的一个DEB 索引清单文件中,一旦APT 服务器内的DEB有所变动,要使用 genbasedir产生新的DEB索引清单。客户端在进行安装或升级时先要查询DEB索引清单, 从而获知所有具有依赖关系的软件包,并一同下载到客户端以便安装。当客户端需要安 装、升级或删除某个软件包时,客户端计算机取得DEB索引清单压缩文件后,会将其解 压置放于 /var/cache/apt/,而客户端使用apt-get install或apt-get upgrade命令的时 候,就会将这个文件夹内的数据和客户端计算机内的DEB数据库比对

Docker Debian apt Error Reading from Server

匿名 (未验证) 提交于 2019-12-03 03:05:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: It would seem that apt-get is having issues connecting with the repository servers. I suppose it is likely compatibility issues, as mentioned here , however the proposed solution of apt-get clean does not work for me. Also I am surprised, if this is the case, that there are not more people having my issue. MWE Dockerfile FROM debian:jessie RUN apt-get clean && apt-get update && apt-get install -y --no-install-recommends \ git $ docker build . docker build . Sending build context to Docker daemon 2.048 kB Step 0 : FROM debian:jessie --->

How to install g++ 4.9 on Debian Wheezy armel?

匿名 (未验证) 提交于 2019-12-03 02:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My Debian 7 armel embedded system currently has g++ 4.6, and I'd like to upgrade to g++ 4.9 to use new C++11 features. How do I do that? My current sources.list contents is: deb http://security.debian.org/ wheezy/updates main deb-src http://security.debian.org/ wheezy/updates main deb http://ftp.us.debian.org/debian wheezy main non-free deb-src http://ftp.us.debian.org/debian wheezy main non-free A simple apt-get install of the package does not work: root@arm:~# apt-get install g++-4.9 Reading package lists... Done Building dependency tree

Setup Java 6 annotation processing configuration for eclipse compiler with maven

匿名 (未验证) 提交于 2019-12-03 02:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: What's the best way to setup the eclipse project compiler configuration for Java 6 annotation processors? My solution is to setup the org.eclipse.jdt.apt.core.prefs and factorypath files manually. This is a bit cumbersome: Reference the processor jar in the factorypath file Configure the eclipse annotation processor output directory (org.eclipse.jdt.apt.genSrcDir property in org.eclipse.jdt.apt.core.prefs ) Add the eclipse annotation processor output directory as source folder One problem is that eclipse generated sources will be compiled

How can I get Chef to run apt-get update before running other recipes

拥有回忆 提交于 2019-12-03 02:34:52
问题 Right now I have the following in my Vagrantfile: config.vm.provision :chef_solo do |chef| chef.cookbooks_path = "cookbooks" chef.add_recipe "apt" chef.add_recipe "build-essential" chef.add_recipe "chef-redis::source" chef.add_recipe "openssl" chef.add_recipe "git" chef.add_recipe "postgresql::server" chef.add_recipe "postgresql::client" end In order to install the software added to my recipe_list, I need to get the VM to issue an apt-get update before installing the other software. I was

python-dev installation error: ImportError: No module named apt_pkg

匿名 (未验证) 提交于 2019-12-03 02:25:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am Debian user, and I want to install python-dev, but when I run the code in the shell as a root: # aptitude install python-dev I get the following error: Traceback ( most recent call last ): File "/usr/bin/apt-listchanges" , line 28 , in import apt_pkg ImportError : No module named apt_pkg What seems to be the problem and how can I resolve it? 回答1: Make sure you have a working python-apt package. You could try and remove and install that package again to fix the problem with apt_pkg.so not being located. apt - get install python