如何编写Bash脚本来安装和配置Postfix(适用于Debian或Ubuntu).
这是我安装Postfix的方法:
sudo apt-get install postfix
Run Code Online (Sandbox Code Playgroud)
然后我重新配置它:
sudo dpkg-reconfigure postfix
Run Code Online (Sandbox Code Playgroud)
如何使用预定义的答案集创建一个自动回答重新配置问题的脚本?或者还有其他方法吗?
我是Linux/Debian的新手(挤压).我正在尝试使用apt-get来安装git并收到此错误消息.
读取包列表...完成构建依赖关系树
读取状态信息...完成包git-core不可用,但由另一个包引用.这可能意味着包丢失,已被淘汰或仅可从其他来源获得E:包"git-core"没有安装候选者
我尝试编辑我的sources.list到以下
#deb cdrom:[Debian GNU/Linux 6.0.5 Squeeze - 官方i386 DVD Binary-1 20120512-13:45] />挤压contrib main
#deb cdrom:[Debian GNU/Linux 6.0.5 Squeeze - 官方i386 DVD Binary-1 20120512-13:45]/squeeze contrib main
deb http://security.debian.org/ squeeze/updates main contrib deb-src http://security.debian.org/ squeeze/updates main contrib
deb http://ftp.us.debian.org/debian/ squeeze/updates main contrib deb-src http://ftp.us.debian.org/debian/ squeeze/updates main contrib
deb http://http.us.debian.org/debian squeeze/updates main contrib deb-src http://http.us.debian.org/debian squeeze/updates main contrib
#queeze-updates,以前称为'volatile'
#安装期间未选择网络镜像.以下条目
#是作为示例提供的,但您应该根据需要进行修改
#为您选择的镜子.
#
deb http://ftp.debian.org/debian/ squeeze-updates main contrib deb-src http://ftp.debian.org/debian/ squeeze-updates main contrib
正如我所说,我对此非常新,所以我不知道sources.list文件中需要什么.我现在无法安装任何东西.我也试过安装php并得到了同样的错误.请帮忙 :(
我需要帮助才能在我的Debian 7.2系统上安装emacs.我查看了许多其他表单,无法安装emacs.
我已经尝试运行"sudo apt-get install emacs","sudo apt-get install emacs23",以及任何其他类型emacs的方式.
我也尝试过返回404错误.
sudo apt-get update
W: Failed to fetch http://ppa.launchpad.net/cassou/emacs/ubuntu/dists/wheezy/main/binary-i386/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
jon@debian:~$ apt-cache policy
Package files:
100 /var/lib/dpkg/status
release a=now
500 http://emacs.naquadah.org/ stable/ Packages
release o=jd,a=stable,n=stable,l=jd,c=
origin emacs.naquadah.org
500 http://security.ubuntu.com/ubuntu/ precise-security/main Translation-en
500 http://security.ubuntu.com/ubuntu/ precise-security/main i386 Packages
release v=12.04,o=Ubuntu,a=precise-security,n=precise,l=Ubuntu,c=main
origin security.ubuntu.com
Pinned packages:
jon@debian:~$ apt-cache policy emacs
emacs:
Installed: (none)
Candidate: 23.3+1-1ubuntu9.1
Version table: …
Run Code Online (Sandbox Code Playgroud) $ cat /etc/apt/sources.list
## Note, this file is written by cloud-init on first boot of an instance
## modifications made here will not survive a re-bundle.
## if you wish to make changes you can:
## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg
## or do the same in user-data
## b.) add sources in /etc/apt/sources.list.d
## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb https://old-releases.ubuntu.com/releases/ focal …
Run Code Online (Sandbox Code Playgroud) 尝试安装php7.4-dev
扩展,但我得到了
E: Unable to locate package php7.4-dev
E: Couldn't find any package by glob 'php7.4-dev'
E: Couldn't find any package by regex 'php7.4-dev'
Run Code Online (Sandbox Code Playgroud)
当我运行时apt show php
它显示以下内容:
Package: php
Version: 1:7.2+60ubuntu1
Priority: optional
Section: php
Source: php-defaults (60ubuntu1)
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 12.3 kB
Depends: php7.2
Supported: 5y
Download-Size: 3,084 B
APT-Sources: http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
Description: server-side, HTML-embedded scripting language (default)
PHP (recursive acronym for PHP: …
Run Code Online (Sandbox Code Playgroud) 我正在使用Linux服务器并且正在安装jdk软件包.但是,当我尝试sudo apt时,我收到以下错误:
sudo: apt-get: command not found
Run Code Online (Sandbox Code Playgroud)
Linux的版本是:
3.10.0-229.el7.x86_64 GNU/Linux
Run Code Online (Sandbox Code Playgroud)
无法弄清楚什么是错的
apt ×6
debian ×3
linux ×2
apt-get ×1
bash ×1
debconf ×1
emacs ×1
git ×1
php ×1
php-7.4 ×1
postfix-mta ×1
sudo ×1
ubuntu-18.04 ×1
ubuntu-19.04 ×1