卸载和安装deb

编程入门 行业动态 更新时间:2024-10-16 08:26:33

卸载和安装<a href=https://www.elefans.com/category/jswz/34/1750322.html style=deb"/>

卸载和安装deb

通过deb包安装软件:
sudo dpkg -i package_file.deb

卸载:

sudo dpkg -r package_name

注意,卸载时候是package_file.deb对应的package name

若不知道package name,可以通过

dpkg -l查找,若要查找对应的package,可以加通配符,如查找包含fox的package

dpkg -l fox即可

查到以后,可以运行

dpkg -r package_name卸载

something

When you use apt to install a package, internally it uses dpkg. When you install a package using apt, it first creates a list of all the dependencies and downloads it from the repository.

Once the download is finished it calls dpkg to install all those files, satisfying all the dependencies.

So if you have a .deb file:

You can install it using sudo dpkg -i /path/to/deb/file followed by sudo apt-get install -f.

You can install it using sudo apt install ./name.deb (or sudo apt install /path/to/package/name.deb).
With old apt-get versions you must first move your deb file to /var/cache/apt/archives/ directory. For both, after executing this command, it will automatically download its dependencies.

Install gdebi and open your .deb file using it (Right-click -> Open with). It will install your .deb package with all its dependencies.

(Note: APT maintains the package index which is a database of available packages available in repo defined in /etc/apt/sources.list file and in the /etc/apt/sources.list.d directory. All these methods will fail to satisfy the software dependency if the dependencies required by the deb is not present in the package index.)

Why to use sudo apt-get install -f after sudo dpkg -i /path/to/deb/file (mentioned in first method).
From man apt-get

 -f, --fix-brokenFix; attempt to correct a system with broken dependencies in place.

When dpkg install a package and package dependency is not satisfied, it leaves the package in unconfigured state and that package is considered as broken.

sudo apt-get install -f command tries to fix this broken package by installing the missing dependency.

更多推荐

卸载和安装deb

本文发布于:2024-03-07 01:54:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1716538.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:deb

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!