zoukankan      html  css  js  c++  java
  • Debian系统简要说明

    Debian这个是我最喜欢也是比较熟悉的一个系统了,BD下做个简要说明

    一,APT以及dpkg常见用法如下:
    功能具体语句
     软件源设置     /etc/apt/sources.list
     更新软件源数据  apt-get update
     更新已安装软件  apt-get upgrade
     更新系统版本    apt-get dist-upgrade
     通过安装包或卸载包来修复依赖错    apt-get -f install
     搜索软件源数据      apt-cache search foo
     解压安装软件包      apt-get install foo
     重新安装软件包      apt-get --reinstall install foo
     删除软件包释放的内容          apt-get remove foo
     卸载软件,同时清除该软件配置文件     apt-get --purge remove foo
     删除不需要的包      apt-get autoclean
     删除所有已下载的包  apt-get clean
     自动安装编译一软件所需要的包    apt-get build-dep foo
     
    APT——Advanced Package Tool
    功能
     具体语句
     显示DEB包信息         dpkg -I xx.deb
     显示DEB包文件列表       dpkg -c xx.deb
     安装DEB包              dpkg -i xx.deb
     安装DEB包(指定根目录) dpkg --root=<directory> -i xx.deb
     显示所有已安装软件      dpkg -l
     显示已安装包信息        dpkg -s foo
     显示已安装包文件列表    dpkg -L foo
     卸载包                  dpkg -r foo
     卸载软件包并删除其配置文件    dpkg -P foo
     重新配置已安装程序            dpkg-reconfigure foo    
     
    从软件源中编译软件流程(适用于少量代码改动或者配置修改) 
     功能具体语句
     示例
     获取源码 apt-get source fooapt-get source rox-filer
     安装编译依赖    apt-get build-dep foo   apt-get build-dep rox-filer
     解压源码       dpkg-source -x foo_version-revision.dsc
                    dpkg-source -x rox_2.11-3.dsc
     修改源码部分    nano ROX-Filer/src/main.c
     创建包         dpkg-buildpackage -rfakeroot -b
     修改软件可升级状态    echo -e "foo hold" | dpkg --set-selections
    二,用dpkg解包打包(或者修改包)的简单用法
    1,新建必要文件control
    mkdir -p dirname/DEBIAN(dirname名随意,将生成的usr bin lib之类的文件复制到dirname目录下,dirname/为伪根目录)
    nano dirname/DEBIAN/control,最简陋的格式如下:
    Package: foo
    Version: version-revision
    Architecture: amd64
    Maintainer: xxx
    Priority: extra
    Description: xxx
    2,生成DEB包
    dpkg-deb -b --deb-format=2.0 -Zxz -z9 dirname foo_version-revision_arch.deb (为了便于管理包名应遵循DEB包命名格式)
    3,解压DEB包安装文件部分
    mkdir newdir && dpkg -x foo_version-revision_arch.deb newdir/
    4,解压DEB包控制信息部分
    mkdir newdir && dpkg -e foo_version-revision_arch.deb newdir/
    5,用ar命令解压DEB包
    mkdir newdir
    cd newdir && ar x foo_version-revision_arch.deb
    三,添加常用软件管理命令简短别名
    软件管理是一个现代操作系统的基本功能,使用十分频繁,因此有必要设置简短的别名,仅字符界面有效添至~/.profile,仅图形界面有效添至~/.bashrc,比如
    export LC_MESSAGES=en_US.UTF-8
    alias a="apt-get install --no-install-recommends"
    alias b="dpkg-deb -b --deb-format=2.0 -Zxz -z9"
    alias c="SDCV_PAGER=more sdcv --color -0 -1"
    alias i="dpkg -i"
    alias l="dpkg -l | grep"
    alias la="ls --file-type -a"
    alias ll="la --time-style=long-iso -lh"
    alias s="apt-cache search"
    alias r="apt-get --purge remove"
    alias u="apt-get update;apt-get upgrade"

    Smartkeke
  • 相关阅读:
    【Leetcode】【Easy】Remove Duplicates from Sorted List
    【Leetcode】【Easy】Pascal's Triangle II
    【Leetcode】【Easy】Pascal's Triangle
    【Leetcode】【Easy】Binary Tree Level Order Traversal II
    【Leetcode】【Easy】Binary Tree Level Order Traversal
    【Leetcode】【Easy】Maximum Depth of Binary Tree
    【Leetcode】【Easy】Minimum Depth of Binary Tree
    【Leetcode】【Easy】Balanced Binary Tree
    【Leetcode】【Easy】Symmetric Tree
    如何使用Action.Invoke()触发一个Storyboard
  • 原文地址:https://www.cnblogs.com/smartkeke/p/6826149.html
Copyright © 2011-2022 走看看